
-----------------------------------
meidan
Wed Jun 14, 2006 8:12 pm

help me plz
-----------------------------------
how do you make a computer opponent in tic tac toe?

-----------------------------------
CodeMonkey2000
Wed Jun 14, 2006 8:14 pm


-----------------------------------
you can have a whole bunch of if statements where if this square and this square is taken, then the opponent must go in this square to block me off.

-----------------------------------
meidan
Wed Jun 14, 2006 8:17 pm


-----------------------------------
ok i know the logic but how do i say that this square is blocked and for it to go to the other square?

-----------------------------------
CodeMonkey2000
Wed Jun 14, 2006 8:22 pm


-----------------------------------
mark it.
sqre 1 is taken, so sqre1=1 and squr2 is taken sor squr2=1
if sqre1 and sqre2 =1 then you have to go to sqre3 etc...

-----------------------------------
Tony
Wed Jun 14, 2006 8:41 pm


-----------------------------------
ok i know the logic but how do i say that this square is blocked and for it to go to the other square?
how do you know if the square is blocked or not for the human player? same approach.

-----------------------------------
meidan
Wed Jun 14, 2006 8:47 pm


-----------------------------------
ok i understand but i made my sqaures like this...

i made a box and said the coordinates so like

x >100 but  300 but 30 and y