Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Pretty Good Computer

What Is It?

Pretty Good Computer is a toy computer I built to simulate the z-machine as described by jgc. I enjoyed working out the problems long hand, but thought that I could have a computer do the repetetive scut work; they're better at it after all.

The z machine has unlimited memory locations that are numbered, so we can refer to them. The cpu understands 3 instructions:

  • z_n_
    • z zeros, or initializes, memory location n
  • i_n_
    • i increments memory location n
  • j_n_!m)l
    • j compares memory locations n and m's value. If they are equal, the program proceeds to the next line, otherwise it goes to line l

Of course, I can't figure out a good way to represent infinite memory locations in a browser window, so we are stuck with 16-bits by default. This is user-editable, if you need more space to really explore whatever you are doing.