• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TicTacToe Game

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's one I wrote in JavaScript:
http://ostermiller.org/calc/tictactoe.html
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic