### Synopsis

``` <!---sh-->
    ./prog 80 25

    ./prog 80 25 | sed -e 's/\S/#/g' > dungeon.txt

    ./prog 80 25 | convert sixel:- walking_mushroom.png
```

### Details

Marcille is a dungeon generator.  Run without arguments for the help message below:

```
    ./prog {36<=w<2048} {12<=h<2048} [seed]
```

Marcille takes two or three arguments:

+ First argument is width, accepted range is between 36 and 2047.

+ Second argument is height, accepted range is between 12 and 2047.

+ Third optional argument is random seed.

Running with a deterministic seed will produce deterministic output, although this seed does not guarantees the same output across different systems (it depends on the local implementation of `rand()`).

If a seed is not specified, Marcille will try to produce a random seed using ASLR.  On systems where ASLR doesn't happen (e.g. Cygwin), it's recommend to run with `` `date +"%s"` `` to use current time as seed.

Marcille will try to produce a dungeon of the specified width and height.  What you actually get depends on your terminal:

+ On terminals that has Sixel support enabled (e.g. `mintty`, `xterm -ti 340`), you will see an image of a walking mushroom.

+ On terminals that don't recognize Sixel at all (e.g. `PuTTY`, windows console), you will see an ASCII art dungeon.  Curiously, a MingW compiled binary running inside `mintty` will produce ASCII art dungeon when running by itself, and generate Sixel image when its output is piped through Cygwin's `cat` (see sample_output.png).

+ On terminals that recognize Sixel but has it disabled (e.g. `gnome-terminal`, `xterm` with default options), you might get just blank lines.

To force dungeon output regardless of terminal, you can replace all control codes with some character using `sed`, for example:

``` <!---sh-->
    ./prog 80 25 `date +"%s"` | sed -e 's/\S/#/g' > output.txt
```

If you have ImageMagick, you can use that to convert Sixel image into some other image format, for example PNG:

``` <!---sh-->
    ./prog 80 25 `date +"%s"` | convert sixel:- output.png
```

## Features

+ Run-length encoded Sixel image rasterized from bezier curves for a smooth looking walking mushroom.  There seem to be a lack of Sixel content in IOCCC, even though the technology has been around for about as long as IOCCC has existed.  This entry hopes to spark interest in bringing more Sixel graphics to IOCCC.

+ Organic looking dungeon with connected caverns.  Many maze generators have appeared in IOCCC's history, but they tend to generate mazes with straight corridors.  In NetHack terms, previous IOCCC programs produced maps that looked like Gehennom, while this program produced maps that look more like Gnomish Mines.

+ CRC32 of the source code is embedded in the source code itself (`crc=fff10ccc`).

+ ASCII art code layout based on Marcille Donato from Dungeon Meshi (Delicious in Dungeon).

+ Process for making this ASCII art is available in `making.html`.

+ Process for reformatting and annotating the ASCII art code to more readable code is in `spoiler.html`.  The end result is `spoiler.c`.

## Compatibility

Marcille has been verified to work with these compiler/environment combinations.

+ gcc 9.3.0 on JS/Linux.
+ gcc 9.4.0 on Linux.
+ gcc 10.2.1 on Linux.
+ gcc 12.4.0 on Cygwin.
+ gcc 12.4.0 on MingW.
+ clang 8.0.1 on Cygwin.
+ clang 11.0.1-2 on Linux.

Sixel output has been verified to work with mintty 3.7.8 and xterm 366 (running as `xterm -ti 340`), and the output is acceptable to ImageMagick 7.0.10-61.
