362 lines
18 KiB
HTML
362 lines
18 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="../../ioccc.css">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>2018/poikola - Most stellar</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2018 IOCCC entry poikola - Most stellar">
|
||
<meta name="keywords" content="IOCCC, 2018, IOCCC 2018, IOCCC entry, poikola, Most stellar">
|
||
</head>
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- The content of main section of this web page came from: 2018/poikola/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2018/poikola/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2018/poikola/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2018/poikola/README.md !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>2018/poikola - Most stellar</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||
|
||
<div class="topnav">
|
||
<a class="Left" href="../mills/index.html">← mills</a>
|
||
<a class="Left" href="../index.html">↑ 2018 ↑</a>
|
||
<a class="Left" href="../vokes/index.html">vokes →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/prog.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||
|
||
<div class="row">
|
||
|
||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||
|
||
<div class="leftcolumn">
|
||
|
||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||
|
||
<div class="sidenav">
|
||
<a href="#content">Jump to contents</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../index.html">IOCCC Home</a>
|
||
<a href="../../years.html">Winning Entries</a>
|
||
<a href="../../authors.html">People who have won</a>
|
||
<a href="../../location.html">Location of authors</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../news.html">IOCCC News</a>
|
||
<a href="../../status.html">Contest status</a>
|
||
<a href="../../next/index.html">Rules and Guidelines</a>
|
||
<a href="../../faq.html#submit">How to enter the IOCCC</a>
|
||
<a href="../../faq.html">FAQ</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../bugs.html">Bugs & (mis)features</a>
|
||
<a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a>
|
||
<a href="../../faq.html#fix_web_site">Fixing the web site</a>
|
||
<a href="../../faq.html#fix_author">Fixing author info</a>
|
||
<a href="../../thanks-for-help.html">Thanks for the help</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../judges.html">The IOCCC Judges</a>
|
||
<a href="../../contact.html">Contacting the IOCCC</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="#top">Jump to top</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||
|
||
<div class="rightcolumn">
|
||
|
||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<a name="content"></a>
|
||
|
||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#Timo_Poikola">Timo Poikola</a><br>
|
||
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)</li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make</code></pre>
|
||
<h2 id="to-use">To use:</h2>
|
||
<pre><code> ./prog</code></pre>
|
||
<h2 id="try">Try:</h2>
|
||
<p>On a terminal that supports 24 bit color, has black background, and size at
|
||
least 125x38, try:</p>
|
||
<pre><code> ./try.sh</code></pre>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>It is said by some students of Astronomy:</p>
|
||
<pre><code> Oh, Be A Fine Gal, Kiss Me!
|
||
Oh, Be A Fine Gentleman, Kiss Me!</code></pre>
|
||
<p>Many <a href="http://www.star.ucl.ac.uk/%7Epac/obafgkmrns.html">Mnemonic variations</a> 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.</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="how-to-build">How to build:</h3>
|
||
<pre><code> cc -o prog -std=gnu11 -O3 prog.c</code></pre>
|
||
<p>or</p>
|
||
<pre><code> make</code></pre>
|
||
<h3 id="poster">Poster:</h3>
|
||
<p>You can generate an A3 sized poster by <em>make docs</em>. This command creates a pdf
|
||
file <em>poikola.pdf</em>.</p>
|
||
<h3 id="introduction">Introduction:</h3>
|
||
<p>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?”</p>
|
||
<p>So I had to sit down and solve those tricky questions with Nano and a C
|
||
compiler.</p>
|
||
<h3 id="little-spoilers">Little spoilers:</h3>
|
||
<p>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.</p>
|
||
<p>This program also tells once in a year if it is correct time to find and eat
|
||
some Easter eggs.</p>
|
||
<p>The program has also at least three other functions, obvious and not so obvious.</p>
|
||
<h3 id="technical-jargon">Technical jargon</h3>
|
||
<p>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.</p>
|
||
<p>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.</p>
|
||
<p>Special note for Mac users: <code>Terminal.app</code> does not work as expected; you might
|
||
need xterm from XQuartz (see <a href="../../faq.html#X11macos">FAQ 3.7: How do I compile and use on macOS, an
|
||
IOCCC entry that requires X11?</a>) or some other working
|
||
terminal. Thanks to <a href="../../authors.html#Dave_Burton">Dave Burton</a> for spotting this
|
||
problem.</p>
|
||
<p>The main reason for the header <code>unistd.h</code> is <code>getdelim(3)</code> but once I included it
|
||
I also abused other functions and <code>#define</code>s. This header is mutually exclusive
|
||
with <code>-std=c11</code>.</p>
|
||
<p>The program was developed with little-endian machines; I tried to support
|
||
big-endian too, but this support is somewhat limited.</p>
|
||
<p>This program has been compiled with:</p>
|
||
<ol type="1">
|
||
<li>i386 (Debian Stretch) with gcc and clang</li>
|
||
<li>amd64 (Debian Buster) with gcc and clang</li>
|
||
<li>Raspberry Pi 3 (Debian stretch) with gcc and clang</li>
|
||
<li>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)</li>
|
||
</ol>
|
||
<h3 id="extra-notes-from-the-judges-on-the-macos-terminal.app-problems">Extra notes from the judges on the macOS Terminal.app problems:</h3>
|
||
<p>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.</p>
|
||
<h3 id="warnings-and-restrictions-required-by-law">Warnings and restrictions required by law:</h3>
|
||
<p>Please do not feed little babies chocolate.</p>
|
||
<h3 id="major-spoilers">Major spoilers:</h3>
|
||
<p>I incorporated the <a href="https://en.wikipedia.org/wiki/Fletcher%27s_checksum">Fletcher 16 checksum
|
||
algorithm</a> into the source
|
||
for security reasons; it might be challenging to make changes without breaking
|
||
the main functionality of the code.</p>
|
||
<p>The space after <code>#define p return</code> is necessary.</p>
|
||
<p>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.</p>
|
||
<h3 id="some-obfuscation-techniques-used">Some obfuscation techniques used:</h3>
|
||
<ol type="1">
|
||
<li>I tried to use meaningless or misleading variable names. For example, this
|
||
program draws the Big Dipper with the correct colors, but variables like <code>o</code>,
|
||
<code>b</code>, and <code>a</code> are used in totally unrelated tasks.</li>
|
||
<li>I reused and recycled variables almost every time when possible.</li>
|
||
<li>Unnecessary use of predefined stuff like <code>__ATOMIC_SEQ_CST</code>.</li>
|
||
<li>When I was a kid, my favorite programming language was Pascal. In Pascal,
|
||
there are things like <code>begin;</code> and <code>end;</code> instead of curly brackets. They are
|
||
used also in my code, but I had to shorten them to meet size requirements.</li>
|
||
<li>I also have strong Perl background, and therefore I added some dollar signs
|
||
to the code. One of the first ideas was to write all variables with prefixed
|
||
<code>$</code>, but then I rejected it.</li>
|
||
</ol>
|
||
<p>If you think you understand how this program works, can you answer these
|
||
questions:</p>
|
||
<ol type="1">
|
||
<li>What is the value of <code>aI_</code> after line 21?</li>
|
||
<li>Why are there some big numbers on line 47?</li>
|
||
<li>How is the scaling effect created?</li>
|
||
<li>How do you change a single bit, without changing the functionality?</li>
|
||
</ol>
|
||
<h3 id="rot18-part">Rot18 part</h3>
|
||
<p>Because the rot13 is too easy to decode with the plain eyes, I decided to use
|
||
the <a href="https://en.wikipedia.org/wiki/Caesar_cipher">Caesar cipher</a> with the key
|
||
18:</p>
|
||
<pre><code> Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv
|
||
gfdq gf dalldw-wfvasf esuzafwk.</code></pre>
|
||
<p>If you want to or must know and don’t know how to decipher this, you might look
|
||
at the <a href="https://www.dcode.fr/caesar-cipher">Caesar cipher decoder</a>. Find the
|
||
text that says:</p>
|
||
<pre><code> Manual decryption and parameters
|
||
Shift/Key (number)</code></pre>
|
||
<p>and enter 18 and then click the button that says: <code>DECRYPT (BRUTEFORCE)</code>.</p>
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<h1 id="inventory-for-2018poikola"><a name="inventory"></a>Inventory for 2018/poikola</h1>
|
||
<p><a href="#top">Jump to top</a></p>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/prog.c">prog.c</a> - entry source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/prog.orig.c">prog.orig.c</a> - original source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/try.sh">try.sh</a> - how to run</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/poikola.tex">poikola.tex</a> - supplied documentation</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/prog-doc.c">prog-doc.c</a> - minor change to entry source</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2018_poikola.tar.bz2">2018_poikola.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="index.html">index.html</a> - this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/README.md">README.md</a> - markdown source for this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/.path">.path</a> - directory path from top directory</li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
<h2><a name="copyright"></a>Copyright and CC BY-SA 4.0 License</h2>
|
||
<p>All IOCCC content including this file and web page are:</p>
|
||
<b> Copyright © 1984-2024 by Landon Curt Noll. <a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean">Some Rights Reserved</a>.</b>
|
||
<p>This work is licensed by Landon Curt Noll under:</p>
|
||
<p xmlns:cc="http://creativecommons.org/ns#" ><b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
|
||
target="_blank" rel="license noopener noreferrer" style="display:inline-block;"> CC BY-SA 4.0
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/cc.png"
|
||
alt="cc inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/by.png"
|
||
alt="person inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/sa.png"
|
||
alt="arrow looping back on itself inside circle symbol">
|
||
</a></b></p>
|
||
<p>The <b>CC BY-SA 4.0 LEGAL CODE</b> for this license is found under:</p>
|
||
<p> <b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en">
|
||
https://creativecommons.org/licenses/by-sa/4.0/legalcode.en</a></b></p>
|
||
<p>You should <b>carefully review</b> all of the terms and conditions of the
|
||
<a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en">actual license</a>
|
||
before using the licensed material.</p>
|
||
<p>You may wish to review the <b><a href="../../license.html">highlights of some of the key
|
||
features and terms</a></b> of the <a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en">actual license</a>.</p>
|
||
<h2>Coda</h2>
|
||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2018%2Fpoikola%2Findex.html">Nu HTML check this web page</a></p>
|
||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|