Is this correct? if not please help!
I am ten.
when gf clicked ask [what is your operator? +,-,*,and /] and wait if < (awnser) = [+]> set [awnser v] to < (value1) + (value2)> end broadcast [add v] if < (awnser) = [-]> set [awnser v] to < (value1) - (value2)> broadcast [sub v] end if < (awnser) = [*]> set [awnser v] to < (value1) * (value2)> broadcast [multi v] end if < (awnser) = [/]> set [awnser v] to < (value1) / (value2)> broadcast [div v] end When I recive [add v] ask [what do you want to add (first number)] and wait set [value1 v] to (awnser) ask [what do you want to add (second number)] and wait set [value2 v] to (awnser) say [ithink] say [(value1)] say [plus] say [(value2)] say [is] say [(awnser)]then i did all the other when i recive stuff and my kitty thinks all the things i ask it are zero
Offline
Flycon2002 wrote:
Is this correct? if not please help!
I am ten.when gf clicked ask [what is your operator? +,-,*,and /] and wait if < (awnser) = [+]> set [awnser v] to < (value1) + (value2)> end broadcast [add v] if < (awnser) = [-]> set [awnser v] to < (value1) - (value2)> broadcast [sub v] end if < (awnser) = [*]> set [awnser v] to < (value1) * (value2)> broadcast [multi v] end if < (awnser) = [/]> set [awnser v] to < (value1) / (value2)> broadcast [div v] end When I recive [add v] ask [what do you want to add (first number)] and wait set [value1 v] to (awnser) ask [what do you want to add (second number)] and wait set [value2 v] to (awnser) say [ithink] say [(value1)] say [plus] say [(value2)] say [is] say [(awnser)]then i did all the other when i recive stuff and my kitty thinks all the things i ask it are zero
I don't know. I would do:
when gf clicked ask [What operation would you like to use? +, -, *, /] and wait if <(answer) = [+]> set [operation v] to [+] broadcast [next v] end if <(answer) = [-]> set [operation v] to [-] broadcast [next v] end if <(answer) = [*]> set [operation v] to [*] broadcast [next v] end if <(answer) = [/]> set [operation v] to [/] broadcast [next v] end
when I receive [next v] ask [First value?] and wait set [first value v] to (answer) ask [Second value?] and wait set [second value v] to (answer) if <(operation) = [+]> set [answer v] to ((first value) + (second value)) end if <(operation) = [-]> set [answer v] to ((first value) - (second value)) end if <(operation) = [*]> set [answer v] to ((first value) * (second value)) end if <(operation) = [/]> set [answer v] to ((first value) / (second value)) end
Last edited by curiouscrab (2012-08-23 22:08:18)
Offline
Flycon2002 wrote:
Is this correct? if not please help!
I am ten.when gf clicked ask [what is your operator? +,-,*,and /] and wait if < (awnser) = [+]> set [awnser v] to < (value1) + (value2)> end broadcast [add v] if < (awnser) = [-]> set [awnser v] to < (value1) - (value2)> broadcast [sub v] end if < (awnser) = [*]> set [awnser v] to < (value1) * (value2)> broadcast [multi v] end if < (awnser) = [/]> set [awnser v] to < (value1) / (value2)> broadcast [div v] end When I recive [add v] ask [what do you want to add (first number)] and wait set [value1 v] to (awnser) ask [what do you want to add (second number)] and wait set [value2 v] to (awnser) say [ithink] say [(value1)] say [plus] say [(value2)] say [is] say [(awnser)]then i did all the other when i recive stuff and my kitty thinks all the things i ask it are zero
I think you might use
when gf clicked ask [first number] and wait set [value1 v] to (answer) ask [second number] and wait set [value2 v] to (answer) ask [what is your operator? +,-,*,and /] and wait if < (answer) = [+]> set [awnser v] to <(value1) + (value2)> end if < (answer) = [-]> set [awnser v] to <(value1) - (value2)> end if < (answer) = [*]> set [awnser v] to <(value1) * (value2)> end if < (answer) = [/]> set [awnser v] to <(value1) / (value2)> end say [I think] say (value1) say (answer) say (value2) say [is] say (awnser) stop script
Offline
I found this calculator
http://scratch.mit.edu/projects/lizzyhippo/2782632
Offline
Currently it isn't correct. There are two ways you can correct it in.
One option is changing the order in the way krzysiogawl01 did.
The other option is to do this:
When gf clicked ask [What is your operator? +,-,*,/] and wait if <(answer) = [+]> broadcast [add v] set [answer1 v] to <(value1) + (value2)> end if <(answer) = [-]> broadcast [sub v] set [answer1 v] to <(value1) - (value2)> end if <(answer) = [*]> broadcast [mult v] set [answer1 v] to <(value1) * (value2)> end if <(answer) = [/]> broadcast [div v] set [answer1 v] to <(value1) + (value2)> end say <join [I think the answer is ] (answer1)>
When I receive [add v] ask [What do you want to add? (First number)] and wait set [value1 v] to (answer) ask [What do you want to add? (Second number)] and wait set [value2 v] to (answer) stop scriptetc.
Last edited by Smozzick (2012-10-04 09:15:15)
Offline