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
Friday, May 23, 2014
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)