8.7.0.3

2 — The Board

Due Friday, 07 October 2022, 11:59:59pm

See Maze.Com, a Plan for our plan for the entire project, not just the first three sprints. Being able to write such plans—and modify them as you go—takes experience and especially experience with failures. Reflect on how ours compares with yours.

Delivery Place the product of this week’s milestone into your git repo as follows:

Programming Task Design and implement a data representation for the game board of Maze. At a minimum, the data representation should also support the following pieces of functionality: The phrase “piece of functionality” is chosen so that you may use functions or methods, one function or many to implement one bullet or all. The choice is yours.
  • sliding a designated row or column in one or the other direction;

  • inserting a tile into the spot that is left open by a slide;

  • determining which tiles are reachable from a designated tile.

Note how these three pieces of functionality correspond to the actions a player is allowed to perform on the board—and yet, none of them mention players or their avatars. It is the task of a software architect to cleanly separate such concerns.

Design Task Only the referee knows everything about the game that enables it to grant turns, decide the validity of actions, and announce the end of the game and its outcome to every participant. This knowledge is called “game state.”

Design a data representation for the game state. List all pieces of functionality that should be available to the referee to run a game from start to completion.

To describe the data representation, mix English and references to the data sub-language of your chosen programming language. For the operations, choose the wish list format that you got to know in Fundamentals I and Fundamentals II, depending on which of the languages used in these courses matches your chosen language most closely. Distinguish the two parts clearly.

The memo should not exceed a page. Less is more.

Keep in mind our Maze.Com, a Plan while you work on a design task.

image

You do not need to read the rest of this page if you recall the notion of “design and implement” from Fundamentals I through III.

To design means to turn the information in the real world into a data representation—using the data sub-language of your chosen programming language. This implies that given any given board in the real (information) world, you can instantiate your data definition to represent this board. Conversely, given a data representation of a board, you can interpret it by setting up a board in the real (information) world.

Design also means to think about what other components will want to know about this information or perhaps represent a change over time. To this end, you are to come up with a list of functionality—just as exemplified in this assignment. One way to come up with this list is to re-visit the real (information) world and to consider how other actors in this world may interact with this information. For our project, the actors to consider are the referee and the players.

Some information and functionality is explicit in the real world. Some is implicit. While the real board clearly consists of unique tiles and players can simply point at the tile where they wish to place an avatar, a data representation must make the grid and places on the grid explicit. What do you think is a good representation of “place”?

The referee is an example of implicit functionality. When a group of us sits around a kitchen table to play Maze, we collectively play referee. A software system cannot keep such functionality implicit; ideally, it must be open to audits in case of law suits.

To implement is to systematically turn the wish list of functionality into an implementation of functions and methods. Since this milestone it is about the design of a component, it also means to make some of these functions and methods public and keeping all helpers private. Use your chosen language well.

The entire point of proceeding systematically is to accommodate change. It is unlikely that anyone’s first design and implementation of the board is perfect. A good intuition will go a long way to finish most of the needed work this week, but “easy change” is the name of the software game—and the marketing department of every company is convinced of this game. Proceeding systematically helps reduce the time it takes to make these changes in the future—whether this is your time or your future colleague’s time.

At Northeastern, we teach “systematic” from week 2 in the undergraduate curriculum. Follow these principles and you will be able to manage your time this semester