Assignment 11, due Nov 15

Part of the homework for 22C:60, Fall 2004
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated, and unless there is what insurance companies call "an act of God" - something outside your control; the only exceptions to this rule will be by advance arrangement.

  1. Conway's Game of Life without the ability to edit the board interactively is of only limited fun. Consider the problem of adding commands to the game, for example, using the H and K keys to move the curser left and right, the U and M keys to move the cursor up and down, the J key (in the middle of all of those on a standard keyboard) to toggle the state of the current cell on the board, and the space bar to start the game, and the S key to exit the game. Pressing any key would temporarily stop the game to allow editing of the current configuration.

    a) Your current solution to the Game of Life has infinite outer loop that runs generation after generation. Give the code you would add at the end of this loop to exit the loop, allowing the commands above to be interpreted. (This asks just for a few instructions to exit the loop, not the entire code for command interpretation).

    b) Once the game is halted, how would you get characters from the keyboard to interpret as commands. (Is there a Hawk monitor routine that would work? If not, why not, and what would you use instead?)

  2. Given how the Hawk display interface works, what kind of speedup would you expect if the solution to the Game of Life distributed on-line avoided using dspch() and dspat() and instead worked directly with the display interface documented in Chapter 11.

  3. Do problems c and f from chapter 12.