IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

2020/tsoj - Most misleading indentation

← otterness ↑ 2020 ↑ yang → C code Makefile Inventory





Author:

To build:

make

There is an alternate version which has controls that will make much more sense to those familiar with vi. See Alternate code below.

To use:

./prog

Try:

# Make your terminal as large as possible, possibly reduce your font size
# then...
./prog

Alternate code:

This version has the difference of moving forwards, left, backwards and right, where instead of w, a, s and d, you can use k, h, j and l.

Alternate build:

make alt

Alternate use:

# Make your terminal as large as possible, possibly reduce your font size
# then...
./prog.alt

..and maybe curse less than you might otherwise, but still probably curse (see below) :-)

Judges’ remarks:

This game does not use curses, but you may end up cursing.

The code is made more difficult to read using an innovative, right justified, reverse indentation style.

Author’s remarks:

Controls

   /\
  //\\
 /    \
/______\
  /\/\

Compile and run

Linux

cc -std=c99 -O3 prog.c -o prog
./prog

Windows

The only way I found to make it work is to use MSYS2. When using the MSYS2 shell you can install gcc via pacman.

cc -std=c99 -O3 prog.c -o prog
./prog.exe

Warnings

High score

Score will be shown in the top left corner. My best was 156. If you beat that I’ll send you the image of a very expensive chocolate.

Features

Tips

Inventory for 2020/tsoj

Jump to top

Primary files

Secondary files