Skip to content

Instantly share code, notes, and snippets.

@theotherzach
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save theotherzach/55e090717ddd0b469c60 to your computer and use it in GitHub Desktop.

Select an option

Save theotherzach/55e090717ddd0b469c60 to your computer and use it in GitHub Desktop.
BARUCO 2014 Angular Workshop

BARUCO 2014 Angular Workshop

Notes

80% of my Angular use is restricted to:

General info

  • Angular expressions (in the template): link
  • How to build a filterable, sortable table: link
  • Detailed isolated angular testing screencast (with audio!) video
  • Detailed isolated rails screencast (paid) link
  • Test Isolation post: link

Philosophy

  • Be pragmatic and always optimize for tight feedback.
  • Never default to any tool, including Rails.
  • Use Angular instead of jQuery. (Actually Angular is just using jQuery for you.)
  • Use Ember for single page apps
  • Don't write single page apps unless you've got a good reason. (HTTP solved routing in 1991; reinvent with care.)
  • erb/ HAML and Angular is like peas and carrots
  • Capybara and rspec/ minitest make great testing tools when you'e testing interactivity
  • Try to extract logic into tool agnostic functions whenever possible. (In any language.)
  • Mocks are great and mock pain should drive design.

Workshop

[Repo] (https://github.com/testdouble/baruco2014-angular)

Instructions

  • clone it
  • bundle it
  • migrate it
  • rails s it
  • open http://localhost:3000
  • Complete the 3 exercises

Airstrike

Mockup

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

Research

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment