Watchperson by Mac Oglesby

Like many others of my age, I encountered Mac Oglesby's Watchperson on the BBC Micro in school. For some reason the concept stuck with me (perhaps because I get my exercise by walking round my local village) so when I found that it was originally a type-in listing for the PET, I couldn't resist porting it to the ZX81. And the Spectrum. And the PC200.

I've put the original and my ports at <https://www.seasip.info/ZX/watchp.html >.

wp_spec.png
Thanked by 1JianYang

Comments

  • That was an interesting game.

    I didn't look at the code behind it, but it's probably complicated since it needs to do all the steps itself in basic.
  • Is it based on the art gallery problem or something? Not ran the game or read the instructions, sorry ;)

    https://en.wikipedia.org/wiki/Art_gallery_problem
  • edited November 2021
    Timmy wrote: »
    That was an interesting game.

    I didn't look at the code behind it, but it's probably complicated since it needs to do all the steps itself in basic.

    It's a bit spaghetti-ish (I had to use goto in a couple of places in the C port) and writing it in ZX81 BASIC with one statement per line didn't improve readability. But it doesn't attempt to do anything complicated with graph theory or topology; everything works from the map as-drawn. On the PET it does it by accessing video RAM directly; my ports use a big array of characters. The last bit I got my head around was the street-following algorithm. I didn't really get a handle on how that works until I did the C port, where I could use more meaningful variable names and enum types.
    Is it based on the art gallery problem or something? Not ran the game or read the instructions, sorry ;)

    No, on the Seven Bridges of Königsberg problem.
    Post edited by John Elliott on
  • I did the ZX81 version first, and then did the minimal work necessary to convert it to the Spectrum. So I didn't bother changing the village layouts back from individual assignments to READ/DATA loops.

    The C port as currently written is specific to PCDOS; to move it to a different platform you'd need at the very least to rewrite screen.c / screen.h / font.c for your chosen target system.
  • edited November 2021
    Oh the Konigsberg bridge problem is easy... just start and end on one of the 2 nodes which have an odd number of edges leaving them. If all the nodes have an even number of edges you can start and finish anywhere.

    Although you can mess up and make yourself have no moves left.

    GJKNMCDABEDGHEFILKHI does the job, probably a few other ways, can't be bothered working out a formula for how many though ;) At least 2 cos you can do it backwards.

    Any level you make up which has 0 or 2 nodes which have an odd number of edges leaving it will be solvable though. Euler did a simple proof of that and invented topology (although I studied it in combinatorics since topology was more like metric spaces/analysis than graph theory stuff)
    Post edited by Paradigm Shifter on
Sign In or Register to comment.