pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Tic-Tac-Toe (made easy)

Tic-Tac-Toe (made easy) - 1.0

Joshua Powell (powellj6)

Tags:

Description

It is just a simple Tic-Tac-Toe game coded very simply with comments describing what each piece of code does.

I did it to prove that there was another way of doing it because I just didn't understand the other tic-tac-toe game code I kept finding. It was just too complicated. So here it is, hopefully, dumbed down enough for even the most greenest of noob.

Nothing fancy, just simple ASCII Art for the Tic-Tac-Toe Board.

Also, it is coded in Python 3.1 Any ealier versions of Python will not run this game. Windows, Mac, others. It really shouldn't matter what you use but if you are having some problems with it or find some bugs leave a comment and I'll fix them and have a new version out. All comments and criticisms are welcome.

Enjoy, J

oshua Powell

Links

Home Page: http://www.mediafire.com/?noc4162vzcqjpcx

Screenshot


click to view original size

Releases

Tic-Tac-Toe (made easy) - 1.0 - Aug 20, 2011

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

August 21, 2011 6:49pm - Zachariah Callaway - nickname: (xzcallaway)
Opps sorry. I posted that on the wrong tic tac toe.
August 21, 2011 5:11am - Jouni Järvinen - nickname: (rautamiekka)
@masterlee
No, §python§ on my system leads to Python v2.7. I tested by explicitly calling the exe with same result but calling v3.1 worked.
August 20, 2011 10:53pm - Zachariah Callaway - nickname: (xzcallaway)
Man for you, that program is huge. I'm used to seeing the tiniest little codes that always make me scratch my head. I love looking at those tiny little things.
August 20, 2011 6:03pm - Carsten Eggers - nickname: (masterlee)
@rautamiekka
It appears you started the program with Python 3. In Python 3 the usage of the input function hat changed. In python input is exactly the same as raw_input. Thats the reason for the bug. Use 3to2.py or python3 itself to get rid of the problem. For an quick ahck you could also write input=raw_input in the first line of ATicTacToeJPVersion.py.

Unfortunately multiple white spaced will be folded to one space on html pages.

Testing some chars: »«¢âââµæſðÄÅħÅ@Åâ¬Â¶Å§âââøþ
August 20, 2011 3:35pm - Jouni Järvinen - nickname: (rautamiekka)
Stupid comment system, fourth time posting this.

Apparently the comment system fucked up, not submitting my first comment, so here it goes again:

Looking interesting, but there's a grave bug.
§§§§§§§§§§§§§§§§§
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\rautamiekka>python "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py"
Hello, and welcome to Joshua Powell's version of Tic-Tac-Toe.
You shall be battling the mighty intellect of Joshua's AI Computer Programming!
Play if you dare!!!
()
()
Which letter do you want to be? "X" or "O"
x
Traceback (most recent call last):
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 841, in <module>
start() #runs the def start()
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 818, in start
which = input().upper() #gets input from the player. also, the upper() means that if the player types in a 'x' (lowercase 'x'), the code will recognize it as a 'X' (capital 'X')
File "<string>", line 1, in <module>
NameError: name 'x' is not defined

C:\Users\rautamiekka>python "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py"
Hello, and welcome to Joshua Powell's version of Tic-Tac-Toe.
You shall be battling the mighty intellect of Joshua's AI Computer Programming!
Play if you dare!!!
()
()
Which letter do you want to be? "X" or "O"
o
Traceback (most recent call last):
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 841, in <module>
start() #runs the def start()
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 818, in start
which = input().upper() #gets input from the player. also, the upper() means that if the player types in a 'x' (lowercase 'x'), the code will recognize it as a 'X' (capital 'X')
File "<string>", line 1, in <module>
NameError: name 'o' is not defined

C:\Users\rautamiekka>python "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py"
Hello, and welcome to Joshua Powell's version of Tic-Tac-Toe.
You shall be battling the mighty intellect of Joshua's AI Computer Programming!
Play if you dare!!!
()
()
Which letter do you want to be? "X" or "O"
X
Traceback (most recent call last):
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 841, in <module>
start() #runs the def start()
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 818, in start
which = input().upper() #gets input from the player. also, the upper() means that if the player types in a 'x' (lowercase 'x'), the code will recognize it as a 'X' (capital 'X')
File "<string>", line 1, in <module>
NameError: name 'X' is not defined

C:\Users\rautamiekka>python "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py"
Hello, and welcome to Joshua Powell's version of Tic-Tac-Toe.
You shall be battling the mighty intellect of Joshua's AI Computer Programming!
Play if you dare!!!
()
()
Which letter do you want to be? "X" or "O"
O
Traceback (most recent call last):
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 841, in <module>
start() #runs the def start()
File "C:\Users\rautamiekka\Documents\_Text-based_\_Python_\ATicTacToeJPVersion.py", line 818, in start
which = input().upper() #gets input from the player. also, the upper() means that if the player types in a 'x' (lowercase 'x'), the code will recognize it as a 'X' (capital 'X')
File "<string>", line 1, in <module>
NameError: name 'O' is not defined

C:\Users\rautamiekka>
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 21, 2014


Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)