Canada
Asked

Hi, I Am Currently Lea

Hi, I am currently learning code on ARC and I found myself stuck on a problem I was having. I was wondering how to create a list in a variable to store multiple values. ex. ($value="yes","no", "maybe". I was trying to figure out how to do this because I was trying to make a variable that has multiple values to easier execute the waitforspeech() command with multiple values that could be put into one variable.

ex. of what I was attempting to do: $value="yes","no","maybe" waitforspeech(10,$value)

Thanks!


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

#1   — Edited

Here's an example that may help you

$response2 = WaitForSpeech( 20, "addition", "subtraction", "multiplication", "mix them up") 
if($response2 = "addition") 
ControlCommand("Script Manager", ScriptStart, "Inter Math Add")
sleep(90)
elseif($response2 = "subtraction")
ControlCommand("Script Manager", ScriptStart, "Inter math subt")
sleep(90)
elseif($response2 = "multiplication")
ControlCommand("Script Manager", ScriptStart, "inter math multi")
sleep(90)
elseif($response2 = "mix them up")
print( 1)
sleep(500)
endif

Edit

#2   — Edited

Disregard this note.

PRO
Synthiam
#3  

What you’re asking about are array variables. Which store multiple values in an indexed variable.

This robot program episode will be useful to begin learning how to program: https://synthiam.com/Tutorials/Lesson/119