3 files changed
+112
-62
No files matched your search
@@ -129,6 +129,7 @@ all: data ${TARGET}
|
|||||||
${PROG}: ${PROG}.c
|
${PROG}: ${PROG}.c
|
||||||
@echo "NOTE: this entry has different compiler errors based on compilation line."
|
@echo "NOTE: this entry has different compiler errors based on compilation line."
|
||||||
@echo "The purpose is to find the right error message to win the game!"
|
@echo "The purpose is to find the right error message to win the game!"
|
||||||
|
@echo "NOTE: your terminal should be set to 80 columns, 8 character tabs, and wraparound."
|
||||||
-${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
-${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
|
|||||||
+92
-62
@@ -1,57 +1,80 @@
|
|||||||
# Worst Abuse of the C Preprocessor:
|
# Worst Abuse of the C Preprocessor:
|
||||||
|
|
||||||
Brian Westley (Merlyn LeRoy on Usenet)
|
Brian Westley (Merlyn LeRoy on Usenet)
|
||||||
Digi International
|
Digi International
|
||||||
1906 James Ave.
|
1906 James Ave.
|
||||||
St. Paul, MN 55105
|
St. Paul, MN 55105
|
||||||
USA
|
USA
|
||||||
|
<http://www.westley.org>
|
||||||
http://www.westley.org
|
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
make all
|
```sh
|
||||||
|
make all
|
||||||
|
```
|
||||||
|
|
||||||
NOTE: the purpose of this entry is to escape the dungeon via the compiler line
|
NOTE: the purpose of this entry is to escape the dungeon via the compiler line
|
||||||
where you get messages as compiler errors. Depending on the compiler line you
|
where you get messages as compiler errors. Depending on the compiler line you
|
||||||
will get different error messages and one compiler line will make you win the
|
will get different error messages and one compiler line will make you win the
|
||||||
game!
|
game!
|
||||||
|
|
||||||
## To run
|
## To run:
|
||||||
|
|
||||||
./westley
|
```sh
|
||||||
|
./westley
|
||||||
|
```
|
||||||
|
|
||||||
## Judges' comments
|
NOTE: your terminal should be set to 80 columns, 8 character tabs, and
|
||||||
|
wraparound.
|
||||||
|
|
||||||
|
|
||||||
|
## Try:
|
||||||
|
|
||||||
But for something more interesting try compiling it with
|
But for something more interesting try compiling it with
|
||||||
different cc arguments. For example:
|
different cc arguments. For example:
|
||||||
|
|
||||||
cc -Describe -Door westley.c
|
```sh
|
||||||
cc -Describe -Drain westley.c
|
cc -Describe -Door westley.c
|
||||||
|
cc -Describe -Drain westley.c
|
||||||
|
```
|
||||||
|
|
||||||
|
## Judges' comments:
|
||||||
|
|
||||||
Not all compiler errors are bad.
|
Not all compiler errors are bad.
|
||||||
|
|
||||||
For spoilers see the end of the notes from the author below.
|
For spoilers see the end of the notes from the author below.
|
||||||
|
|
||||||
## Author's comments
|
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) converted the spoiler
|
||||||
|
compiler options to be compiler commands and added a script
|
||||||
|
[spoiler.sh](spoiler.sh) to automate the spoiler commands provided by the author
|
||||||
|
to make it easier to see the game in action. Thank you Cody! To use:
|
||||||
|
|
||||||
This program, in accordance with the rules, compiles into a legal
|
```sh
|
||||||
C program without human intervention. However, it simply compiles
|
./spoiler.sh
|
||||||
into "main(){}", which does nothing and exits, so you don't need
|
```
|
||||||
to actually compile the program.
|
|
||||||
|
|
||||||
This program is a simple adventure game which uses only C preprocessor
|
## Author's comments:
|
||||||
error messages (for missing #include files) as output. To begin,
|
|
||||||
try to compile the program with no options:
|
|
||||||
|
|
||||||
cc westley.c
|
This program, in accordance with the rules, compiles into a legal
|
||||||
|
C program without human intervention. However, it simply compiles
|
||||||
|
into `main(){}`, which does nothing and exits, so you don't need
|
||||||
|
to actually compile the program.
|
||||||
|
|
||||||
This will fail, producing an error message for a missing #include
|
This program is a simple adventure game which uses only C preprocessor
|
||||||
file as the opening description. Your terminal should be set for
|
error messages (for missing `#include` files) as output. To begin,
|
||||||
80 columns, 8 character tabs, and wraparound, as there is no way
|
try to compile the program with no options:
|
||||||
to reliably output newlines. You should see something like this
|
|
||||||
(text massaged to change wraparound to separate lines):
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cc westley.c
|
||||||
|
```
|
||||||
|
|
||||||
|
This will fail, producing an error message for a missing `#include`
|
||||||
|
file as the opening description. Your terminal should be set for
|
||||||
|
80 columns, 8 character tabs, and wraparound, as there is no way
|
||||||
|
to reliably output newlines. You should see something like this
|
||||||
|
(text massaged to change wraparound to separate lines):
|
||||||
|
|
||||||
|
```
|
||||||
westley.c
|
westley.c
|
||||||
westley.c(87) : fatal error C1024: cannot open include file '
|
westley.c(87) : fatal error C1024: cannot open include file '
|
||||||
|
|
||||||
@@ -61,47 +84,54 @@ For spoilers see the end of the notes from the author below.
|
|||||||
a floor drain
|
a floor drain
|
||||||
|
|
||||||
'
|
'
|
||||||
Your compiler error message will vary, but the important part is the
|
```
|
||||||
missing include file name, which functions as the game text.
|
|
||||||
|
|
||||||
To "do" things, all words must start with "-D". For example, to
|
Your compiler error message will vary, but the important part is the
|
||||||
look at the door, do:
|
missing include file name, which functions as the game text.
|
||||||
|
|
||||||
cc -Describe -Door prog.c
|
To "do" things, all words must start with `-D`. For example, to
|
||||||
|
look at the door, do:
|
||||||
|
|
||||||
...and you will get another error message telling you about the door.
|
```sh
|
||||||
(note: some compilers will stop after the first missing include file,
|
cc -Describe -Door prog.c
|
||||||
while others will continue to try compiling; the latter will repeat
|
```
|
||||||
the opening message each time, as if you are playing an adventure game
|
|
||||||
with "verbose" turned on).
|
|
||||||
|
|
||||||
The goal of the game is to escape the dungeon.
|
...and you will get another error message telling you about the door.
|
||||||
|
(note: some compilers will stop after the first missing include file,
|
||||||
|
while others will continue to try compiling; the latter will repeat
|
||||||
|
the opening message each time, as if you are playing an adventure game
|
||||||
|
with "verbose" turned on).
|
||||||
|
|
||||||
Here is a walk-through for the game, including a few dead-ends:
|
The goal of the game is to escape the dungeon.
|
||||||
---SPOILER---
|
|
||||||
|
|
||||||
-Describe -Door
|
|
||||||
-Describe -Drain
|
|
||||||
-Describe -Dwarf
|
|
||||||
-Describe -Debris (or -Dungeon)
|
|
||||||
-Describe -Desk
|
|
||||||
-Describe -Dime
|
|
||||||
-Describe -Directory
|
|
||||||
-Dial -DUNgeon0614
|
|
||||||
-Drink -Daiquiri
|
|
||||||
-Drop -Daiquiri
|
|
||||||
-Drop -Dwarf -Daiquiri (or -Drop -Down -Daiquiri)
|
|
||||||
-Describe -Document
|
|
||||||
-Depress -Dotted -Dog
|
|
||||||
-Depress -Dalmatian (also accepts "Dalmation" [sic])
|
|
||||||
-Deposit -Dime
|
|
||||||
-Drop -Donut
|
|
||||||
-Drop -Donut -Down -Drain (or -Drop -Dwarf -Donut)
|
|
||||||
(at this point, you win!)
|
|
||||||
|
|
||||||
Note that the game has no real state information; you can type these
|
Here is a walk-through for the game, including a few dead-ends:
|
||||||
commands in any order, at any time. Also note that word order is
|
|
||||||
unimportant.
|
### SPOILER
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cc -Describe -Door westley.c
|
||||||
|
cc -Describe -Drain westley.c
|
||||||
|
cc -Describe -Dwarf westley.c
|
||||||
|
cc -Describe -Debris westley.c # or -Dungeon
|
||||||
|
cc -Describe -Desk westley.c
|
||||||
|
cc -Describe -Dime westley.c
|
||||||
|
cc -Describe -Directory westley.c
|
||||||
|
cc -Dial -DUNgeon0614 westley.c
|
||||||
|
cc -Drink -Daiquiri westley.c
|
||||||
|
cc -Drop -Daiquiri westley.c
|
||||||
|
cc -Drop -Dwarf -Daiquiri westley.c # or -Drop -Down -Daiquiri
|
||||||
|
cc -Describe -Document westley.c
|
||||||
|
cc -Depress -Dotted -Dog westley.c
|
||||||
|
cc -Depress -Dalmatian westley.c # also accepts "Dalmation" [sic]
|
||||||
|
cc -Deposit -Dime westley.c
|
||||||
|
cc -Drop -Donut westley.c
|
||||||
|
cc -Drop -Donut -Down -Drain westley.c # or -Drop -Dwarf -Donut
|
||||||
|
# (at this point, you win!)
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the game has no real state information; you can type these
|
||||||
|
commands in any order, at any time. Also note that word order is
|
||||||
|
unimportant.
|
||||||
|
|
||||||
## Copyright and CC BY-SA 4.0 License:
|
## Copyright and CC BY-SA 4.0 License:
|
||||||
|
|
||||||
|
|||||||
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cc -Describe -Door westley.c
|
||||||
|
cc -Describe -Drain westley.c
|
||||||
|
cc -Describe -Dwarf westley.c
|
||||||
|
cc -Describe -Debris westley.c # or -Dungeon
|
||||||
|
cc -Describe -Desk westley.c
|
||||||
|
cc -Describe -Dime westley.c
|
||||||
|
cc -Describe -Directory westley.c
|
||||||
|
cc -Dial -DUNgeon0614 westley.c
|
||||||
|
cc -Drink -Daiquiri westley.c
|
||||||
|
cc -Drop -Daiquiri westley.c
|
||||||
|
cc -Drop -Dwarf -Daiquiri westley.c # or -Drop -Down -Daiquiri
|
||||||
|
cc -Describe -Document westley.c
|
||||||
|
cc -Depress -Dotted -Dog westley.c
|
||||||
|
cc -Depress -Dalmatian westley.c # also accepts "Dalmation" [sic]
|
||||||
|
cc -Deposit -Dime westley.c
|
||||||
|
cc -Drop -Donut westley.c
|
||||||
|
cc -Drop -Donut -Down -Drain westley.c # or -Drop -Dwarf -Donut
|
||||||
Reference in new issue
Block a user