Justintime4Java
  • Home
  • Blog
  • My Work
  • Old Projects
    • WiiControll
    • Barcode Reader
    • Mine Little Pony

Week 1 Project Update 2

11/28/2011

 
Was supposed to be posted on sunday
     Not sure what Xavier is doing, he hasn't replied to my email yet about how to collaborate on the weekend.

     Anyways,  I have created a Tic-Tac-Toe program in Eclipse.  In a nutshell I installed stuff to make it work with Processing and real time collaboration, hoping to be able to work on it with Xavier.  It uses an array to store the player's and the "AI's" moves.  The player uses the mouse and clicks where it wants to go.  The "AI" randomly chooses an empty space, so it is not that intelligent.
     The array is 9 integers long, each one represents a space od the board like so:

000
000
000

A "0" means the space is empty, a "1" is an "X" (the player) and a "2" is an "O" (the "AI").  For example, if the integers in the array, respectively form 0-8, are "0,1,1,2,0,2,0,1,2" the board would look like the following


_XX
O_O
_XO

I made functions that test every term in the array for every possible way of winning; three across, three down and the two diagonal.  If there is a winner, it writes a character to the serial port, "p" for a player win, "c" for an "AI" win and "t" if the board is filled.  Arduino then plays a tone depending on who won.


     In the future, I hope to make the AI smarter (possibly block and win), and implement this array system in Arduino os this game is portable.  9 buttons would be used for each space, while using the tactile display.
Danielle Ramkissoon
11/28/2011 20:01

Justin, this sounds like a great project. I would definitely want to try this is out; it sounds like fun. I have a couple questions though. What does the c and t stand for when the player wins or the board is full (relatively)? Also, what do you mean by arduino will play a tone depending on who wins? Wouldn't the same sounds play no matter who wins?
These are just some things that I was wondering. Anyway, so far your project seems really cool. Goodluck!

Abdel-Rahman Ahmed
11/28/2011 20:03

I love your idea of making a game for the blind (we're also trying to help them out!). I also like your approach to making the tic tac toe board for the blind -- very creative! One thing that would be cool is if you had a one player mode and a two player mode so that the blind person is not only able to play with the computer but with another blind buddy. I think that will make the game more enjoyable to blind.


Comments are closed.

    Author

    Here's where I put stuff about my life and what I'm doing!

    Archives

    January 2014
    December 2013
    November 2013
    October 2013
    June 2013
    April 2013
    March 2013
    February 2013
    October 2012
    September 2012
    August 2012
    July 2012
    June 2012
    May 2012
    April 2012
    March 2012
    February 2012
    January 2012
    December 2011
    November 2011
    October 2011
    September 2011

    Categories

    All
    Tactile Tic Tac Toe

    RSS Feed

Powered by Create your own unique website with customizable templates.