Switch - Show Menu Issue [SOLVED]

Anonynn
18 Jun 2016, 18:22Here's the code.
msg ("<br/>What would you like to modify? Please type in your response without quotations. <br/><br/>\"gender\"<br/>\"race\"<br/>\"haircolor\"<br/>\"eyecolor\"<br/>\"hairlength\"<br/>\"skin\"<br/>\"fur\"<br/>\"feathers\"<br/>\"scales\"<br/>\"height\"<br/>\"weight\"<br/>\"lips\"<br/>\"nails\"<br/>\"background\"<br/>\"speciality\"<br/>\"tail\"<br/>\"wings\"<br/>\"thiefskill\"<br/>\"resist\"<br/>\"maximum carry\"<br/>\"transform\"<br/>\"piercing\"<br/>\"clothing\"<br/>\"weapon\"<br/>\"name\"<br/><br/>Or type anything else to cancel. <br/>")
switch (LCase("result")) {
case ("gender") {
menulist = NewStringList()
list add (menulist, "female")
list add (menulist, "male")
ShowMenu ("Please Choose Your New Gender From The List Below.", menulist, true) {
if (result="male") {
SetTo ("gender", "male")
msg ("<br/>You are now male!<br/>")
}
else if (result="female") {
SetTo ("gender", "female")
msg ("<br/>You are now female!<br/>")
}
}
}
Anyone know what's going wrong?
The Pixie
18 Jun 2016, 20:39switch (LCase("result")) {
You may need more brackets to balance.
Also, a quick way to get a string list is with Split, one line instead of three
menulist = Split("male;female", ";")

Anonynn
18 Jun 2016, 20:49
Also, a quick way to get a string list is with Split, one line instead of three
menulist = Split("male;female", ";")
^ also that is a fantastic tip! Thank you!

jaynabonne
18 Jun 2016, 21:10switch (LCase(result)) {
without the quotes. Otherwise, you're always comparing the string "result" instead of the result variable.

jaynabonne
18 Jun 2016, 21:13SetTo ("gender", result)
msg ("<br/>You are now " + result + "!<br/>")
rather than the if/else.

Anonynn
18 Jun 2016, 21:43
jaynabonne
18 Jun 2016, 22:05Hope it's working now...


Anonynn
18 Jun 2016, 22:53
XanMag
19 Jun 2016, 00:46jaynabonne wrote:As they say, the expert is just the one who has already made the mistakes. So each mistake brings you that much closer!
Hope it's working now...
Son of a...!
I've made so many mistakes I should be an expert 100 times over. Why am I not an expert?!?


Anonynn
19 Jun 2016, 00:53HegemonKhan
19 Jun 2016, 02:08

jaynabonne
19 Jun 2016, 03:59HegemonKhan wrote:I've been trying to learn to code+quest for ~4 years now... why am I not learning faster?!... (because I'm stupid!)
Just saw this the other day. Maybe it will help.

https://medium.freecodecamp.com/one-doe ... 5bacdc5b62
HegemonKhan
19 Jun 2016, 05:10I think the problem is that at first you're able to learn a lot, as it's the easiest/most basic stuff, but then you're trying to learn harder and harder stuff, so what you learn and how much new stuff you learn, starts to really slow down, especially if you hit a plataeu, and are not able to jump up quickly to that higher/next next level of coding and/or organizational/designing thinking that is needed.
---------
decent "cheer up" article, though I assume the site also has coding lessons, so I'll definately take a look at it at some point (still got a lot of code academy lessons to do, along with haven't tried udemy either, along with trying to practice at java and assembly and circuitry/architecture, my laziness is the biggest problem, as it gets a bit boring when you're just trying to learn to code on your own. I'll definately like coding, when I can code faster and get finished works done and done faster/more-soon, but when you're limited in what you can tangibly accomplish/show for your hard work, it's demoralizing and boring, at this early learning/struggling stage).
The Pixie
19 Jun 2016, 07:49jaynabonne wrote:Just saw this the other day. Maybe it will help.
https://medium.freecodecamp.com/one-doe ... 5bacdc5b62
Made me go through my tutorials on Quest and see how often I use "simply". Only twice (and one of those was "simply cannot")!
HegemonKhan wrote:Also, being lazy doesn't help when it comes to learning to code. ...
Yes it does.
http://blogoscoped.com/archive/2005-08-24-n14.html
I am not a coder by profession, but i have coded for my job, and I did it to save me effort. In the log run, it was easier to get the computer to do the drudgery, rather than me.
HegemonKhan
19 Jun 2016, 08:37my big problem is I simply don't pay attention between when the word is suppose to be "simpl-E" vs "simpl-Y", lol.