Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

TicTacToe Game

 
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 ]
 
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!
 
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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic