Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alyssa's Tic-Tac-Toe #34

Open
wants to merge 94 commits into
base: master
Choose a base branch
from
Open

Alyssa's Tic-Tac-Toe #34

wants to merge 94 commits into from

Conversation

alyssahursh
Copy link

@CheezItMan
It's not tic-tac-toe; it's SET!

I really, really struggled to understand this project. I beat my head against it for several days and finally gave up. Having nothing to work on once I gave up, I read the entirety of the Backbone.js documentation. Turns out it's fairly short and easy to read. In reading the documentation, it was a lot easier for me to conceptualize a card game than tic-tac-toe. So, I decided to build SET. Commits starting on December 20th reflect this work.

If you're not familiar with SET, the basics are here: http://www.setgame.com/set

In my set game:

  • The computer builds the standard 81 (3^4) cards as card models in a deck collection.
  • The site loads with 12 cards on the table, moving them from the deck collection to the inplay collection.
  • Players look for sets of three that fit the requirements of a "set". Players can click on cards individually until they have selected three cards.
  • Once three cards are selected, the computer will determine if those cards fit the requirements of a "set".
  • If the three cards are a set, those three cards are destroyed and are replaced in place with new cards from the deck. The cards in play are NOT reordered.
  • If the three cards are NOT a set, they will be deselected.
  • If the player is stuck, they can ask the computer if there is a set in play (1 in 35 chance that there is not). The "Are There Sets?" button will change to "YES" or "NO"
  • If the player needs a hint, they can ask for one. The card that is involved in the most sets on the table will wiggle briefly. The player can continue hitting this button and the same card will wiggle again.
  • If the player asks for a hint and there are no sets on the table, the "Draw Cards" button will wiggle briefly.
  • A player can draw three new cards at any time (so long as they don't already have 15 cards on the table). They will be placed on the table in a fifth column (NOT in a fourth, short row).
  • If there are already 15 cards on the table, drawing more cards does nothing.
  • If a set is found when there are 15 cards on the table, no new cards are drawn. Instead, the cards are reordered into a 4 x 3 array.
  • If the players play through to the end of the deck so that the deck collection is empty, no new cards will be drawn and the cards on the table will dwindle from 12 to 9 to 6 as the last sets are found.
  • The player can start over with a fresh deck at any time by hitting the "Reset Game" button. (Page reloads.)

Unfortunately, I was not able to rewrite the tests from tic-tac-toe to match the game I wrote. I also did not practice integrating an API into a backbone app.

However, I think that my work is well in-line with the spirit of the assignment, and that I have a much more solid understanding of Backbone than I did before working on this project.

If you'd like to test play the game, it currently console logs a 2-D array with the answers. Each answer is an array of three integers pointing to the placement of the card on the table. The table is zero-based, and counting (unnaturally) goes top-to-bottom, then left-to-right.

Lastly, I'd love to get this up on Heroku. I tried for a while, then my kid brother tried. No dice. All of the commits that just say "test" or "fix" were done by him.

Maya Wang and others added 30 commits December 12, 2016 16:13
…Game. Improved description on testing on check winner or tie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant