ID:165386
 
this isn't really a problem... i was just wondering, i know this:
switch(input("what kind of pain?")in list("Death","Extreme Pain","Poison","Paralysis"))

and i know this
switch(alert("really commit suicide?","","Yes","No","Cancel"))

but what other types of switch are there? like the one that lets yoiu type in a number? thanks =)
Adam753 wrote:
this isn't really a problem... i was just wondering, i know this:
switch(input()in list())
and i know this
switch(alert())
but what other types of switch are there? like the one that lets yoiu type in a number? thanks =)

What are you talking about??
In response to LilMain
i meant what other kinds of switch(()) are there?
If you want text to be the only thing you can input :

switch(input("Text Input")as text)


If you want numbers to be the only thing you can input :

switch(input("Number Input")as num)
you can put pretty much anything inside of a switch(). the input() proc returns what you selected, which in this case is a string. so while it looks like you're sending input() to the switch(), you're sending the string returned by input() to the switch.

switch(input("what kind of pain?")in list("Death","Extreme Pain","Poison","Paralysis"))


that code is basically the same as doing this:

var/choice = input("what kind of pain?")in list("Death","Extreme Pain","Poison","Paralysis")
switch(choice)