10 ♥Syntax for 2d-arrays?38

Warm ups:

  • Write the syntax pattern for initializing a 2D array of ints (int[][])
  • Write the syntax pattern for initializing a local 2D array of objects (e.g. Room[][]) using nested loops.
  • Write the pattern for the above when the 2D array is an instance variable.

Writing Challenge: Model a Dungeon storing the player's state as a Monster named "player", a grid of rooms (Room[][]), and a Location to track which room the player is currently in.