Add 2018/poikola/try.sh + format/typo checks

I believe this completes the review of the entry.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-12 05:02:25 -08:00
1 parent ea12ffb632
commit 03ba78f2d1
3 files changed
+80 -18

No files matched your search

+46 -17
View File
@@ -14,10 +14,11 @@ make
### Try:
On terminal supports 24 bit color, has black background, and size at least 125x38, try:
On a terminal that supports 24 bit color, has black background, and size at
least 125x38, try:
```sh
./prog
./try.sh
```
@@ -54,16 +55,17 @@ make
You can generate an A3 sized poster by _make docs_. This command creates a pdf
file _poikola.pdf_.
### What this entry does:
#### Introduction:
### Introduction:
It was a starry night when my wife pointed her finger up and asked: "What is
this star and may I have some Easter eggs?"
So I had to sit down and solve those tricky questions with Nano and a C
compiler.
#### Little spoilers:
### Little spoilers:
Basically, the program draws animated ASCII art of the Big Dipper using Annie
Jump Cannon's spectral classification system of stars and I think the colors of
@@ -74,7 +76,9 @@ some Easter eggs.
The program has also at least three other functions, obvious and not so obvious.
#### Technical jargon
### Technical jargon
This program has been tested on xterm and Konsole and also Linux virtual
terminal. Color support in the terminal is not necessary, but the effect is
better with it.
@@ -83,12 +87,14 @@ This entry has partial support for terminals with a white background but the
best viewing experience is achieved when the terminal in use supports 24-bit
colors, has a black background and the size is at least 125x38.
Special note for Mac users: __Terminal__ does not work as expected; you might
need xterm from XQuartz or some other working terminal. Thanks to [Dave
Burton](/winners.html#Dave_Burton) for spotting this problem.
Special note for Mac users: `Terminal.app` does not work as expected; you might
need xterm from XQuartz (see [FAQ 3.7: How do I compile and use on macOS, an
IOCCC winner that requires X11?](/faq.md#X11macos)) or some other working
terminal. Thanks to [Dave Burton](/winners.html#Dave_Burton) for spotting this
problem.
The main reason for the header `unistd.h` is `getdelim()` but once I included it
I also abused other functions and defines. This header is mutually exclusive
The main reason for the header `unistd.h` is `getdelim(3)` but once I included it
I also abused other functions and `#define`s. This header is mutually exclusive
with _-std=c11_.
The program was developed with little-endian machines; I tried to support
@@ -102,15 +108,25 @@ This program has been compiled with:
4. Lego Mindstorms EV3 Intelligent Brick (Debian Jessie) with gcc and clang (in
this case, compiling time with clang-3.5 12 seconds and with gcc 27 seconds)
### Extra notes from the judges on the macOS Terminal.app problems:
Depending on the settings of the terminal in Terminal.app the program might not
show anything at all. In other cases it won't show all the colours right but
mostly is okay. YMMV, as they say.
### Warnings and restrictions required by law:
Please do not feed little babies chocolate.
### Major spoilers:
<div style="margin-bottom:61em;">&nbsp;</div>
I incorporated the Fletcher 16 checksum algorithm into the source for security
reasons; it might be challenging to make changes without breaking the main
functionality of the code.
### Major spoilers:
I incorporated the [Fletcher 16 checksum
algorithm](https://en.wikipedia.org/wiki/Fletcher%27s_checksum) into the source
for security reasons; it might be challenging to make changes without breaking
the main functionality of the code.
The space after `#define p return` is necessary.
@@ -118,6 +134,7 @@ The computus (method to determine the date of Easter) uses an algorithm
described in the journal Nature in 1876. It should be valid for Gregorian
calendars.
### Some obfuscation techniques used:
1. I tried to use meaningless or misleading variable names. For example, this
@@ -144,11 +161,23 @@ questions:
### Rot18 part
Because the rot13 is too easy to decode with the plain eyes, I decided to use
the Caesar cipher with the key 18.
the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) with the key
18:
Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv
gfdq gf dalldw-wfvasf esuzafwk.
If you want to or must know and don't know how to decipher this, you might look
at the [Caesar cipher decoder](https://www.dcode.fr/caesar-cipher). Find the
text that says:
```
Manual decryption and parameters
Shift/Key (number)
```
and enter 18 and then click the button that says: `DECRYPT (BRUTEFORCE)`.
## Copyright and CC BY-SA 4.0 License:
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2018/poikola
#
# 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
clear
read -r -n 1 -p "Press any key to show code (space = next page, q = quit): "
echo 1>&2
less -EXF prog.c
read -r -n 1 -p "Press any key to run program: "
echo 1>&2
./prog
+9 -1
View File
@@ -4037,7 +4037,15 @@ supposed to segfault :-)
## <a name="2019_poikola"></a>[2019/poikola](/2019/poikola/prog.c) ([README.md[(/2019/poikola/README.md))
[Cody](#cody) added a missing rule to the Makefile.
[Cody](#cody) added the `docs` rule to the Makefile that forms a PDF file. The
rule requires the tool `pdflatex`.
Cody also added the [try.sh](/2019/poikola/try.sh) script.
[Dave Burton](/winners.html#Dave_Burton), during the preview period, noticed a
problem where the macOS `Terminal.app` does not work properly for this program.
We added some additional notes on what might happen (it varies depending on
configuration).
## <a name="2019_karns"></a>[2019/karns](/2019/karns/prog.c) ([README.md](/2019/karns/README.md]))