Asked
— Edited

I am looking for a little help to finish off this script. The script as it is works, however, I want it to speak the sum of the 2 numbers. I have tried a few different ways but I can't get it. Hey, I pretty proud of getting this far with it. I've made a comment in the code of what I want it to say.
:start
$heard = "speech"
WaitForChange($heard)
if($Heard = "won")
$x = 1
Say("one")
elseif($heard="two")
$x = 2
Say("two")
endif
WaitForChange($heard)
if($heard = "plus one")
$y = 1
Say("plus one")
elseif($heard = "plus two")
$y = 2
Say("plus two")
#print($x + $y)
EndIf
WaitForChange($heard)
if($heard = "what does that equal")
#This is where I want it to say something like "$x plus $y equals the sum" or
for example "1 plus 2 equals 3" (if those were the numbers it heard)
print($x + $y)
Endif
GoTo(start)
As always any help is appreciated, Thanks
I copy and pasted your above example and for some reason you're right it didn't work... I then erased it and just typed in this time and it worked... Something about copy and pasting code from the forum into scripts that causes problems I guess...
It worked? I get this when I run it;
Ooops I see you are multiplying not adding... use the * symbol instead of x....
... and use / for division.....
That's what I needed thanks.
Here is the code I use to allow the robot to play math game with my 4 year old.
this example limits the answer to 1 to 10 for her age.
This is very interactive an she has a blast playing this with the robot.
I will modifiy this soon as we have sayezbwait()
Thanks, that's great. My granddaughter will love that!
@ Luis, Is there an email I can contact you at? or will you please contact me at [email protected].
Thanks Bob