make
./prog
On a terminal that supports 24 bit color, has black background, and size at least 125x38, try:
./try.sh
It is said by some students of Astronomy:
Oh, Be A Fine Gal, Kiss Me!
Oh, Be A Fine Gentleman, Kiss Me!
Many Mnemonic variations exist. You might wish, on a star, to better understand the colors being displayed. And those in the deep south might wish to go north for a better view.
cc -o prog -std=gnu11 -O3 prog.c
or
make
You can generate an A3 sized poster by make docs. This command creates a pdf file poikola.pdf.
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.
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 the output are as accurate as possible.
This program also tells once in a year if it is correct time to find and eat some Easter eggs.
The program has also at least three other functions, obvious and not so obvious.
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.
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.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 entry that requires X11?) or some other working
terminal. Thanks to Dave Burton for spotting this
problem.
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 big-endian too, but this support is somewhat limited.
This program has been compiled with:
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.
Please do not feed little babies chocolate.
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.
The space after #define p return
is necessary.
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.
o
,
b
, and a
are used in totally unrelated tasks.__ATOMIC_SEQ_CST
.begin;
and end;
instead of curly brackets. They are
used also in my code, but I had to shorten them to meet size requirements.$
, but then I rejected it.If you think you understand how this program works, can you answer these questions:
aI_
after line 21?Because the rot13 is too easy to decode with the plain eyes, I decided to use the 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. Find the text that says:
Manual decryption and parameters
Shift/Key (number)
and enter 18 and then click the button that says: DECRYPT (BRUTEFORCE)
.