Topic 1 - Variables and Data Types
Topic 2 - Conditionals and Strings
Topic 3 - Loops
Topic 4 - Arrays
Topic 5 - File Handling
Semester 1 Projects
Topic 6 - Classes/Objects and Methods
Topic 7 - ArrayLists
Semester Projects

Part 1b: Neighbor Code

In SnakeProData:

Given any cell, we need to return it’s North, West, East and South neighbors at any given time.

Cell can be food, board, walls or snakeparts at any given moment, however these methods don’t care about what the cell represents. Your job here is to return the reference to the cell found at that cardinal direction.

Methods to complete:

  • getNorthNeighbor
  • getSouthNeighbor
  • getEastNeighbor
  • getSouthNeighbor

Your job is NOT to make new BoardCells, it is to just return a reference to the BordCells that have already been created and stored in the SnakeProData object.

Tests

Once you correctly implement the above, you should be able to pass all of the tests in SnakeProDataTest_Neighbors.java