home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Tic Tac Toe AI??

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2159
Discussions: 200,947, Posts: 2,379,375, Members: 246,307
Old March 23rd, 2003, 12:26 PM     #21 (permalink)
Member
 
Join Date: Mar 2002
Location: BYU - Provo
Posts: 43
Send a message via AIM to Fractile81 Send a message via Yahoo to Fractile81
qball, perhaps if you explained your "ttt player, NEVER lose, win OR tie" line because I sure don't get it.

It all depends on how "smart" you want this AI to be. The computers first turn should probably always be random, or perhaps always be center if it's not taken.

O|2|3 O|2|X O|2|X
4|X|6 4|X|6 X|X|O X went first, and it will be a tie, unless someone plays dumb
7|8|9 O|8|9 O|8|9

Likely hood is a tie. Ah, well... enough win/lose/tie debate, how have you decided to implelemt this, or do you want more ideas?
__________________
-Fractile81
Fractile81 is offline   Reply With Quote
Old March 23rd, 2003, 12:31 PM     #22 (permalink)
Go back to sleep
 
Creatures's Avatar
 
Join Date: Jul 2002
Location: Switzerland
Posts: 7,385
Send a message via ICQ to Creatures
well i'm so far that the first move (PC) is random then the player and then the PC has got a small random which decides if the next move is "thought" or just random again, so the player can win too!

well i've got some if else problems and it stops sometimes with no reason but i will show you the program if it's finished!

Creatures
__________________
Canon EOS 450D | Canon EF-S 18-55mm 1:3.5-5.6 IS | Canon EF-S 55-250mm 1:4-5.6 IS | Canon Speedlite 430EX II
Creatures is offline   Reply With Quote
Old March 23rd, 2003, 10:03 PM     #23 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
Quote:
[thinking off the top of me ears]
There is only 8 ways to win, 3 rows, 3 cols, 2 diags. Determine where to go based upon those values, with some other logic tossed in. As in where to go, if first.
[/thinking off the top of me ears]

Thought a little more about this, and can help if your game?
qball is offline   Reply With Quote
Old March 23rd, 2003, 11:06 PM     #24 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
I've seen some games where the computer never loses, the object is to see how far you can get before losing. I've seen this on a ping pong game at Java Botique.

I would be stuck at how good to make the AI too. My Visual Studio .Net came with a sample Tic Tac Toe I think. I'll have a look at the logic and see what they use for the AI.
Creosote is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Making Health Care Worse (166)
The disrespect of Obama by Russian .. (18)
Is It Just Me? (2931)
Wireless Televisions. (11)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Regular Build (6)
Is the PSU I received dead? (12)
radeon x850xt platinum & shader.. (5)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (9)
Install XP pro and a Vista laptop ?.. (11)
Foreign voltage (10)
Recent Discussions
Internet Lost (0)
Graphics Card Upgrade Questions (0)
Graphics Card Upgrade Question (2)
Asus P4G8X Mobo (6)
radeon x850xt platinum & shader 3 (5)
Xbox 360 GTA: SA disk error (1)
Is the PSU I received dead? (12)
How to convert MP3's (2)
windows 7 internet problem (5)
Multiple Restarts Required at Boot (0)
BSOD On Startup (ntoskrnl.exe) (2)
Print spooler problem (15)
Laptop with wireless problem. (1)
Wireless Televisions. (11)
Have you switched yet? (86)
screen resolution vs monitor size (2)
sms storage to PC (0)
Regular Build (6)
Open With ..... Win7 (0)
java code for fibonacci (1)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (35)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Partition Magic caused HDD problem (3)
Point and Shoot Camera Suggestions. (2)


All times are GMT -4. The time now is 07:24 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28