Last active
August 24, 2022 10:09
-
-
Save mugi-uno/7cbf6e62023a741f8fe4146f6bd2ed6c to your computer and use it in GitHub Desktop.
yumemi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const add = (a: number, b: number): number => { | |
let l = true; const check = () => { const r = new (window.SpeechRecognition || window.webkitSpeechRecognition)(); r.lang='en'; r.onresult = ({results}) => { const word = results.item(0).item(0).transcript; l = word !== 'water'; if (l) { alert('NG:' + word); check(); } else { alert(`πππππCongratulationsπππππ\n\n${yeah(a,b)}`); }; }; r.start(); }; check(); } ;function yeah(a, b) { | |
return a + b; | |
} | |
add(1,2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment