1981 · Nintendo

Octopus: Play

This minisite was contributed by icyriver2023. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/gnw/octopus with me to Gold.

The whole unit, clock and alarm included, written again in JavaScript routine by routine, and run in lockstep with the chip's own program in the tests.

01 · Play

Take the treasure past the tentacles

The unit starts as a fresh battery leaves it, every segment lit. Press Time for the clock, or Game A or Game B to play: the game starts when you let go.

Keys: ← → move the diver; A Game A, B Game B, T Time, L Alarm. Watch starts a game of Game A or B, chosen at random, for the computer to play; Computer plays hands the game in progress to it. The computer looks twelve steps ahead on copies of the port, trying right, nothing and left at each step, and takes treasure one to three times a trip, chosen at random each time it leaves the boat, so its games differ. A press of left or right takes the game back.

Each press of right moves the diver one place toward the chest and each press of left one place back; at the chest right takes a piece of treasure. Hold Time in the clock to see the alarm's time, hold a game's button to see its best score.

02 · The port

The chip's program, routine by routine

This page does not run the game's own code. Each routine of the listing is a JavaScript function of its own, on the game's own 65 cells of memory, with the chip's registers kept where one routine hands them to the next. The port charges each straight run of the program its length in cycles, as the chip runs a byte a cycle, so its clock matches the chip's to the cycle. That matters because the tentacles take their choices from the seconds.

The test beside this page, test_play.js, runs the port in lockstep with the game's code on the kit's model of the chip, which is held to MAME instruction for instruction. At every pass, every pass of the wait before a step, every return from drawing the screen and every reading of the buttons, the two must agree on all 65 cells and on the cycles since power on, through games played by this page's computer player and through the states play seldom reaches: the bonus, the alarm, the test pads and the time being set.