Draconis' Sketchbook

From time to time someone mentions an intriguing puzzle idea or such, and I try to implement it in Inform 7 as an experiment. Most of these ideas have later proven either trivial or impossible or ended up in my Scroll Thief notebook, but there are a few which fall into a different category. I doubt I’ll ever legitimately use these in games, but they were interesting to code and might be helpful to someone else. So I figured I’d post the code snippets as mini-examples for anyone who wants them.

  • Spellbreaker Cubes - The coin-weighing puzzle from Spellbreaker, with its nasty twist. The game doesn’t track which coin is fake. Instead it keeps a list of possibilities, which are slowly eliminated as the player weighs them. When they select one at the end, if there is any other possibility at all, that one will be chosen instead. So luck will never be on your side.
  • Sylladex - The intentionally annoying hash-map Sylladex from the webcomic Homestuck, with a sample puzzle. You can’t supply nouns with your verbs: instead, the noun is chosen based on a simple hash of the command. So to search a box, you first need to pick it up by calling it a CHEST (hash 9), then LOOK IN it (hash 9). LOOK INTO (hash 2) would instead examine a METAL KEY (hash 2). It’s even worse than it sounds. I considered trying to make an actual (mini-)game out of this mechanic but it was too frustrating even for me as the author.
  • Autumn Leaves - The solitaire card game by Toby Ord implemented in Inform. I like this game, it’s relaxing and has a nice combination of luck and skill.

I’ll add more here if they come up.

Autumn Leaves looks impressive. What are the commands? I got MOVE by randomly trying things out, but I don’t even know the rules for that game…

Oops, I forgot to mention those. :stuck_out_tongue:
The rules for the game are here. I came across them when looking up All Things Devours and was intrigued.
DEAL starts the game, MOVE X TO Y moves a card from one pile to another (can be phrased as either “MOVE KING OF SPADES TO THIRD PILE” or “MOVE SEVEN OF HEARTS TO JACK”), and DRAW adds more cards. You can also use SEED to seed the random number generator to play the same game repeatedly or play around with the randomness as you go but that’s not part of the game.

Hope you’re planning to keep this up. :slight_smile:

Anyway, this isn’t just bumping an old thread, I actually wanted to mention that it can be hard to know what to do in AL or even Cubes. I know this is just a sketchbook of yours, meant for code-snippets to be taken, but it might still be a good idea to add some basic instructions (like the ones above!) in the ABOUT text. For one thing, if I have a compiled example of a puzzle/mechanic/gimmick, I’ll want to try it out first… and the easier it is for me to do it, the more likely I am to use your code.

Well, not me personally, no. But a hypothetical writer.

That is definitely a good idea. With classes picking up I haven’t had much time for Inform, but that’s on my todo list now.

I thought that the “nasty twist” for Spellbreaker Cubes was how the game was implemented.

Indeed. That’s why I used the cubes as an homage instead of the archetypical coins and balance.

You’re not doing the full implementation of it. In Spellbreaker, if you make a suboptimal choice on your weighings, it will show the least useful result. With your code, if you do a one-vs-one on the first weighing, there’s a 1/6 chance you’ll get a “not equal” result, and you’ll be able to win with the second spell.

That is a very good point. It seems Spellbreaker also checks which option would eliminate the fewest alternatives before guessing randomly. I’ll need to update this when I get a chance.

Thanks for sharing this! I had ideas to write Autumn Leaves in Perl. The result is at raw.githubusercontent.com/andre … tuff/al.pl … this isn’t a parser game of course but I always wanted to write a card game to see how it was done, and you motivated me. I’ve learned all about what sort of options to add, etc.

Hey, Draconis, since you like being prompted into curious coding challenges, I have a thought for you.

Ever played “Mille Bornes”? Isn’t it totally doable in Inform? Isn’t it even possible to make opponents who may be more or less aggressive and have different strategies? Isn’t it? Huh? Huh? Innit? Huh?

(I first came across Mille Bornes in the shape of a windows version which, surprisingly, was about building a house! The “green light” card was the construction permit, the hazards were electric and plumbing problems, the miles were simply the necessary money to finish the house. Talk about a clone - but it worked surprisingly well, and I still kinda think it’s more interesting than just the “race” scenario)

(all Mille Bornes games I’ve played were always 2-player only, because it was just me and the computer. But it needn’t be that way forevah!)

Huh, interesting. I’m remembering vaguely from first-year French classes, though I’d need to look into the game again. But it’s on my list now.

I used to play Mille Bornes with my family a lot, and five years ago I played it with my (then) eight- and five-year old nephew and niece and they were flipping sharks. Every time I got a Go card, which was rarely, they would slap a hazard right on it. I got zero miles! You should totally implement the “Ha ha, you lose” version.