Jump to content



1

Tic-Tac-Toe


25 replies to this topic

#1 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Tue Aug 7, 2007 9:59 AM

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.

Attached Files



#2 mojofltr OFFLINE  

mojofltr

    River Patroller

  • 2,593 posts

Posted Tue Aug 7, 2007 10:11 AM

Pretty cool, but...
The AI is kinda lacking. It's almost as if the computer wants me to win. :)
If the computer gets a tic tac toe across the bottom of the playfield, the game doesn't end.

#3 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Tue Aug 7, 2007 10:17 AM

Yes, I also need to work on the AI. Forgot about that when posting. I can't program AI very well, so I'll need some help on it. (it wouldn't need very much AI, there's only 9 squares in the whole game.) I'll look into the second thing you mentioned.

#4 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Tue Aug 7, 2007 1:33 PM

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.

Attached Files



#5 haroldoop OFFLINE  

haroldoop

    Star Raider

  • 53 posts
  • Location:Brazil

Posted Tue Aug 7, 2007 9:39 PM

View Postatari2600land, on Tue Aug 7, 2007 4:33 PM, said:

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

#6 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Wed Aug 8, 2007 5:45 AM

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?

#7 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Wed Aug 8, 2007 7:48 AM

In this version I think the AI is a lot better. Try it out for yourself and see what you think.

Attached Files



#8 mojofltr OFFLINE  

mojofltr

    River Patroller

  • 2,593 posts

Posted Wed Aug 8, 2007 10:50 AM

View Postatari2600land, on Wed Aug 8, 2007 7:48 AM, said:

In this version I think the AI is a lot better. Try it out for yourself and see what you think.

The AI is a bit better now... I think there's still room for improvement.
Can you do anything about the delay in the cursors movement? It feels like I really have to push hard to the left, right, etc before it actually moves.

#9 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Wed Aug 8, 2007 12:26 PM

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.

Attached Files



#10 Nognir OFFLINE  

Nognir

    Moonsweeper

  • 446 posts
  • Location:Regenstauf (near Regensburg) Bavaria, Germany

Posted Wed Aug 8, 2007 1:12 PM

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:

tictactoe5.bas.bin.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.

#11 BigO OFFLINE  

BigO

    River Patroller

  • 2,939 posts
  • Location:Phoenix, AZ

Posted Wed Aug 8, 2007 1:26 PM

View Postatari2600land, on Wed Aug 8, 2007 11:26 AM, said:

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

Tic-tac-tari sounds kinda catchy :)

#12 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Wed Aug 8, 2007 2:35 PM

View PostNognir, on Wed Aug 8, 2007 11:12 AM, said:

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:

Attachment tictactoe5.bas.bin.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!

#13 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Wed Aug 8, 2007 9:24 PM

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.

Attached Files


Edited by atari2600land, Thu Aug 9, 2007 3:48 AM.


#14 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Thu Aug 9, 2007 4:24 AM

Problem should be fixed with this version. Comments/suggestions welcome. I have 4 more k to work with, so I should be able to add some stuff.

Attached Files


Edited by atari2600land, Thu Aug 9, 2007 5:16 AM.


#15 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Fri Aug 10, 2007 6:27 AM

Just fooling around with the label maker on the 2600 forum:
ae04.jpg
Also, I need feedback on the game so far. Love it? Hate it? Change anything? etc.

#16 Atarius Maximus OFFLINE  

Atarius Maximus

    Stargunner

  • 1,064 posts
  • Load "Atari2600",8,1: SYS32777
  • Location:St. Louis, Missouri USA

Posted Fri Aug 10, 2007 8:08 AM

View Postatari2600land, on Fri Aug 10, 2007 7:27 AM, said:

Just fooling around with the label maker on the 2600 forum:
Attachment ae04.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, Fri Aug 10, 2007 8:09 AM.


#17 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Fri Aug 10, 2007 12:45 PM

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.

Attached Files



#18 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Fri Aug 10, 2007 10:50 PM

I fixed the two bugs by myself (I think). Comments/suggestions welcome, as always.

Attached Files


Edited by atari2600land, Fri Aug 10, 2007 10:52 PM.


#19 A Sprite OFFLINE  

A Sprite

    Stargunner

  • 1,062 posts

Posted Fri Aug 10, 2007 11:17 PM

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?

#20 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Sat Aug 11, 2007 10:30 AM

@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. :)

Attached Files



#21 gambler172 OFFLINE  

gambler172

    River Patroller

  • 2,060 posts
  • none
  • Location:germany

Posted Sat Aug 11, 2007 11:04 AM

Hi Chris
good work.Plays well :) .The computer AI is much better now.
greetings Walter

#22 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,148 posts
  • Braindead
  • Location:Hueco Mundo

Posted Sat Aug 11, 2007 1:52 PM

This is a nicely done game and i enjoyed playing a few rounds! Of course it should say "You Lose Turkey" when the computer wins, just like tic-tac-toe for the channel-f does :D

Attached Thumbnails

  • tic_cf.jpg

Edited by Impaler_26, Sat Aug 11, 2007 2:06 PM.


#23 neotokeo2001 OFFLINE  

neotokeo2001

    River Patroller

  • 2,690 posts
  • Location:Palm Beach

Posted Sun Aug 12, 2007 8:51 AM

TIC_TAC_TOE_Atari_Style_Label_A_59.gif

#24 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Sun Aug 12, 2007 1:59 PM

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.

#25 atari2600land OFFLINE  

atari2600land

    Quadrunner

  • 6,489 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Tue Aug 14, 2007 10:37 AM

Nothing much, just changed the playfield color to black. I noticed white on yellow is hard to see.

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users