
-----------------------------------
Tasty Pastry
Thu Jun 08, 2017 8:07 am

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?


loop
Mouse.Where (mousex,mousey,buttonpress)
  
if buttonpress=1 then
   if 480405 then
      girl := 1
      put "Girl"
end if
end if
end if
if buttonpress = 1 then
if 787410 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


-----------------------------------
Insectoid
Thu Jun 08, 2017 8:37 am

RE:If statement not exectuing?
-----------------------------------
There is a difference between 'elsif' and 'else if'. Make sure you're using the right one.
