0
Helpppp me plz
I need help with making the program I'm making choose a random else statement https://code.sololearn.com/cP7jsJ2pbq46/?ref=app
10 odpowiedzi
+ 10
javascript will probably be harder... python is one of the easier languages.
+ 10
So you have an if statement. If it is not evaluated to true, then yo want it to execute some random thing? I am a little confused as to what you want...
+ 10
So you want one of those to be chosen. Well, I would have only one else statement that combines all of your possible outputs. You can generate a random integer and use that in a switch and have the possibilities for the integer be the cases of the switch. I hope this makes sense.
+ 9
Just generate a random int between [1 and 2 in your case] and have a switch with case 1 being one of the else statements and case 2 being the other else statement.
Or you could generate random between 0 and 1 and use another if statement (true or false)
Does this make sense?
+ 9
Hmm... Okay. Whatever you want. I would suggest going through the tutorials more to learn the languages better. They explain all of this; switch caes, randInt generation, if/else and nesting... They are there for a reason. But whatever you want to do. :)
+ 1
I want to make it choos a random else I put two else's but I need the program to chose a random else thing
https://code.sololearn.com/cP7jsJ2pbq46/?ref=app
+ 1
but how
+ 1
I'm done learning python f*** this s*** plz don't ban me imma go learn some fu***** JavaScript
+ 1
fu**************** ima go learn swift