Snapshot (5.5.1)

Extend the program of the example 5.4 with a Snapshot pattern mechanism. The object to be preserved is (a state of) the Board. It is desirable not to violate the information hidden by the Board.

For the purpose of this exercise, add two buttons to the interface: one to make the snapshot and the other to restore the board from the snapshot. Keep the snapshot of the board in memory.

Some authors call the Snapshot pattern Memento.

Snapshot (5.5.2)

Modify the program of example 5.5.1 to save a snapshot on disk. Place a timestamp in the snapshot so that when a state of the game of Othello is restored the program reports the timestamp of the snapshot.