Created
July 18, 2012 04:29
-
-
Save drusepth/3134188 to your computer and use it in GitHub Desktop.
voice2code demo
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
Loading voice2code.js ... No errors! | |
process_speech_input("loop from 1 to 10") | |
=> Processing: loop from 1 to 10 | |
spoken_code | |
=> ["loop from 1 to 10"] | |
generated_code | |
=> ["for (gpNqkpKMvWYH = 1; gpNqkpKMvWYH <= 10; gpNqkpKMvWYH++) { {{loop_body}} }"] | |
code_metadata | |
=> [Object -- iterator: "gpNqkpKMvWYH", type: "loop", __proto__: Object] | |
process_speech_input("print the number") | |
=> Processing: print the number | |
spoken_code | |
=> ["loop from 1 to 10", "print the number"] | |
generated_code | |
=> ["for (gpNqkpKMvWYH = 1; gpNqkpKMvWYH <= 10; gpNqkpKMvWYH++) { console.log(gpNqkpKMvWYH); }"] | |
process_speech_input("print done") | |
=> Processing: print done | |
spoken_code | |
=> ["loop from 1 to 10", "print the number", "print done"] | |
generated_code | |
=> ["for (gpNqkpKMvWYH = 1; gpNqkpKMvWYH <= 10; gpNqkpKMvWYH++) { console.log(gpNqkpKMvWYH); } console.log('done')"] | |
run_code(generated_code); | |
=> 1 | |
=> 2 | |
=> 3 | |
=> 4 | |
=> 5 | |
=> 6 | |
=> 7 | |
=> 8 | |
=> 9 | |
=> 10 | |
=> done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment