Important alert: (current site time 7/16/2013 5:16:49 AM EDT)
 

winzip icon

[ Tic Tac Toe ]

Email
Submitted on: 6/1/2004 12:31:21 PM
By: Cyber Chris  
Level: Advanced
User Rating: By 6 Users
Compatibility: Delphi 7, Delphi 6, Delphi 5, Delphi 4, Pre Delphi 4
Views: 22804
author picture
 
     Tic Tac Toe game with AI: This game demonstrates the use of variable levels of the A.I. to challenge an opponent at any level. The highest level is unbeatable, the lowest level is very easy. The sourcecode is documented. Can you beat the highest level????

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/1/2004 12:33:49 PMCyber Chris

Please give me a feedback!
(If this comment was disrespectful, please report it.)

 
6/3/2004 6:04:35 AMCS6783

Great! 5 globes from me!

What about a chess game with ai?
(If this comment was disrespectful, please report it.)

 
6/3/2004 7:58:26 AMDavid Ward

I like it.

But, it is NOT unbeatable, I can repeatedly beat it at its highest level.

I would be happy to swap notes with you, though, if you like.

I have been teaching my daughter the basics of programming and we spent much of last Sunday knocking together a TicTacToe program.

I make no claims as to its unbeatability.

But, it drew with and then beat yours :)

Talk to me, I will chuck it your way.

Cheers,

David.
(If this comment was disrespectful, please report it.)

 
6/3/2004 12:18:58 PM

Very good code! I'll give an excellent!
(I was not able to beat it!)
(If this comment was disrespectful, please report it.)

 
7/7/2004 3:13:48 PM

Very good game...!
(If this comment was disrespectful, please report it.)

 
7/19/2004 3:15:11 PM

Given the starting move it's easily beaten with an indirect approach (in a monospaced font):
--- O-- O-- OO- OOX OOX OOX
-X- -X- -X- -X- -X- -XO -XO
--- --- --X --X --X --X X-X

(If this comment was disrespectful, please report it.)

 
7/19/2004 3:17:13 PM

darn, that wasn't very readable.. here goes again:


---
-X-
---

O--
-X-
---

O--
-X-
--X

OO-
-X-
--X

OOX
-X-
--X

OOX
-XO
--X

OOX
-XO
X-X
(If this comment was disrespectful, please report it.)

 
1/30/2005 2:16:33 PM

I am 11 years old and I beat the highest level easily.
But I improved the code - thanks!
(If this comment was disrespectful, please report it.)

 
7/25/2005 3:15:20 AMaji

what a great game!!I'm very impressed with this tic tac toe. But I've found some bug here. If you play with com, and you have already win but your com have chance to win, the com will win eventhough you already win that session.
By the way...can you help me?I have some problem in delphi.Can we call 'system date' from BIOS not from windows?Or can we protect our system date from change by other person?Thank you for your help...
(If this comment was disrespectful, please report it.)

 
10/14/2007 2:25:41 PMArturo

It's not unbeatable.
There are some ways to beat it
I've made one that I think is unbeatable.
It's made in java so you need the JVM.
Here it is and there's the source code too
http://www.geocities.com/goblinax/gato/
(If this comment was disrespectful, please report it.)

 
2/26/2009 3:21:12 PMHugo Martins

Hi, this code has a bug , when cpu starts , after all the 9 houses are filled there's no draw , it just says it's players , turn.
A question , how do you do if you want to save the game and load in other day , how do you do it?

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.