jwade21 / tic-tac-toe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic Tac Toe

Time to put your knowledge of Javascript and jQuery to the test!

Enclosed you'll find an already made tic-tac-toe board. Your job is to make the game actually work using Javascript and jQuery.

  • You can add as many class and id attributes as you need to the HTML
  • jQuery has already been added
  • Don't worry about CSS, just make the game work!

Here are the user stories:

Gameplay:

  • When the page loads, Player 1 (X) is the first player to go
  • When Player 1 clicks an empty cell, it should be marked with an "X", and Current Player should switch to two
  • When Player 2 clicks an empty cell, it should be marked with an "O", and Current Player should switch back to one
  • If a player clicks a cell that has already been marked, they should see an alert letting them know that the cell in question has already been taken

Winning:

  • When a player gets three in a row in any direction, the board should should be wiped clean, and that player's score should be incremented
  • The game should then start over with the losing player getting to go first

Bonus

No game is complete without some kind of easter egg. Add a cheat code, or something along those lines to make the game more interesting!

Licensing

All content is licensed under a CC­BY­NC­SA 4.0 license. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.

About


Languages

Language:HTML 70.8%Language:CSS 29.1%Language:JavaScript 0.1%