- I'm having trouble making a reset button
- The score board does not work
Friday, May 30, 2014
Tic Tac Toe
I realized my tic tac toe game doesn't actually work as well as I thought and right now there are a few problems.
Wednesday, May 28, 2014
Tic Tac Toe
I started working on adding a score to the game to keep track of how many times x or o has one and I feel like it would work for the most part if I could get select html elements more easily. I had given them id's but apparently you can only call an html element through its id with "document.getElementById" so I'll just try some other selectors next time.
Friday, May 23, 2014
Word Counter
I thought it would be neat to make some sort of small app such as a timer or word counter and I still don't quite understand how to manipulate the DOM. Currently, I have a form with a textarea input and a button that is simply linked to a function that returns the length of the textarea but I'm having trouble getting the function and the input to work together.
http://students.gctaa.net/~snicholakos/javascript/wordcounter.html
http://students.gctaa.net/~snicholakos/javascript/wordcounter.html
Tuesday, May 20, 2014
Processing.js and Tic Tac Toe
I looked at processing.js and they have a lot of really cool examples but their download link is currently broken. Also, Tic-Tac-Toe now works properly (as far as I know) after I changed the check for winner function to include a second for loop to fix the problem I was having. I could now start making the game look more interesting, for instance, it would be nice if I could display the winning combination like with a line crossing through the shapes.
Friday, May 16, 2014
Tic Tac Toe
I finally managed to get the tie working and the problem was that the tie would be determined too early so I added a counter. Essentially it just counts the turns now but it finally works! The only problem remaining is that when there are 3 x's or o's in a row anywhere in the array it will say there is a winner but I think I can fix it if I rewrite checkForWinner function a bit.
Tic Tac Toe Functions
Tic Tac Toe Functions
Monday, May 12, 2014
Tic Tac Toe
I really have not made much progress on the tic tac toe tie but I did find a bug where the player wins when they shouldn't. Currently if someone puts an x or an o 3 times in a row anywhere within the array they win, so something like ",x,x,x, , ,o,o, " wins.
Tuesday, May 6, 2014
Tic Tac Toe Winner
- It will now say if someone has won in the bottom row
- It now shows who has one
- There were also a couple of bugs but I tested out all possible winning positions and everything seems in order
- I still haven't made an efficient way to determine ties
Monday, May 5, 2014
Tic Tac Toe Functions
I made a checkForWinner function that surprisingly works! I was stuck for awhile on one of the diagonal wins but the problem was that I had "(board[i+2] === board[i+4] && (board[i] === 'x' || board[i] === 'o'))" when the single i's should have been "i+2". Otherwise it kept saying there was a winner whenever a single x or o was placed on the top row.
Thursday, May 1, 2014
Tic Tac Toe
I finished writing the winning conditions(which took way too long), now all I need to do is optimize it and specify who wins or if print if there is a tie. If I were to make a loop I think I would use .indexOf or maybe .inArray.
http://students.gctaa.net/~snicholakos/webgraphics/tactactoe_new.html
http://students.gctaa.net/~snicholakos/webgraphics/tactactoe_new.html
Subscribe to:
Posts (Atom)