This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

TheJH
TheJH presents ...

2008/12/14

TicTacWin

This tic-tac-toe works with a very good engine that precalculates all available things that can happen, so you can't win aganist it.
Little bug: When the computer wins, the game goes on running.

5080 views / 6 in the last 7 days

1 vote | 0 in the last 7 days

Tags: game tic-tac-toe

Your browser does not support the canvas tag.
RHE_THSRHE_THS

2008/12/14

I won...
mjrb4mjrb4

2008/12/14

Bigger bug: your logic is incorrect here - you can win - try bottom left, top right, bottom right, bottom middle - that looks like a win to me! There IS a way to make sure that the human can't win, but you have to be cleverer than just looping through all the possible things that can happen for that move, you have to stop the game getting into a situation where a win is inevitable (which is what happens in the above example.)
mjrb4mjrb4

2008/12/14

If you get really stuck, you can have a look here at something I did a while back - http://mikkle.co.uk/content/naughts-and-crosses - it's a netbeans project that uses Swing rather than Greenfoot and the coding isn't the neatest, but the logic's all there and it (I think) works as it should - so you can't win that is ;)
haikalhaikal

2009/7/1

where the source...???
thoysthoys

2011/3/17

Year why cant we download the source?? (nice game)

Want to leave a comment? You must first log in.

Who likes this?

ndav3a