Various Implementations of a simple Guess Game using different client side JavaScript frameworks / libraries.
The guess game flow is as follows:
- Application randomly selects a number
- User makes a guess
- Application provides feedback as to whether the guess was low, high or correct, and maintains guess History
- When user guesses the correct number, the application notifies the user of the number of tries it took them, the application disables the guess button and displays a restart button to the user
- When the user clicks restart, the application selects a new secret number and resets all the counts as well as the guess history
##Architecture and Implementation Notes:
- Angular: Factory singleton 'logFactory' is used to maintain history of guesses across the default and restartGame views, Controller 'LogController' handles the main game logic and also redirects user to gameOver view when users guess the secret number correctly.
- Vanilla: game logic in raw javascript
- React: Essentially all the logic is in the GuessGameApp component which has the sub-components: GuessHistory, GuessHistoryEntry, and RestartButton. See React/app.js
- Backbone Uses jQuery & Underscore libs. Each Guess is a model, GuessHistory is a collection of guesses. There is a view for each Guess item, as well as a separate view for game won state, and GuessHistoryView is the main App View/Controller