Warp is an obscure mainframe game from the 1980s, known (barely) for its strange and experimental parser and its ridiculously unfair puzzles.
One of these puzzles, according to Russell Karlberg, is a circular maze: it’s a series of concentric circles, each made up of eight rooms or absences-of-rooms, and the player can rotate the circles to create a path through the maze.
The source was never released, but if I were to implement this (in C), I would do something like this:
const uint8_t circles[N_CIRCLES][8] = {
{ 0, 1, 1, 0, 1, 1, 1, 0 },
{ 1, 1, 1, 1, 1, 0, 0, 1 },
...
};
uint8_t circle_offsets[N_CIRCLES] = { 0 };
bool can_go_north(uint8_t current_circle){
uint8_t current_offset = circle_offsets[current_circle+1] % 8;
return circles[current_circle+1][current_offset] == 0;
}
bool can_go_south(uint8_t current_circle){
uint8_t current_offset = circle_offsets[current_circle-1] % 8;
return circles[current_circle-1][current_offset] == 0;
}
This has a few significant limitations, though: you can only go north and south (moving radially), never east and west (moving within a single circle), and you can’t rotate the circle the player is currently in.
Those limitations were fine for Warp, but what if I want to do one better? In modern Inform 7, with the power of relations and tables and lists at my command, how could I make a better version of this, without those limitations?
(For simplicity, let’s assume directions don’t need to change at all as the circles move: call them “inward”, “outward”, “clockwise”, and “counterclockwise”. Players will probably appreciate this too.)