Hi there...this isn't the exact code, but close enough (for brevity).
'Main
Global Plyr1 :int=0
Global Plyr2 :int=0
Global Winner :int=0
Plyr1=0
Plyr2=1
LogicModule()
print Winner
waitkey
End
Function LogicModule()
Winner=0
if Plyr1=0 and Plyr2=1 then Winner=1
return Winner
end function
Now, if I put the print inside the function, it will print a 1. When I put the print after the function call, it prints a 0. I'm assuming it's something to do with the RETURN not properly passing Winner back to the main program?
Help would be appreciated. Thanks!
'Main
Global Plyr1 :int=0
Global Plyr2 :int=0
Global Winner :int=0
Plyr1=0
Plyr2=1
LogicModule()
print Winner
waitkey
End
Function LogicModule()
Winner=0
if Plyr1=0 and Plyr2=1 then Winner=1
return Winner
end function
Now, if I put the print inside the function, it will print a 1. When I put the print after the function call, it prints a 0. I'm assuming it's something to do with the RETURN not properly passing Winner back to the main program?
Help would be appreciated. Thanks!