Merge pull request #1699 from xexyl/endoh12018
This commit is contained in:
3 files changed
+70
-6
No files matched your search
@@ -14,16 +14,17 @@ make
|
|||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
|
To see the input files and feed them to the program, redirecting to GIF files:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./prog < golem.txt > golem.gif
|
./try.sh
|
||||||
./prog < smily.txt > smily.gif
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
To get the best experience, use a GIF viewer that can handle animated gifs.
|
To get the best experience, use a GIF viewer that can handle animated GIFs.
|
||||||
On OS X you can use Safari using "open -a Safari smily.gif"
|
With macOS you can use Safari using `open -a Safari smily.gif`.
|
||||||
|
|
||||||
Some things to consider are that this 2.5KiB gem encodes a 96 character 8x8
|
Some things to consider are that this 2.5KiB gem encodes a 96 character 8x8
|
||||||
font (naively this could already take 6144 bytes) and a GIF encoder. But
|
font (naively this could already take 6144 bytes) and a GIF encoder. But
|
||||||
@@ -44,8 +45,9 @@ cc -o prog prog.c
|
|||||||
./prog < invisible.txt > invisible.gif
|
./prog < invisible.txt > invisible.gif
|
||||||
```
|
```
|
||||||
|
|
||||||
Open invisible.gif and then wait a minute. You will see a hidden message.
|
Open `invisible.gif` with a GIF viewer that can show animated GIFs and then wait
|
||||||
Can you tell the difference between letters that leaves the mark and ones that does not?
|
a minute. You will see a hidden message. Can you tell the difference between
|
||||||
|
letters that leave the mark and ones that do not?
|
||||||
|
|
||||||
Other examples:
|
Other examples:
|
||||||
|
|
||||||
|
|||||||
Executable
+52
@@ -0,0 +1,52 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2018/endoh1
|
||||||
|
#
|
||||||
|
|
||||||
|
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||||
|
# this way allows us to have the user specify a different compiler in an easy
|
||||||
|
# way.
|
||||||
|
if [[ -z "$CC" ]]; then
|
||||||
|
CC="cc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
make CC="$CC" all >/dev/null || exit 1
|
||||||
|
|
||||||
|
# clear screen after compilation so that only the entry is shown
|
||||||
|
clear
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -EXF prog.c
|
||||||
|
echo "$ ./prog < prog.c > prog.gif" 1>&2
|
||||||
|
./prog < prog.c > prog.gif
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to show golem.txt (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -EXF golem.txt
|
||||||
|
echo "$ ./prog < golem.txt > golem.gif" 1>&2
|
||||||
|
./prog < golem.txt > golem.gif
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to show smily.txt (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -EXF smily.txt
|
||||||
|
echo "$ ./prog < smily.txt > smily.gif" 1>&2
|
||||||
|
./prog < smily.txt > smily.gif
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to show invisible.txt (space = next page, q = quit): "
|
||||||
|
less -EXF invisible.txt
|
||||||
|
echo "$ ./prog < invisible.txt > invisible.gif" 1>&2
|
||||||
|
./prog < invisible.txt > invisible.gif
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
echo "Now open the GIF files prog.gif, golem.gif, smily.gif and invisible.gif" 1>&2
|
||||||
|
echo "in a GIF viewer that can display animation in animated GIFs." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo "If you use macOS you can open them all in Safari, one tab per image, like: " 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo " open -a Safari prog.gif golem.gif smily.gif invisible.gif" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo "Once they're open make sure to watch as they change form." 1>&2
|
||||||
@@ -3968,6 +3968,16 @@ work for Windows, based on the author's remarks.
|
|||||||
Internet Wayback Machine.
|
Internet Wayback Machine.
|
||||||
|
|
||||||
|
|
||||||
|
## <a name="2018_endoh1"></a>[2018/endoh1](/2018/endoh1/prog.c) ([README.md](/2018/endoh1/README.md))
|
||||||
|
|
||||||
|
[Cody](#cody) added the [try.sh](/2018/endoh1/try.sh) script which shows the
|
||||||
|
input files one at a time and after each one is shown, it feeds it to the
|
||||||
|
program, redirecting the output to the respective GIF file. It then will inform
|
||||||
|
the user they should open it in a GIF viewer that can show animation in animated
|
||||||
|
GIF files. It offers an example command for macOS like the judges did in their
|
||||||
|
remarks. The input files offered includes the prog.c as the author,
|
||||||
|
[Yusuke](#yusuke), suggested that it too has a secret.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2018_endoh2"></a>[2018/endoh2](/2018/endoh2/prog.c) ([README.md](/2018/endoh2/README.md))
|
## <a name="2018_endoh2"></a>[2018/endoh2](/2018/endoh2/prog.c) ([README.md](/2018/endoh2/README.md))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user