IF Challenges

In December 2020, Karona on IFMud was asking about IF coding challenges, and is there a list of those anywhere? It sounded like the sort of page I'd put together, so — ta-da! — here it is.

You should attempt these challenges in your favourite interactive fiction authoring system. I'm focusing on parser-driven systems here, but it's possible some of these might be applicable to choice-based systems as well.


Contents


Graphics challenges

Simple image challenge

This challenge is simple: just find a picture of something, and display it as part of the response to examining something.

For example, in Portcullis by Robin Johnson, whenever you examine Lara, the innkeeper, you see her picture as well as her text description:

Lara, landlady of the Rampart Inn, is a pleasant middle-aged woman with a kind red face and a cotton dress. Being the proprietor of the town's inn makes her de facto social worker, counsellor and confessor to its residents.

Bonus points if you can center the image above the text the way Robin did.


Chyron challenge

This challenge is partly inspired by Earl Grey by Rob Dubbin and Allison Parrish which reserved some space at the bottom of the screen for displaying what the player-character was thinking, moving the > prompt up a bit. I want you to do something even more ambitious, and use that below-the-prompt space for a chyron of text moving slowly leftwards in real time. The text can be silly news headlines, song lyrics, or whatever you want. Have fun with it.


Rooms and room connection challenges

Post office elevator challenge

In this challenge, reproduce the elevator in Hero Inc Part One by Nate Cull. Code up the lift car and the four locations that it can connect to. You'll also need to code up a keypad and a display inside the lift car, and a plaque in the lobby. But otherwise, let's keep this simple: don't worry about doors or call buttons; assume the elevator is always open at whichever floor it's on.

Here's a sample transcript of how I want the elevator to behave:

Post Office Tower, lobby
You are in the shining new ground-floor lobby of the Post Office Tower. The sheer size and architectural elegance of this room takes your breath away. A plaque is mounted on the north wall, next to the lift doors (which are open). The grand entrance doors to the south lead back out to the street.

> x plaque
WELCOME TO THE POST OFFICE TOWER

Floor  1 ........... Lobby
Floor  3 ........... Post Office
Floor  8 ........... Fairhaven Bank
Floor 15 ........... Observation Deck

All other floors are off-limits to the public.

> n
Lift Car
You are in the Post Office Tower's sleek, ultra-modern lift car. Beside the doors to the south (currently open) is a sleek, futuristic keypad and display.

> x keypad
It's such a very new and modern calculator-style keypad that you're not entirely sure how to use it. (You suspect, though, that you can TYPE ON THE KEYPAD to make the lift go to a floor.)

> x display
It shows the number 1.

> push 1
(on the keypad)
A pleasant female voice announces: "You are already at that floor."

> push 2
(on the keypad)
A pleasant female voice announces: "That floor is off-limits to the public."

> push 3
(on the keypad)
A pleasant female voice announces: "Floor 3 selected."

The lift accelerates briefly upward, then stops. With a soft bleep, the doors slide open.

> x display
It shows the number 3.

> s
Post Office Tower, Floor 3
This large, bustling room must be the new Post Office. A steady flow of customers make their way up to the counter, where a lone mail clerk stands ready to serve them. The sleek, ultra-modern lift opens to the north.

> n
Lift Car
You are in the Post Office Tower's sleek, ultra-modern lift car. Beside the doors to the south (currently open) is a sleek, futuristic keypad and display.

> push 8
(on the keypad)
A pleasant female voice announces: "Floor 8 selected."

The lift accelerates briefly upward, then stops. With a soft bleep, the doors slide open.

> s
Post Office Tower, Floor 8
The Fairhaven Savings & Investment Bank has a much more sober and reserved atmosphere than the rest of the Post Office Tower. Expensively-dressed Assistant Branch Managers stride around making important decisions, and ignoring you. A cash-card machine on one wall offers instant withdrawals, and the sleek, ultra-modern lift opens to the north.

> n
Lift Car
You are in the Post Office Tower's sleek, ultra-modern lift car. Beside the doors to the south (currently open) is a sleek, futuristic keypad and display.

> push 15
(on the keypad)
A pleasant female voice announces: "Floor 15 selected."

The lift accelerates briefly upward, then stops. With a soft bleep, the doors slide open.

> s
Post Office Tower, Observation Deck
You are standing on the roof of the fifteen-storey Post Office Tower, with a breathtaking view of the entire town of Fairhaven. A guardrail on the edge is all that stands between you and the Post Office Park far below. High-altitude winds buffet you as you peer over. The lift doors (open) to the north are the only way down.


Rotating house challenge

