
-----------------------------------
montyburns
Wed Jan 07, 2004 11:17 am

tic tac toe (2)
-----------------------------------
Need help making ai for simple tic tac toe game in turing. here is my program that, so far, only inputs the x anywhere the user wants. if not a simple ai could i get help for having  a second person input using the mouse. i am a beginner. this includes programmer comments

%Declaration Section
var x, y, button : int

%Sets the screen size
setscreen ("graphics")
setscreen ("graphics:400;400")

%Makes the background
drawfillbox (0, 0, maxx, maxy, black)

%Draws the large box
drawbox (5, 5, maxx - 5, maxy - 5, yellow)

%Draws the smaller boxes
drawline (maxx div 3, maxy - 5, maxx div 3, 5, yellow)
drawline (maxx div 1.5, maxy - 5, maxx div 1.5, 5, yellow)
drawline (maxx - 5, maxy div 3, 5, maxy div 3, yellow)
drawline (maxx - 5, maxy div 1.5, 5, maxy div 1.5, yellow)

%puts the x's in the boxes which have been clicked
loop
    mousewhere (x, y, button)
    if x >= 5 and x = maxy div 1.5 and y = maxx div 3 and x = maxy div 1.5 and y = maxx div 1.5 and x = maxy div 1.5 and y = 5 and x = maxx div 3 and x = maxx div 1.5 and x = 5 and x = 5 and y = maxx div 3 and x = 5 and y = maxx div 1.5 and x = 5 and y 