#Test Double TDD + Angular Workshop
JavaScript gives you superpowers. If you already know Rails, then familiarity with JavaScript and a framework like Angular or Ember acts as a force multiplier. According to Hired.com's RailsConf program insert,
Ruby engineers that know Angularjs get 20% more interview requests.
More importantly, this stuff can be super fun.
- Read Deck
- Start with EITHER lineman_start or static_start. Use the static project if you're interested in JavaScript and don't care about modern tooling. Otherwise use Lineman. (Details in setup below.)
- Follow steps outlined in the deck. They're very rough as they were meant to be used as we were following along in the workshop. Email zach@testdouble.com if you would like more detail. If I don't get emails, I won't worry about outlining them in greater detail.
- Cheat by looking at EITHER 02a_lineman_finish or 02b_static_finish.
By Zach Briggs, Todd Kaufman, and Justin Searls of Test Double
- Clone this repo:
git@github.com:testdouble/railsconf-test-drive-javascript.git
- Install node
- Install lineman by running
npm install -g lineman
- Open 2 terminal tabs and cd into the project's
lineman_start
directory - In tab 1, run
lineman run
- In tab 2, run
lineman spec
- In your browser, go to `http://localhost:8000/
- Copy the project from a provided USB stick to where you put code
cd static_start
open index.html
MVP:
- Single grid, single player game
- User fires blindly until they sink all opponent ships
- The player doesn't have ships of their own
Bonus:
- Randomize opponent ship positions
- Let the player know when they sink a ship
- Give the player ships and make an AI opponent that can fire back
From the wikipedia Battleship page:
After the ships have been positioned, the game proceeds in a series of rounds. In each round, each player takes a turn to announce a target square in the opponent's grid which is to be shot at. The opponent announces whether or not the square is occupied by a ship, and if it is a "hit" they mark this on their own primary grid. The attacking player notes the hit or miss on their own "tracking" grid, in order to build up a picture of the opponent's fleet. When all of the squares of a ship have been hit, the ship is sunk, and the ship's owner announces this (e.g. "You sank my battleship!"). If all of a player's ships have been sunk, the game is over and their opponent wins.