In this challenge, I want you to code up the white house from Infocom's Zork I and the four plots of land around it. That's just seven rooms total. Don't bother with the furniture, but we will need a working unlocked and unboarded front door and let's replace the kitchen window with a back door. Rename "Behind House" to "East of House", let the attic be lit, and in the attic, add a turnable wheel mounted in the floor. Whenever the player-character turns the wheel, the entire house rotates 90°, changing all directional travel inside the house and where the front and back doors connect to. All room descriptions, both inside and outside the house, will need to change to conform to the house's new orientation. Only the attic itself won't care which way the house is facing.

Warning: The doors will be the most awkward part of this challenge.

Here's a sample transcript of what I'm expecting to see:

West of House
You are standing in an open field west of a white house, with a closed front door.

> n
North of House
You are facing the north side of a white house. There is no door here, and all the windows are boarded up. To the north a narrow path winds through the trees.

> e
East of House
You are behind the white house. A path leads into the forest to the east. In one corner of the house there is a back door which is closed.

> s
South of House
You are facing the south side of a white house. There is no door here, and all the windows are boarded.

> w
West of House
You are standing in an open field west of a white house, with a closed front door.

> e
(first opening the front door)

Living Room
You are in the living room. There is a doorway to the east, the front door to the west, a trophy case, and a large oriental rug in the center of the room.

> e
Kitchen
You are in the kitchen of the white house. A table seems to have been used recently for the preparation of food. A passage leads to the west and a dark staircase can be seen leading upward. A dark chimney leads down and to the east is a back door which is closed.

> u
Attic
This is the attic. A huge cast-iron wheel is set into the floor. The only exit is a stairway leading down.

> x wheel
You could try turning it.

> turn wheel
You grab the wheel and give it a turn. There's a bit of resistance at first, then the entire room, the entire house! lurches and pivots ninety degrees clockwise.

> d
Kitchen
You are in the kitchen of the white house. A table seems to have been used recently for the preparation of food. A passage leads to the north and a dark staircase can be seen leading upward. A dark chimney leads down and to the south is a back door which is closed.

> n
Living Room
You are in the living room. There is a doorway to the south, the front door to the north, a trophy case, and a large oriental rug in the center of the room.

> n
North of House
You are standing in an open field north of a white house, with an open front door. To the north a narrow path winds through the trees.

> e
East of House
You are facing the east side of a white house. There is no door here, and all the windows are boarded. A path leads into the forest to the east.

> s
South of House
You are behind the white house. In one corner of the house there is a back door which is closed.


Sound challenges

Sound support test challenge

In this challenge, your sample game must test if the player's interpreter supports playing sounds and music. Print a message at the start of the game saying if it does or not as appropriate.

If your interactive fiction game contains sound effects or music, please explicitly say so. It's nice to know if a game uses sound in case the player needs to play quietly and not disturb nearby people. Also, the player might have their earbuds plugged in 24/7, but not think they need to use them for a text game, and miss hearing anything.


Telephone ringing challenge (repeating sound effect)

This challenge is inspired by the opening scenes of several games, such as Lovely Assistant: Magical Girl by Bitter Karella or The Frenetic Five vs. Sturm und Drang by Neil deMause, where a telephone rings, and the player must answer it to find out what they're supposed to do in this game and why. In Lovely Assistant: Magical Girl, the phone starts ringing when the player-character grabs a flying mechanical dove out of the air. In The Frenetic Five vs. Sturm und Drang, the phone starts ringing 15 turns after the game begins. I don't really care what the trigger event is. Pick something.

Normally, in a text-only game, the ringing sound is handled by a message like "The phone is ringing." printed at the end of each turn. You should probably do that too. But in this challenge, I want you to find a audio clip (or record it yourself) of a ringing phone, and have it play repeatedly (with suitable breaks) in real time until the player-character answers the phone.

So, code up a room, a phone object, a trigger event for the phone to start ringing, whatever code does the actual ringing, and a suitable response to ANSWER PHONE that stops the sound effect and prints out what the caller has to say about the problem they want the player-character to solve. Feel free to add embellishments, but that's the minimum I want in this challenge.


Style challenges

Color-coded rooms challenge

This challenge is inspired by the color-coded regions in the game The Wayward Story by Cristmo Ibarra. I want you to code up four simple rooms all connected to each other like this:

Red CityRoad PurpleParlor YellowDesert GreenGarden

Feel free to write your own room descriptions and code up a few things you can carry from one room to another. The challenge is to use different colors for the text depending on which room you're in. For example:

So the main window of your game is going to look something like this:

Purple Parlor
This purple parlor is so sumptuous. This must be how kings and queens live every day.

> x me
You look the same as always.

> e

Red River Road
You don't think you'll ever get used to how red this place looks. Where do they get this much iron oxide from? Is it even safe?

> i
You're carrying:
  a ticket

> sw

