Files
ioccc/2001/williams/README.md
T
Cody Boone Ferguson 6707d601b6 Add bug status to 2001/williams
There are two bugs that are known. First is that at the end of the game
(when you lose) it appears to in (an infinite?) while loop call
usleep(3). However you can still shoot your missiles at this point. The
other bug is that it will eventually crash. It's easy to make it crash
if you wait until everything is destroyed (that is when it starts
printing the lines in a loop, sleeping over and over again) and only
then start shooting your missiles, over and over again until it crashes.
It appears that it's the 'Window *d' getting corrupted but I'm not sure
why. These details have been added to bugs.md.

The README.md file has been format fixed.

There was a minor change to williams.c as well though this was only
rolling back a change that should not have been committed yesterday.
2023-11-17 11:56:32 -08:00

2.2 KiB

To build:

make

Bugs and (Mis)features:

The current status of this entry is:

STATUS: known bug - please help us fix

For more detailed information see 2001 williams in bugs.md.

To use:

./williams

Judges' remarks:

A strange game. The only winning move is not to play. No, really; you can't actually win. :)

The formatting really wants a wide screen; if you can't read it that way, it's the standard "three triangles around a circular" logo for nukes.

This is a pretty straightforward game.

Author's remarks:

What this program does:

It plays Missile Command, complete with MIRVs, smart bombs, extra cities, and scoring.

Command line arguments and input files are ignored.

To play, just point and click where you want your ABMs to explode.

The score is 10 points for each missile which is destroyed before it reaches the ground, -1 point for each ABM used, and 100 bonus points for each city left at the end of a level.

The game ends when you lose all your cities, although you will have to wait until the level finishes raining down to see your final score.

Obfuscation

The main obfuscation technique is the need to compress the code to fit all the functionality within the size limits. I could not have included smart bombs without the rule excluding {}; characters in the counts. All of the #defines are there to reduce code size.

On the other hand, I did waste a few characters in order to include some rather obfuscated math in the program. It uses fixed-point arithmetic, resulting in the overuse of bitwise shift operators. Another example is (x|1), which is used in a couple different ways. The purpose of A/(x|1) is probably obvious, but what does (x|1)%2 do?

This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. You are free to share and adapt this file under the terms of this license:

Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)

For more information, see: https://creativecommons.org/licenses/by-sa/4.0/