If statement not exectuing?
Author |
Message |
Tasty Pastry
|
Posted: Thu Jun 08, 2017 8:07 am Post subject: If statement not exectuing? |
|
|
I'm making a game in turing, and I have one part where the user is asked for an input by clicking the mouse. The program executes the part where the mouse is clicked, but doesn't execute the if statement after. Am I doing something wrong?
Turing: |
loop
Mouse.Where (mousex,mousey,buttonpress )
if buttonpress= 1 then
if 480<mousex and mousex< 585 then
if 455>mousey and mousey> 405 then
girl := 1
put "Girl"
end if
end if
end if
if buttonpress = 1 then
if 787<mousex and mousex< 858 then
if 447>mousey and mousey> 410 then
boy := 1
put "Boy"
end if
end if
end if
exit when girl = 1 or boy = 1
end loop
cls
if girl = 1 then
ReText
TypewriterPrint ("So I'm a girl...")
else if boy = 1 then
ReText
TypewriterPrint ("So I was right...")
end if
end if
ReText
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Thu Jun 08, 2017 8:37 am Post subject: RE:If statement not exectuing? |
|
|
There is a difference between 'elsif' and 'else if'. Make sure you're using the right one. |
|
|
|
|
|
|
|