
-----------------------------------
ialoguh
Tue Jul 17, 2012 2:17 pm

Need help with a Tic Tac Toe Program!
-----------------------------------
What is it you are trying to achieve?
I am trying to write a Tic Tac Toe program

What is the problem you are having?
I can't make the program switch turns.

Describe what you have tried to solve this problem
I tried using a even/odd method but every time I do that it just draws the X and the O in the same spot

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
setscreen ("graphics:600,620")

Draw.Line (0,200,600,200, black)
Draw.Line (0,400,600,400, black)
Draw.Line (200,0,200,600, black)
Draw.Line (400,0,400,600, black)

var xvalue,yvalue,b:int
var count:int:= 0
var turn:boolean

%%%%%%%% procedures %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% changing turns %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure switch
    if count mod 2 = 0 then
        turn := true
    else
        turn := false
    end if
end switch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% drawing x %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure drawx
    for x: 0..400 by 200
        for y: 0..400 by 200
            if xvalue>x and xvaluey and yvaluex and xvaluey and yvalue