This is a large update that modifies every .entry.json file and fixes
many others. The changes of every .entry.json file are as follows:
- change 'entry source' to 'entry source code' [0]
- change 'original source' to 'original source code' [0]
- change 'directory path from top directory' to 'directory path from top
level directory'
[0] This is for consistency purposes. Other options were pondered but as
the index.html files refer to 'Alternate code' this was the simplest way
to go about it and it also feels more natural. A question was whether to
have 'entry code' and 'original entry code' or to have the word 'source'
added to it but I decided upon including the word 'source'. Another
question has occurred to me is whether or not 'original source code'
should instead be 'original entry source code' but that can be decided
upon later as that occurred to me after much of the files were already
rebuilt. The consistency that this commit has made is for the README.md
sections and in particular 'Alternate code'. One might wonder if that
should be changed to 'Alternate source code' as now the manifest
includes 'source' in the 'entry code' and 'original code' but the
manifest itself is what was actually updated and having 'source' feels
more natural for submitted files. After all not all entries have
alternate code. These questions can be decided on when looking at the
index.html files that have been rebuilt.
Changed 'alt code' to 'alternate code' where this was not already done
(in the manifest). It is questionable whether this should be done in
markdown files or not (in the README.md files section it already is done
but not necessarily in other places).
Many files had incorrect descriptions that have been checked.
Renamed 2020/endoh2/spoiler/spoiler.{md,html} to index.{md,html} so one
can go to just 2020/endoh2/spoiler and see the web page. Although the
manifest of 2 020/endoh2/index.html will link to it and that's probably
how most people will notice it it seems useful especially as the web
page links to the different files in spoiler/ or at least refers to
them, giving a description (kind of like the manifest in
2020/endoh2/index.html).
Due to the above changes all the entries had their index.html files
regenerated too.
There were likely other changes and fixes as well.
What has NOT been done is a check over all items, typos or otherwise,
though some typos have been fixed. Nonetheless this commit goes a long
way to resolving issue #1933.
Updated thanks file both with a missing <div> id and added a manifest
improvements section as the manifest is quite important.
650 lines
27 KiB
HTML
650 lines
27 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">
|
||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>2011/zucker - Most shiny</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2011 IOCCC entry zucker - Most shiny">
|
||
<meta name="keywords" content="IOCCC, 2011, IOCCC 2011, IOCCC entry, zucker, Most shiny">
|
||
</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: 2011/zucker/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2011/zucker/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2011/zucker/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2011/zucker/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/topbar.default.html -->
|
||
|
||
<div class="theader">
|
||
<nav class="topbar">
|
||
<div class="container">
|
||
<div class="logo">
|
||
<a href="../../index.html" class="logo-link">
|
||
IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="topbar-items">
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Entries
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../years.html" class="sub-item-link">
|
||
Winning Entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../authors.html" class="sub-item-link">
|
||
People who have won
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../location.html" class="sub-item-link">
|
||
Location of authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../bugs.html" class="sub-item-link">
|
||
Bugs & (Mis)features
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Status
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../news.html" class="sub-item-link">
|
||
IOCCC News
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../status.html" class="sub-item-link">
|
||
Contest status
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/index.html" class="sub-item-link">
|
||
Rules & Guidelines
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
FAQ
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html" class="sub-item-link">
|
||
FAQ
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#submit" class="sub-item-link">
|
||
How to enter the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
|
||
Fixing IOCCC entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_web_site" class="sub-item-link">
|
||
Fixing the web site
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_author" class="sub-item-link">
|
||
Fixing author info
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
About
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../index.html" class="sub-item-link">
|
||
IOCCC Home
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../judges.html" class="sub-item-link">
|
||
The IOCCC Judges
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../contact.html" class="sub-item-link">
|
||
Contacting the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../thanks-for-help.html" class="sub-item-link">
|
||
Thanks for the help
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="header-mobile-menu">
|
||
<noscript>
|
||
<a href="../../nojs-menu.html" class="topbar-js-label">
|
||
Please Enable JavaScript
|
||
</a>
|
||
</noscript>
|
||
|
||
<button id="header-open-menu-button" class="topbar-mobile-menu">
|
||
<img
|
||
src="../../png/hamburger-icon-open.png"
|
||
alt="hamburger style menu icon - open state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<button id="header-close-menu-button" class="hide-content">
|
||
<img
|
||
src="../../png/hamburger-icon-closed.png"
|
||
alt="hamburger style menu icon - closed state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<div id="mobile-menu-panel" class="hide-content">
|
||
<div class="mobile-menu-container">
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
Entries
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../years.html">
|
||
Winning Entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../authors.html">
|
||
People who have won
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../location.html">
|
||
Location of authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../bugs.html">
|
||
Bugs & (Mis)features
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
|
||
<div class="mobile-menu-item">
|
||
Status
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../status.html">
|
||
Contest status
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/index.html">
|
||
Rules & Guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../news.html">
|
||
IOCCC News
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
FAQ
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html">
|
||
Frequently Asked Questions
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#submit">
|
||
How to enter the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
|
||
Fixing IOCCC entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_web_site">
|
||
Fixing the web site
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
|
||
Fixing author info
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
About
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../index.html">
|
||
IOCCC Home
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../judges.html">
|
||
The IOCCC Judges
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../contact.html">
|
||
Contacting the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
|
||
Thanks for the help
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
|
||
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
|
||
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
|
||
|
||
headerOpenMenuButton.addEventListener("click", () => {
|
||
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.add("hide-content");
|
||
|
||
headerCloseMenuButton.classList.remove("hide-content");
|
||
headerCloseMenuButton.classList.add("topbar-mobile-menu");
|
||
|
||
mobileMenuPanel.classList.remove("hide-content");
|
||
mobileMenuPanel.classList.add("topbar-mobile-panel");
|
||
});
|
||
|
||
headerCloseMenuButton.addEventListener("click", () => {
|
||
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerCloseMenuButton.classList.add("hide-content");
|
||
|
||
mobileMenuPanel.classList.add("hide-content");
|
||
mobileMenuPanel.classList.remove("topbar-mobile-panel");
|
||
|
||
headerOpenMenuButton.classList.add("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.remove("hide-content");
|
||
});
|
||
</script>
|
||
|
||
<!-- END: this line ends content from: inc/topbar.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<a href="../../2011/zucker/index.html">
|
||
<img src="../../png/ioccc.png"
|
||
alt="IOCCC image by Matt Zucker"
|
||
width=300
|
||
height=110>
|
||
</a>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>2011/zucker - Most shiny</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/navbar.last.html -->
|
||
|
||
<div class="navbar">
|
||
<a class="Left" href="../vik/index.html">← vik</a>
|
||
<a class="Left" href="../index.html">↑ 2011 ↑</a>
|
||
<a class="Left Disabled" href="#">last entry</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/zucker.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2011%2Fzucker%2Findex.html">✓</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/navbar.last.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<div class="content" id="content">
|
||
|
||
<!-- 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">Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#Matt_Zucker">Matt Zucker</a><br>
|
||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</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 -->
|
||
|
||
<!-- BEFORE: 1st line of markdown file: 2011/zucker/README.md -->
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make</code></pre>
|
||
<p>There is an alternate version which should work for Windows which distinguishes
|
||
binary mode from text mode. See <a href="#alternate-code">alternate code</a> below.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<pre><code> ./zucker > image.ppm</code></pre>
|
||
<p>Now open <code>image.ppm</code> with your image viewer of choice.</p>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> ./try.sh</code></pre>
|
||
<p>After running <code>try.sh</code>, open the PPM images <code>ioccc.ppm</code>, <code>hello.ppm</code> and
|
||
<code>image2.ppm</code> with your image viewer of choice.</p>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<p>This version uses the Windows functions <code>_setmode()</code> and <code>_fileno()</code> to set
|
||
binary mode on <code>stdout</code> which the author noted would be necessary for systems
|
||
that distinguish binary and text.</p>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<pre><code> make alt</code></pre>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<p>Use <code>zucker.alt</code> as you would <code>zucker</code> above.</p>
|
||
<h3 id="alternate-try">Alternate try:</h3>
|
||
<p>Try <code>zucker.alt</code> instead of <code>zucker</code> above.</p>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>The rendered image is centered and is output as a 600 by 220 pixel PPM.
|
||
The vector font is proportional.</p>
|
||
<p>This entry uses no local variables. None! At! All!</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="an-image-generator">An image generator</h3>
|
||
<h4 id="what-it-does">What it does:</h4>
|
||
<p>This program makes pretty pictures. To see the default output, try
|
||
running</p>
|
||
<pre><code> ./zucker > ioccc2011.ppm</code></pre>
|
||
<p>On the author’s 2.5 GHz MacBook Pro, this command takes approximately 1 minute
|
||
and 18 seconds to run – your runtime may vary. You will need an image viewer
|
||
capable of displaying <a href="https://en.wikipedia.org/wiki/Netpbm">Netpbm images</a> in
|
||
order to display the output. On the Mac, the system supplied <code>Preview.app</code> works
|
||
well; otherwise <a href="http://www.imagemagick.org/">ImageMagick</a> and/or
|
||
<a href="http://www.graphicsmagick.org/">GraphicsMagick</a> are both capable of displaying
|
||
Netpbm files, and are available on multiple platforms.</p>
|
||
<p>With macOS you can type at the command line:</p>
|
||
<pre><code> open ioccc2021.ppm</code></pre>
|
||
<p>and it will open image in the default application Preview.app.</p>
|
||
<p>To use ImageMagick you might do something like:</p>
|
||
<pre><code> convert ioccc2011.ppm ioccc2011.png</code></pre>
|
||
<p>and then open <code>ioccc2011.png</code> in your viewer of choice.</p>
|
||
<p>To use GraphicsMagick you might do something like:</p>
|
||
<pre><code> gm convert ioccc2011.ppm ioccc2011.png</code></pre>
|
||
<p>and then open <code>ioccc2011.png</code> in your viewer of choice.</p>
|
||
<p>Aside from the default image, you may create your own by running the
|
||
program as follows:</p>
|
||
<pre><code> ./zucker "your text" > image.ppm</code></pre>
|
||
<p>To mitigate long runtime, the program can be invoked in a “preview”
|
||
mode by appending <code>-preview</code> to the command line arguments, like so:</p>
|
||
<pre><code> ./zucker faster\! -preview > image.ppm</code></pre>
|
||
<p>If your platform distinguishes between binary and text streams, you may need to
|
||
insert some code to reopen standard output in binary mode at the start of
|
||
<code>main()</code> (the provided <a href="#alternate-code">alternate version</a> will set binary mode
|
||
on <code>stdout</code> in Windows). An ASCII platform is assumed.</p>
|
||
<h4 id="pedagogical-value">Pedagogical value:</h4>
|
||
<p>This program is quite suitable for the inexperienced programmer, due
|
||
to a number of considerations:</p>
|
||
<ul>
|
||
<li><p>It is fairly short: just 4 preprocessor directives followed by 29
|
||
lines of source.</p></li>
|
||
<li><p>It compiles cleanly as ANSI C under gcc 4.2.1 with very strict
|
||
compilation flags.</p></li>
|
||
<li><p>It uses a very small subset of the keywords available in C, namely
|
||
<code>char</code>, <code>float</code>, <code>int</code>, <code>typedef</code>, <code>struct</code>, <code>for</code>, and <code>return</code>.
|
||
More difficult concepts such as <code>void</code>, <code>if</code>, <code>switch</code>, and
|
||
<code>while</code> are eschewed for simplicity’s sake.</p></li>
|
||
<li><p>It also uses a very small number of library functions: just <code>putchar(3)</code>,
|
||
<code>cos(3)</code>, <code>sin(3)</code>, <code>atan2(3)</code>, <code>sqrt(3)</code>, and <code>pow(3)</code>.</p></li>
|
||
<li><p>New programmers often prefer to use global variables when
|
||
possible. Hence, <em>all</em> variables in this program (aside from
|
||
function parameters) have global scope.</p></li>
|
||
<li><p>An important aspect of the computation is graphically illustrated
|
||
by the source code itself: the geometric construction of a
|
||
reflection ray at an object’s surface, given the incoming
|
||
direction and surface normal.</p></li>
|
||
</ul>
|
||
<h4 id="further-details-contains-spoilers">Further details (contains spoilers):</h4>
|
||
<p>The program is not quite a traditional <a href="https://en.wikipedia.org/wiki/Ray_tracing_(graphics)">ray
|
||
tracer</a>, but a “<a href="sphere-tracing.pdf">sphere
|
||
tracer</a>” which uses distance fields to encode proximity to
|
||
objects in the scene. Using sphere tracing to compute visibility instead of
|
||
analytic ray tracing provides two advantages: first, it greatly eases the
|
||
computation of <a href="https://en.wikipedia.org/wiki/Toric_lens#Torus">ray-torus</a>
|
||
intersection (which would otherwise require solving a quartic polynomial), and
|
||
second, it makes it possible to compute <a href="https://en.wikipedia.org/wiki/Ambient_occlusion">ambient
|
||
occlusion</a> (which is used to
|
||
generate soft shadows). Unlike many traditional ray tracers and sphere tracers,
|
||
this one uses iteration instead of recursion to compute the effect of
|
||
reflections. This, unfortunately, resulted in the programmer going insane;
|
||
however, program size was reduced and readability hindered. Neither the
|
||
plaintext for the program’s default output nor for the Netpbm header appears in
|
||
the program source, which hinders readability as well. Also, unlike some
|
||
previous IOCCC entries which render ASCII text, this one uses a vector (as
|
||
opposed to raster) font. Although the program does not generate uppercase
|
||
letters, it handles them in a reasonable manner when they appear in the input.</p>
|
||
<p>Even when the program is pretty-printed and preprocessor macros are
|
||
translated, it should be fairly resistant to analysis due to reckless
|
||
reuse of global variables, the inherently opaque nature of the
|
||
math, and its overall density. Global variables are used to store
|
||
the results of intermediate computation. As a result, seemingly simple
|
||
functions have important side effects. Although some of the global
|
||
variables are simply constants, their use is overloaded. For instance,
|
||
the variable <code>X</code> is used both as the number <code>40</code> and as the ASCII
|
||
character <code>'('</code>. Maintainability is hindered due to hardcoding
|
||
several aspects of the program in multiple locations. As an example,
|
||
it is impossible to modify either the image width or height without
|
||
changing the source in at least three different places, including
|
||
inside the large string literal <code>J</code>.</p>
|
||
<p>Some of the functions are simple vector algebraic operations such as
|
||
vector construction, dot product, and normalization. However, it was
|
||
found to be much more compact to define a single operation for
|
||
multiply-and-add rather than to have separate functions for addition,
|
||
subtraction, and scaling. Again, compactness led to obfuscation.</p>
|
||
<p>This program heavily abuses <code>for</code> loops. The comma operator is used to
|
||
get as much mileage as possible out of statements inside of loop
|
||
declarations. Between <code>for</code> loops, the comma operator, and the ternary
|
||
operator, it was possible to avoid <code>if</code> and <code>while</code> altogether.</p>
|
||
<p>Bitwise and arithmetic operators are used instead of logical operators whenever
|
||
gcc doesn’t warn about it. Conversely, integer multiplication, division, and
|
||
modulus are sometimes used in place of traditional bitwise operators just to
|
||
keep the reader on his or her toes. Automatic casting between characters,
|
||
integers, and floats is performed just about everywhere. Fascinatingly, this
|
||
doesn’t seem to affect performance too badly. Sometimes when an explicit cast
|
||
(i.e. from <code>float</code> to <code>int</code>) is needed, the program instead simply assigns to a
|
||
free variable of the desired type instead. Both the <code>array[index]</code> and
|
||
<code>index[array]</code> notations are used interchangeably throughout the program.</p>
|
||
<p>Two other programs were written to support development of this program. The
|
||
first used a randomized search algorithm to deduce the most compact encoding of
|
||
the vector font instructions into ASCII; the second used a modified form of the
|
||
<a href="https://en.wikipedia.org/wiki/Line_wrap_and_word_wrap">Knuth-Plass</a> algorithm
|
||
to layout the final text on top of a hand-generated ASCII “stencil”. The
|
||
programs were not submitted as entries for this year’s IOCCC, not because they
|
||
lack obfuscation, but because neither is written in C (they are in C++ and
|
||
Python, respectively).</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/
|
||
|
||
-->
|
||
<!-- AFTER: last line of markdown file: 2011/zucker/README.md -->
|
||
|
||
<!-- 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 -->
|
||
|
||
<div id="inventory">
|
||
<h1 id="inventory-for-2011zucker">Inventory for 2011/zucker</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/zucker.c">zucker.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/zucker.alt.c">zucker.alt.c</a> - alternate source code</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/zucker.orig.c">zucker.orig.c</a> - original source code</li>
|
||
<li><a href="sphere-tracing.pdf">sphere-tracing.pdf</a> - research paper on antialiased ray tracing</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/try.sh">try.sh</a> - script to try entry</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2011_zucker.tar.bz2">2011_zucker.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/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/2011/zucker/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/zucker/.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/2011/zucker/.path">.path</a> - directory path from top level directory</li>
|
||
<li><a href="index.html">index.html</a> - this web page</li>
|
||
</ul>
|
||
<hr style="width:10%;text-align:left;margin-left:0">
|
||
<h4>
|
||
Jump to: <a href="#">top</a>
|
||
</h4>
|
||
|
||
<!-- 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 -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/after-content.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">
|
||
|
||
<div id="copyright"><h3>Copyright © 1984-2024 by Landon Curt Noll:
|
||
<a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">Some Rights Reserved</a></h3>
|
||
<p>This work is licensed by Landon Curt Noll under
|
||
<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</a></b>.
|
||
<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"></p>
|
||
<p>You should <b>carefully review</b> the
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">CC BY-SA 4.0 LEGAL CODE</a></b>
|
||
before using the licensed material.</p>
|
||
<p>You may wish to review the
|
||
<b><a href="../../license.html"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">highlights of some of the key features and terms</a></b>.</p>
|
||
</div>
|
||
|
||
<div id="coda"><h3>Coda</h3>
|
||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2011%2Fzucker%2Findex.html" rel="nofollow">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>
|
||
|
||
</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 -->
|