Files
ioccc/2020/tsoj
Landon Curt Noll 96e0f2b966 move some rules into 1337.mk
A number of rules have been moved from entry `Makefile`s into the
`1337.mk` include file to make it easier for these common rules to be
updated or modified globally (by modifying the `1337.mk` include file).

The entry level `Makefile`s are now similar in form to the
/Makefile.example](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)
file from the other repo.

The following make rules were moved into the `1337.mk` include file:

- `make indent.c`
- `make install`
- `make diff_orig_prog`
- `make diff_prog_orig`
- `make diff_alt_prog`
- `make diff_prog_alt`

This simplifies the entry level `Makefile`s so that they mostly reflect
the specifics of the particular entry.

Mentioned in FAQ 4.2, that the make diff rules are in the `1337.mk` include file.

Fixed invalid TAB character in `faq.md`.

Removed `make clean` directives that removed `indent.c`.  This file is now
removed via `make indent_clean`, a clean rule that also removes `indent.c`.

Removed `make clobber` directives that removed sandwich,  This file is now
removed via `make indent_clobber`, a clean rule that also removes `sandwich`.

Added `make indent_clean` and `make indent_clobber` rules into the top level
`Makefile` and the year level `YYYY/Makefile`.

Performed `make quick_www` to accomplish the above and to test under macOS.
2024-08-21 23:42:28 -07:00
..
2024-08-21 23:42:28 -07:00
2023-11-04 09:04:14 -07:00
2020-12-31 18:34:17 -08:00
2023-07-06 21:49:38 -07:00

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:

``` <!---sh-->
    # 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

  • Movement: w (forwards), a (left), s (backwards), d (right)
  • Fire: space
  • Quit: q
  • Pause: p, then use any other key to resume
       /\
      //\\
     /    \
    /______\
      /\/\

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

  • -Wno-missing-prototypes
  • -Wno-shorten-64-to-32
  • -Wno-sign-conversion
  • -Wno-implicit-int-float-conversion
  • -Wno-missing-field-initializers
  • -Wno-implicit-float-conversion
  • -Wno-vla
  • -Wno-float-conversion
  • -Wno-comma
  • -Wno-shadow
  • -Wno-format
  • -Wno-empty-body
  • -Wno-misleading-indentation
  • -Wno-maybe-uninitialized
  • You may experience a mild motion aftereffect when playing for too long.

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

  • Procedural star generation.
  • Very space-efficient for loops.
  • No use of != or ==.
  • Smooth rendering even on slow terminals.
  • Advanced ASCII art.
  • Cutting edge physics engine and collision detection.
  • Probably not many segfaults.
  • Every letter in the English alphabet has a variable or function named after it.
  • Not a virus.
  • Runs on my machine.

Tips

  • Adjust your terminal size for different experiences.
  • Run this program in a virtual console to immerse yourself in the game.