Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TicTacToe Game

 
doburomirushii nikku
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, Heres the deal. I have my program able to play tictactoe. (Switch turns, Write in the "X" or "O" on the square you pick, and disable the player from picking an already picked square.)

All, I need to do now is make a winning procedure. Now I know I did this before ..(in pascal), but Everytime I write something its not even close to working.

I think you can create some sort of loop the checks one square foe a value and then have it check x+1 for the next square Can anyone give me a hint? If I can dig up that pascal program maybe I can just use that as a model. Thanks.


[ December 08, 2006: Message edited by: doburomirushii nikku ]
 
Billy Bob
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you go to www.gamedevelopersclub.org, click on Tutorials, there is a tic-tac-toe tutorial on there. It's written in C for the GBA, but the win function is nothing but an if statement. Not very elegant, but it does get the job done, hope it helps.
 
doburomirushii nikku
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, thanks. That is exactly what I wanted! I was kinda lookin for it in a loop so I could do 5x5 tic tac toe easier when im done with 3x3. But 3x3 is done so thanks!
 
Steve Deadsea
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's one I wrote in JavaScript:
http://ostermiller.org/calc/tictactoe.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic