2014年9月3日水曜日

開発環境

Head First JavaScript Programming (Eric T. Freeman (著)、 Elisabeth Robson (著)、 O'Reilly Media )のChapter 8(Bringing it All Together: Building an app)、CODE MAGNETS(p.363)を解いてみる。

CODE MAGNETS(p.363)

  1. Loop for the number of ships we want create.
  2. Generate a random direction(vertical or horizontal) for the new ship.
  3. Generate a random location for the new ship.
  4. Test to see if the new ship's locations collide with any existing ship's locations.
  5. Add the new ship's locations to the ships array.

0 コメント:

コメントを投稿