Jump to content
IGNORED

Tic-Tac-Toe


atari2600land

Recommended Posts

Here's a tic-tac-toe program I'm making. I want it to have the feel of an early Atari 2600 game. Right now, it's mostly finished. All I have to work on is changing the color of the screen when not in use, and also, any suggestions you might have. I have a whole bunch of variables to work with (l-z), so play and make a suggestion if you have any.

tictactoe.bas.bin

tictactoe.bas

Link to comment
Share on other sites

Fixed some problems, including the bottom row problem. There's still no AI (the computer player still works, but it's just random O placements.) I also added a few things:

#1 - Added color changes if left alone

#2 - If the left difficulty switch is set to A, the computer goes first.

tictactoe2.bas.bin

tictactoe2.bas

Link to comment
Share on other sites

Fixed some problems, including the bottom row problem. There's still no AI (the computer player still works, but it's just random O placements.) I also added a few things:

#1 - Added color changes if left alone

#2 - If the left difficulty switch is set to A, the computer goes first.

 

Wikipedia's article onTic-tac-toe includes a simple strategy here. It may be useful, it may be not.

Or maybe you could try the brute-force approach. :P

Link to comment
Share on other sites

I have found a way for the computer to block the line you're trying to make. The trouble now is trying to program the same thing by the third time you've moved. It shouldn't be that much of a problem, though. Here's the scenario so far (if you go first). You make a move, the computer makes a random move. You make another move, the computer checks all possible lines you're trying to make and then blocks it. That's as far as I got so far. What I want to do is; after that, you go again and then the computer checks all possible lines you're trying to make again and then blocks it. By this time, there *could* be two possible ways for you to win, and the computer can block only one way, leaving you to win one way or the other. Which way should the computer block? The one that comes first in the possible block list. Yes, that's it. Who knew programming computer AI in a tic-tac-toe game would be so much work? I'm surprised Atari hasn't done this in the early days of the 2600. There's a 3D-Tic-Tac-Toe but no regular one?

Link to comment
Share on other sites

Version 5 - better cursor movement and got the computer AI a tad bit better. I'm thinking about naming this Tic-Tac-Atari since you play against the Atari. I tried putting in a 2-player version for 2 human players but I can't do it. I definitely can't do it without moving it up to 16k, which would be an insanely huge game for such a simple game as Tic-Tac-Toe. I don't know how someone could program a complex 3D-Tic-Tac-Toe in as little space as Atari did. I also wrote up a little bit of instructions. I wanted to put in some background history of the game of Tic-Tac-Toe but couldn't find any.

__________________________

Tic-Tac-Toe instructions:

 

before play or after a game is done:

You are X. The computer is O.

left difficulty switch A - Computer goes first

left difficulty switch B - You go first.

To start, press the reset switch.

 

How to play:

To put in an X, move the cursor to the spot you want to put an X in. To place the X, press the fire button. The computer will place an O right after you place an X.

 

If you win, you'll hear a ding!

If you lose, you'll hear a buzz.

If the game is a draw, you won't hear anything.

 

To start a game after a win, loss, or draw, press the reset switch.

tictactoe5.bas.bin

tictactoe5.bas

Link to comment
Share on other sites

I finally made it to try this game out and its really nice!

The AI is better than in the first version but I found a little bug there:

 

post-9813-1186600216_thumb.png

 

As seen on the picture (atari was beginning) I marked the middle spot with a cross and in the fifth round, he also marked it with his circle.

 

Just wanted to mention that.

Link to comment
Share on other sites

I finally made it to try this game out and its really nice!

The AI is better than in the first version but I found a little bug there:

 

post-9813-1186600216_thumb.png

 

As seen on the picture (atari was beginning) I marked the middle spot with a cross and in the fifth round, he also marked it with his circle.

 

Just wanted to mention that.

This bug was caused by a typo. I fixed it.

 

I think Tic-Tac-'Tari is a great name!

Link to comment
Share on other sites

I made a 2-player option! 4th time is the charm, apparently.

 

left difficulty switch A - Computer goes first

left difficulty switch B - You go first

right difficulty switch A & left difficulty switch B - player 1 goes first

right difficulty switch A & left difficulty switch A - player 2 goes first

 

It's 16k, but bank 3 is empty, so it's technically only about 12k.

 

EDIT: the 2-player option only works if both difficulty switches are set to A. I am working on the problem.

tictactoe6p2.bas.bin

tictactoe6p2.bas

Edited by atari2600land
Link to comment
Share on other sites

Just fooling around with the label maker on the 2600 forum:

post-9475-1186748768_thumb.jpg

Also, I need feedback on the game so far. Love it? Hate it? Change anything? etc.

 

You're done a great job on this game! If you're looking for suggestions on improving it, the first thing that comes to mind is just adding a little polish, the game itself is very good.

 

Here's some ideas for you. These are just random thoughts, they may not all be good ideas. ;)

* Make something happen when you win or lose the game:

- background or playfield flashes with different colors, depending on if you won or lost?

- switch to some kind of win or lose sprite animation screen?

* Use a nice looking sprite as the joystick selector instead of the ball?

* Use a sprite to display the game title onscreen during the game?

* Use the score to keep track of how many times you've won?

* Add a title screen?

* set a time limit for moves ('speed' tic-tac-toe)?

* User selectable background colors / playfield colors? You could do this with the joystick before you press the button to start the game.

* Add the ability to restart the game with the button instead of just the reset switch?

 

Steve

Edited by Atarius Maximus
Link to comment
Share on other sites

Huge update with new features and new bugs.

:) New features:

- Title screen added

- Pick a background color with the joystick (left & right)

- Score added

- Start new games with the fire button instead of flipping reset switch.

- Instead of difficulty switches, different games are chosen using the game select switch.

 

:x New bugs:

- Games 3&4 alternate between player 1 going first and player 2 going first after each game when it should be constant which player goes first.

- After a draw in game 2, it goes straight to a new game instead of playing the new 'draw' tone.

 

I am sure I'm missing some bugs here. I've also included a instruction manual covering the new changes. And hopefully someone can look at the code and fix the bugs.

tttinst.txt

tictactoe12.bas.bin

tictactoe12.bas

Link to comment
Share on other sites

Oh! I have Tourette's!

 

I mean, ideas!

 

Can you make variations, like a tournament mode where winner gets to put their symbol on another grid, loser goes first next game, and the first person to get three of their symbols in a row on the scoring grid wins?

 

Or, an action mode where there are no turns, and both players race as fast as they can to place X's and O's?

Link to comment
Share on other sites

@A Sprite:

Those suggestions are great, but I wouldn't know how to go about programming them. Also, I'd like to keep the binary file at 16k if at all possible (a managable size. Knowing me, if I make one wrong itty bitty change, it'd probably ruin the whole thing, and going through all that code, oh my.)

 

New version with a better-to-read title screen and title screen music (The opening to "Funkytown" by Lipps, Inc; composed by Steven Greenberg.)

Technical info (for anyone who cares):

250 bytes left in bank 1; 1,897 bytes left in bank 2; 1,846 bytes left in bank 3; 540 bytes left in bank 4.

Don't expect a new version until tomorrow. I'm too Tic-Tac-Toed out for now. :)

tictactoe14.bas.bin

tictactoe14.bas

Link to comment
Share on other sites

Cool label! :cool:

 

As for "You Lose Turkey", that's one of the weirdest things I've ever seen for a classic video game. Why not just go the full distance and say "Hey, Moron, You Lost!" I don't want to insult the people who play my game, though. That, and there's no room for it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...