Yellow Desert
This corner of your backyard is covered with a ton of yellow sand. You needed somewhere to film the desert scenes in your next film.

> x sand
It'll look even more yellow once you set up the proper lights. Lighting is everything.

> e

Green Garden
You've been very lucky with this garden. The plants out here are getting all the rain and sun they want, and you haven't had to do a thing to make it this green.

> smell
You smell nothing in particular.

Feel free to use different colors if you don't like these ones. Just make sure all four rooms feature a different color.

For bonus points, make sure that the status bar's colors likewise change to black text on a background with the appropriate color.


Text generation challenges

Candelabra challenge

This challenge is inspired by the candelabra in The Wand by Arthur DiBianca. I want you to code up a non-portable candelabra with five candles attached to it. Name the candles "first candle", "second candle", "third candle", "fourth candle", and "fifth candle". The candles can be either lit or unlit.

Keep the descriptions of the individual candles simple, eg:

> x first candle
The first candle is lit.

> x second candle
The second candle is unlit.

The main challenge will be the description of the candelabra itself. I want a succinct summary of candles' lit/unlit status, with an emphasis on what's lit. For example:

> x candelabra
The candelabra has five slim white candles. None of them are lit.

> light first candle
Done.

> x candelabra
The candelabra has five slim white candles. Only the first one is lit.

> light second candle
Done.

> x candelabra
The candelabra has five slim white candles. Only the first and second ones are lit.

> light third candle
Done.

> x candelabra
The candelabra has five slim white candles. Most of them are lit except the fourth and fifth ones.

> light fourth candle
Done.

> x candelabra
The candelabra has five slim white candles. Most of them are lit except the fifth one.

> light fifth candle
Done.

> x candelabra
The candelabra has five slim white candles. All of them are lit.

Feel free to change the wording to what sounds the most natural to you. What I don't want to see is a series of brick-sentences like "The first candle is lit. The second candle is unlit. The third candle is lit. The fourth candle is unlit. The fifth candle is lit." Yuck. A hard no to that noise.

To test if you got this right, you will need to also code up some commands to LIGHT and EXTINGUISH the candles. I think BURN candle should mean the same as LIGHT candle, and both PUT OUT candle and BLOW candle should mean the same as EXTINGUISH candle.

For bonus points, make "candles", "all candles", "all the candles", and "all of the candles" synonyms of the candelabra.


Singing challenge

In this challenge, reproduce the response to SING in the game Stuff of Legend by Lance Campbell. For example:

> sing
You manage to hum a few bars of a tune called "Mine Love for the Brave Old Sailor".

> sing
You manage to hum a few bars of a tune called "O, Sweet Plague-Ridden Washwoman".

> sing
You manage to hum a few bars of a tune called "The Ballad of the Apple-Cheeked Harpy".

We want random song titles. Assemble the song title from three to four parts:


Things challenges

Color sequence lock challenge

In this challenge, code up a locked safe or strongbox with a single dial on it. Put a diamond or something inside as a prize for opening the safe.

The dial is a "rainbow dial". It can be set to any color of the rainbow: red, yellow, orange, green, blue, indigo, or violet. To unlock the safe, the PC must turn the dial to these four colors in sequence: green-yellow-orange-red.


Open barrel challenge

In this challenge, I want you to code up a barrel that's open on one end. It can have three possible orientations: upright, on its side, and upside-down.

When the barrel is upright, it is a container. It cannot be pushed from place to place. If the player pushes, pulls, or tips the upright barrel, it is now on its side, and everything inside it stays inside.

When the barrel is on its side, it is a container, and can be pushed from place to place. If the player pushes a sideways barrel, they should be prompted which direction they want to push it. If the player pulls a sideways barrel, the barrel is now upright. If the player tips a sideways barrel, the barrel is now upside-down and everything inside falls out.

When the barrel is upside-down, it is a supporter, not a container. It cannot be pushed from place to place. If the player pushes, pulls or tips the upside-down barrel, it is now on its side, and everything that was on top of the barrel falls off.

For an advanced challenge, let the PC be able to stand on top of the barrel when it's upside-down, or get inside it otherwise.


Wheelchair challenge

In this challenge, code up a wheelchair and a few connected locations. Make at least one of the connections unusable by a wheelchair, such as a stairway. Test the wheelchair by getting in it and using normal directional commands like "e" or "s" to get around.

For an advanced challenge, make the PC disabled and unable to directionally travel unless they are in the wheelchair. Still permit the PC to enter and leave the wheelchair, of course.


Brainstorming ideas

This page is ultra-new. I have to figure out what to say first! Let me jot down some ideas to think about and expand on and turn into actual coding or writing challenges.


References

TODO: List some external links to things that might help out with this sort of thing.