Go Down

Topic: 3D TicTacToe on a 4x4x4 LED Matrix (Read 3108 times) previous topic - next topic

CaptManiac

First off, while I've done some lurking, this is my first post on the Arduino Forum.  I wanted to send my greetings and thanks for such a great community service!  Also, I'm new to the Arduino and electronics in general, and have only been playing around with both of them for about three months.

Anyway, about 16 years ago I wrote a C program to play 3D 4x4x4 TicTacToe against the computer using gaming AI.  Fast forward to a couple of months ago, and it donned on me that maybe it would actually run on an Arduino.  With ever so slight modification, it did!  Then I thought a great beginning Arduino project would be to craft a 4x4x4 LED matrix and integrate it with my 3D TicTacToe game.  After tens of hours of thinking, designing, reading, assembling, trouble-shooting, and then starting all over again, I have a working prototype.  The main components are an Arduino Uno, a MAX7219 LED display chip and 64 LEDs.

I've begun a blog to describe the project, so that other people will be able to duplicate and improve upon it.  It's currently "in progress" and viewable here: http://www.whatmatters2me.com/?p=229
Youtube video here: http://youtu.be/Zy-1M2qoeCk

What do you think?  How would you improve upon it?  Definitely, the 4x4x4 LED matrix could use some aesthetic improvements.  Also, I'm not sure the best way to select the user moves.  Currently it's using a keypad, but I'm considering using a potentiometer and pushbutton.  The potentiometer would move through the X axis first, then after pushing the button after selecting the X axis, it would switch to selecting the Y axis, etc.

CrossRoads

Joystick for moving? Left/Right, Back/Forth, button press to change level?

accelerometer/gyro in a box, like a wii controller?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Do the LEDs change color (got no sound here)?
Maybe play 3-D Othello?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CaptManiac

Good ideas!  Especially if I can find a joystick small enough to incorporate on top of the box.  The accelerometer would make it more fun, but I worry about fine control.

The LEDs do not change color.  The X's and O's translate to Blinking and Not-Blinking.  However, my next iteration I was planning on switching to bi-color three-lead LEDs.  Still thinking about how I can incorporate all those leads into my current design.  And I'll probably need to use two MAX7219's.

3D Othello - heh, that would rock.  However, I did that game AI programming back in my younger days.  Not sure if I'm up to that again.  Maybe.

Thanks for the ideas!

Si

--
My New Arduino Book: http://www.arduinobook.com

CrossRoads

Yes Chess, and add a robot arm to move pieces around 8) 
There's a bit of a challenge for you!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CaptManiac

I went to Maker Faire this past weekend.  Besides having an incredible time - I met Mitch the-TV-B-Gone guy and listened to talks by Massimo and Chris Anderson - I picked up a thumb joystick at the Maker Shop there.  It's apparently from Sparkfun (COM-09426) and includes the breakout board.  I'm in the process of figuring out how to add it to my LED matrix TicTacToe.  The joystick has potentiometers for the X & Y directions, and like you suggested I could use the pushbutton for the Z-direction.  But it looks like I'll still need another pushbutton or something to finish the move.

I've added the first part of the build process (Creating the 4x4x4 LED matrix) to my blog at http://www.whatmatters2me.com/?p=269.  Check it out.

CaptManiac

I've put up a new webpost of the source code for the 3D TicTacToe game. It's the complete Arduino code that controls the LED matrix as well as the gaming AI to play the game. Also makes use of the MsTimer2 library for interrupts allowing the LED 'game cube' to be displayed even while the Arduino is thinking. At the moment it still uses a keypad to input moves, but I'm working on thumbstick control. Let me know what you think!

http://www.whatmatters2me.com/2011/10/3d-tictactoe-3-programming-the-arduino-to-play/

Go Up