Pierpont: Well, that’s still not working. Now I get no prompt at all.
Behunin: No, I am trying to show you how to organize your code
Minden: The prompt will come later
Kogan: Open up the console in jsbin and look at the output of the console.log statements – these print out results from calls to our functions
Steep: I can get the prompt, but if I just put in unmatching string into the promp, it still lets me play.
Larve: Did you reverse the operators?
Lindabury: Shouldn’t that make the While function loop until userChoice is equal to one of the three strings I have?
Buckbee: No, you want to break when user choice is one of the choices
Brazzi: But please look at the jsbin I posted, using the functions I provide there will make your life much easier
Ihnen: Now I am working on the comparison between the different choices, and it will be done
Garrity: I have, and really appreciate it. But I’m trying to get this to work before I do anything else
Kritikos: My point is that if you use something like isValidEntryuserChoice will make it much clearer what is happening, and will reduce the chance of bugs greatly
Zeyer: And this is what you are struggling with, a bug
Leigers: So organizing your code is not so much about beauty, necessarily
Stars: It helps you understand what is going on
Tauber: Noone can follow a gazillion binary comparisons and if/else statements in their head without help
Michales: Wernert: oh, excuses :
Laumeyer: Still, if you intend anyone to read your code.
Escandon: Alright, well I guess it’s a lost cause then. I’ve been trying to solve this for multiple hours now and can’t figure it out for the life of me,.
Zelazo: Noob321: almost done with the prompts, patience pleaase
Kotch: You’re essentially just rewriting the whole thing though. I’m trying to get it to function as is with stuff I have already learned. It’s my first day ever coding anything. I understand that the code could be better, but I’m just trying to figure that one thing out.
Gibby: Noob321: but reading others’ code is a major source of learning, seriously
Belue: You will see how I solved this and compare it, and then learn
Janosek: I would say your solution is probably not a great one for someone who literally just started programming.
Rakoczy: I think Noob321 is going about it in a reasonable manner. overwhelming someone with advanced techniques is not a great idea.
Pigue: Tcsc: maybe I went a bit overboard, true
Stuchlik: Tcsc: var self = this; — is that so that the ‘this’ doesn’t get confused with something, or is it a shorthand you prefer for readability ?
Burn: But I do believe that capturing your logic into functions should be encouraged from the start
Mcmaster: Baxx: its so it doesnt get confused with something
Chapen: It’s so it is available in the inner function
Lale: Without having to explicitly bind it
Stuchlik: Nearly commented that file 😛 ha
Belay: I’d still like to see what you’ve come up with monomon. There’s definitely a lot of knowledge to be had by looking at others code, but I’m not sure it will help me with this particular problem.
Schoepfer: Noob321: have you updated your jsbin with the change from to &&? because there is still an infinite loop if I load it
Gullette: I have monomon, the loop still continues.
Ota: Noob321: You should use the console.log or alert to test everything to make sure they are returning what you think they are.
Sirwet: Noob321: I think I spot a problem, at least in the gist
Elsbree: You need to take out the while look as it’s doing an infinite loop.
Prato: There is a ; right after the closing on line 11
Bottex: Baxx: i actually fixed a bunch of bugs with the version i had showed you before: http://jsfiddle.net/kxL8e52w/ ended up making it perform better too. it’s still crap since there are some simulation stability issues hence the jitter, but its uh, better than it had been before.