Created
August 1, 2012 18:16
-
-
Save FrancoB411/3229447 to your computer and use it in GitHub Desktop.
Simple test app, goofing around with google blockly.
This file contains hidden or 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
| var no; | |
| var name2; | |
| var yes; | |
| var gender; | |
| var so; | |
| var comma; | |
| var iscool; | |
| var invitationQuestion; | |
| function convo() { | |
| name2 = window.prompt('please enter your name'); | |
| printCool(); | |
| isFemale_(); | |
| findOutIfFemale(); | |
| } | |
| function findOutIfFemale() { | |
| if (gender != (yes || no)) { | |
| window.alert('I\'m a guy, so I only understand yes or no answers.'); | |
| isFemale_(); | |
| } | |
| if (gender == yes) { | |
| printInvite(); | |
| } | |
| if (gender == no) { | |
| sup(); | |
| } | |
| } | |
| function isFemale_() { | |
| gender = (window.prompt('Are you female? Yes or No?')).toLowerCase(); | |
| } | |
| function printCool() { | |
| window.alert('Cool.'); | |
| } | |
| function printIsCool() { | |
| window.alert(name2 + iscool); | |
| } | |
| function sup() { | |
| window.alert('Oh, hey. What\'s up bro?'); | |
| } | |
| function printInvite() { | |
| window.alert((so + name2) + (comma + invitationQuestion)); | |
| } | |
| no = 'no'; | |
| yes = 'yes'; | |
| so = 'So '; | |
| comma = ', '; | |
| invitationQuestion = 'What are you doing later?'; | |
| iscool = ' is cool.'; | |
| convo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment