I don’t even… What…
With some effort, including writing a whole program just to write out the code for every room, and their directions relative to each other, I’ve made a 16 by 16 grid of rooms.
In addition to this disturbing and utterly useless feat, I’ve also done something that I haven’t seen yet on this forum, and made some code to show you a map.
ASCII Map
An Interactive Fiction by ThisKobold
Release 1 / Serial number 250228 / Inform 7 v10.1.2 / D
A4
>show map
................
................
................
@...............
................
................
................
................
................
................
................
................
................
................
................
................
>east
B4
>east
C4
>east
D4
>show map
................
................
................
...@............
................
................
................
................
................
................
................
................
................
................
................
................
The map isn’t much to see right now- In fact, it’s all periods. But if you go to the table where each tile’s symbol is stored, you can change every tile. As long as you keep it in a certain list of unicode characters that are compatible with “[fixed letter spacing]”, the effect you get is one of an even grid of characters.
If you’ve played dwarf fortress, or NetHack, or Caves of Qud, or any roguelike game, really, you’ll recognize that the @ symbol shows where your character is on the grid.
Fun fact: There are 256 rooms. Once it gets to row 7 or 8, Inform begins to lag as it starts dealing with numbers in the triple digits. This is a 16 by 16 grid, and it is running code for every room to see whether or not the player is there.
If you are, it prints an @ symbol instead of the room’s map tile.
Onto the next topic. Making the table.
To create each room in the first place, I made code that prints “[room name] is a room.”, running through each variation necessary for the grid size you want. There is no way in hell I’m manually doing that for 256 individual rooms.
I also used this for the table. 256 rows in a table to make a 16 by 16 grid. However, a small hiccup arises when you try to do this- Inform 7 can’t print indentations, or tab.
All hope is not lost, however.
Instead of barking:
Say fixed letter spacing;
Let ID be 0;
Repeat with Alpha running from 1 to 16:
let Char be the letter corresponding to the number of alpha in the table of alphabet;
Repeat with X running from 1 to 16:
Now ID is ID plus 1;
Say "[ID][apostrophe][quotation mark][char][X][quotation mark][apostrophe][quotation mark].[quotation mark][line break]";
Ignoring the necessity for a table listing the alphabet, this code creates properly formatted rows for each room in a table. Once you’ve copied and pasted the result into the source code, use the ‘Find And Replace’ function to replace every apostrophe with an indent, and the table is complete.
I don’t feel like showing the map code right now, because it’s horrible and probably not optimized, but I might show it later.
Using this table-making code, though, you can create a table with which to map an area in no time. With some clever room-naming schemes, or even just carefully altering the whole 256 row table to match the rooms you have, you can use it to map an area. The area doesn’t necessarily have to be a grid, either- You could hypothetically use this to show an ASCII map in whatever configuration you want, whether or not it matches the actual layout.
Is this code useless? Very likely. It lags the parser near the end of a particularly large grid. But it’s a very cool thing that I haven’t seen people do before.
Granted, I haven’t looked for it much.
I believe, however, that this is an accomplishment worth talking about, and a piece of code worth showing off here.
Let me know what you think, and if this is stupid.
Thank you.