The navigation bar for a winning entry now has a "_Original C_" link
(between the ✅ and the Inventory on the right hand side) so that one
may easily view the original C code that was submitted for IOCCC judging.
Ran `make www timestamp` to perform the above.
779 lines
32 KiB
HTML
779 lines
32 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>2006/stewart - Best computed graphics</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2006 IOCCC entry stewart - Best computed graphics">
|
||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC entry, stewart, Best computed graphics">
|
||
</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: 2006/stewart/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2006/stewart/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2006/stewart/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2006/stewart/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">
|
||
Winning authors
|
||
</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 and (mis)features
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
|
||
Fixing entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_author" class="sub-item-link">
|
||
Updating author info
|
||
</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">
|
||
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/rules.html" class="sub-item-link">
|
||
IOCCC rules
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/guidelines.html" class="sub-item-link">
|
||
IOCCC guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../markdown.html" class="sub-item-link">
|
||
Markdown guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../SECURITY.html" class="sub-item-link">
|
||
Security policy
|
||
</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">
|
||
Frequently asked questions
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../quick-start.html#enter" class="sub-item-link">
|
||
Enter the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#compiling" class="sub-item-link">
|
||
Compiling entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#running_entries" class="sub-item-link">
|
||
Running entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#help" class="sub-item-link">
|
||
How to help
|
||
</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">
|
||
Home page
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../social.html" class="sub-item-link">
|
||
IOCCC social media
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../about.html" class="sub-item-link">
|
||
About the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../judges.html" class="sub-item-link">
|
||
The judges
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../thanks-for-help.html" class="sub-item-link">
|
||
Thanks for the help
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../contact.html" class="sub-item-link">
|
||
Contact us
|
||
</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">
|
||
Winning authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../location.html">
|
||
Location of authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../bugs.html">
|
||
Bugs and (mis)features
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
|
||
Fixing entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
|
||
Updating author info
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
|
||
Thanks for the help
|
||
</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="../../news.html">
|
||
News
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../status.html">
|
||
Contest status
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/rules.html">
|
||
IOCCC rules
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/guidelines.html">
|
||
IOCCC guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../markdown.html">
|
||
Markdown guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../SECURITY.html">
|
||
Security policy
|
||
</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="../../quick-start.html#enter">
|
||
Enter the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#compiling">
|
||
Compiling entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#running_entries">
|
||
Running entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#help">
|
||
How to help
|
||
</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">
|
||
Home page
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../social.html">
|
||
IOCCC social media
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../about.html">
|
||
About the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../judges.html">
|
||
The judges
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../contact.html">
|
||
Contact us
|
||
</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>2006/stewart - Best computed graphics</h2>
|
||
<h3>IFS fractal generator</h3>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/navbar.mid.html -->
|
||
|
||
<div class="navbar">
|
||
<a class="Left" href="../sloane/index.html">← 2006/sloane</a>
|
||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||
<a class="Left" href="../sykes1/index.html">2006/sykes1 →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/stewart.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/stewart.orig.c">Original C</a>
|
||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2006%2Fstewart%2Findex.html">✓</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/navbar.mid.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#Thomas_Stewart">Thomas Stewart</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: 2006/stewart/README.md -->
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make</code></pre>
|
||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||
<p>The current status of this entry is:</p>
|
||
<blockquote>
|
||
<p><strong>STATUS: INABIAF - please DO NOT fix</strong></p>
|
||
</blockquote>
|
||
<p>For more detailed information see <a href="../../bugs.html#2006_stewart">2006/stewart in bugs.html</a>.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<pre><code> ./stewart width_and_height iterations file > file.xbm
|
||
convert file.xbm file.png</code></pre>
|
||
<p>where <code>file</code> is one of:</p>
|
||
<blockquote>
|
||
<p>altar box box2 box3 build carpet<br>
|
||
circles cross cross2 cross3 crystal<br>
|
||
curve diamonds diamonds2 dragon<br>
|
||
dragon2 dragon3 fern gasket gasket_mod<br>
|
||
gasket_mod2 ioccc maze octagon pentagon<br>
|
||
pentagons rings rings2 spirals spirals2<br>
|
||
spirals3 spirals4 squares stars stars2<br>
|
||
tree tree2 tree3 tree4 triangle</p>
|
||
</blockquote>
|
||
<p><strong>NOTE</strong>: you cannot specify a different width from height; it’s one number.</p>
|
||
<p><strong>NOTE</strong>: <code>convert(1)</code> belongs to <a href="https://imagemagick.org/index.php">ImageMagick</a>.</p>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> ./try.sh</code></pre>
|
||
<p>After running the program on a few files it will ask you if you wish to run it
|
||
on the remaining files.</p>
|
||
<p>The script will try converting the xbm files created by the program to png
|
||
files. If it does it will list those that exist in the directory, at the end of
|
||
the script. If you do not have <code>convert(1)</code> it will warn you once. In that case
|
||
you’ll have to open the xbm files in a graphics viewer capable of viewing xbm
|
||
images. In any case choose your favourite graphics viewer to look at the images
|
||
created.</p>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>Note the interesting choice of using a <code>#define</code> in the output.
|
||
The selection of input files makes this one endlessly fun to play
|
||
with. Many image viewers will be able to read the results, as will
|
||
a reasonably experienced user who can parse formats in their mind. :-)</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="execution">Execution</h3>
|
||
<p>The program should be run with the following</p>
|
||
<pre><code> ./stewart <m> <n> <ifs></code></pre>
|
||
<p>where:</p>
|
||
<ul>
|
||
<li><code>m</code>
|
||
<ul>
|
||
<li>The size of the picture (picture will be m X m in size).</li>
|
||
</ul></li>
|
||
<li><code>n</code>
|
||
<ul>
|
||
<li>The number of iterations to run (More will make for a clearer picture).</li>
|
||
</ul></li>
|
||
<li><code>ifs</code>
|
||
<ul>
|
||
<li>The file to use as input.</li>
|
||
</ul></li>
|
||
</ul>
|
||
<p>The program will spit out an <a href="https://en.wikipedia.org/wiki/X_BitMap">XBM image</a>
|
||
on standard out. Minimal checking is done on the arguments mainly that there
|
||
are 3. Wrong arguments will cause the program to bomb out.</p>
|
||
<h4 id="example">Example:</h4>
|
||
<pre><code> ./stewart 1024 1000000 gasket > gasket.xbm</code></pre>
|
||
<h3 id="compilationtesting">Compilation/Testing</h3>
|
||
<p>The program compiles without warning with <code>gcc -ansi -Wall</code>.
|
||
<code>lint</code> also seems to like the code. This must be a bug in <code>lint</code>.</p>
|
||
<p>The program was tested on Linux on a x86 and NetBSD on an alpha.
|
||
Only gcc was tested for compilers (4.0.3 and 3.3.3).</p>
|
||
<h3 id="entry-originality">Entry originality</h3>
|
||
<p>In looking through past winning entries, there seem to be only 2 (92 and 94) that
|
||
generated fractals. Both of those were <a href="https://en.wikipedia.org/wiki/Julia_set">Julia
|
||
fractals</a> from the <a href="https://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot
|
||
set</a>. Those do make for some
|
||
pretty pictures. I figured it would be nice to add some more fractals to the
|
||
IOCCC, since one hasn’t won since 1994.</p>
|
||
<p>Instead of something that has already won I figured I would go with
|
||
another kind of fractal, those from the IFS:
|
||
<a href="https://en.wikipedia.org/wiki/Iterated_function_system">Iterated Function System</a>.</p>
|
||
<h3 id="input-file">Input File</h3>
|
||
<p>The format of the input file is as follows:</p>
|
||
<pre><code> <num ifs> <x min> <y min> <x max> <y max>
|
||
<a> <b> <c> <d> <e> <f> <p>
|
||
<a> <b> <c> <d> <e> <f> <p>
|
||
<a> <b> <c> <d> <e> <f> <p>
|
||
.
|
||
.
|
||
.</code></pre>
|
||
<p>This file describe an IFS.</p>
|
||
<p>One of the most well known would be the <a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/gasket">Sierpinski Gasket</a>:</p>
|
||
<pre><code> 3 0 0 1 1
|
||
.5 0 0 .5 0 0 .33
|
||
.5 0 0 .5 .5 0 .33
|
||
.5 0 0 .5 .25 .433 .34</code></pre>
|
||
<p>or the <a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/fern">fern</a>:</p>
|
||
<pre><code> 4 -5.5 0 5.5 11
|
||
0 0 0 .16 0 0 .01
|
||
.85 .04 -.04 .85 0 1.6 .85
|
||
.2 -.26 .23 .22 0 1.6 .07
|
||
-.15 .28 .26 .24 0 .44 .07</code></pre>
|
||
<p>etc…</p>
|
||
<p>Included in my submission will be a tarball of some IFS files,
|
||
including one that attempts (not very well) to mimic the IOCCC logo
|
||
(I figure it can’t hurt to attempt to suck up, right?).</p>
|
||
<p>(<strong>NOTE from Judges</strong>: we extracted the files.)</p>
|
||
<p>I would try to explain how to create an IFS file but I am not smart
|
||
enough to condense it down to something that is coherent.</p>
|
||
<p>Basically the break down is:</p>
|
||
<p><code>num</code> is the number of equations in the <code>IFS</code>.
|
||
<code>x</code> (min, max) and <code>y</code> (min, max) define the ranges that will be displayed
|
||
in the XBM image file.</p>
|
||
<p>The <code>a b c d e f</code> are used to iterative find points that lie in the IFS
|
||
from the algorithm</p>
|
||
<pre><code> x = a * prevx + b * prevy + e;
|
||
y = c * prevx + d * prevy + f;</code></pre>
|
||
<p>The <code>p</code> is for the probability that the equation will run.</p>
|
||
<h3 id="obfuscations">Obfuscations</h3>
|
||
<p>The main obfuscation is using a <code>void *</code> as my only variable (aside from
|
||
the args for <code>main()</code>). This causes me to do much casting and pointer
|
||
arithmetic to get the correct location and completely does away with
|
||
any meaning the variables could have. This also makes the code more
|
||
convenient to read in the current form vs preprocessed. After
|
||
preprocessing there will be almost 300 casts in the code and I believe
|
||
they are all needed… (I would double check but my brain is kinda
|
||
mushy right now from chasing down a segfault in the code.)</p>
|
||
<p>The other main obfuscation being that it generates an <code>IFS</code>. Which isn’t
|
||
all that common for a program to do. I mean google only has something
|
||
like 66,000 hits for “Iterated function system” so that means it is
|
||
obscure, right?</p>
|
||
<h3 id="some-other-minor-obfuscations">Some other minor obfuscations</h3>
|
||
<p>Since I formatted it as a “normal” program I did inject something that
|
||
on first glance will looks like a possible bug. (When you run it through
|
||
a C-beautifier this will be removed.)</p>
|
||
<p>I decided not to use <code>rand()</code> to generate a pseudo-random number. Instead
|
||
I use XOR and bit shifting.</p>
|
||
<p>The input file is used to make the program flexible and to allow it to
|
||
generate many different <code>IFS</code>s. This has the added bonus of hiding
|
||
information about the algorithm.</p>
|
||
<p>The use of many magic numbers. I figured if I get yelled about them in
|
||
a review they must be bad, right?</p>
|
||
<h3 id="silly-things">Silly things</h3>
|
||
<p>The use of decimal numbers where one would expect hex. Octal numbers
|
||
where one would expect decimal. Shifts instead of divides.</p>
|
||
<p>Using xbm as the output format. This might confuse someone who doesn’t
|
||
have an X background. It happens to be easy but is probably a very bad
|
||
choice from a file size standpoint. 1024x1024 image is 641k in size.</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: 2006/stewart/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-2006stewart">Inventory for 2006/stewart</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/stewart.c">stewart.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/stewart.orig.c">stewart.orig.c</a> - original source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/build">build</a> - how to compile</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/try.sh">try.sh</a> - script to try entry</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/altar">altar</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/box2">box2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/box3">box3</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/box">box</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/carpet">carpet</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/circles">circles</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/cross2">cross2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/cross3">cross3</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/cross">cross</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/crystal">crystal</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/curve">curve</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/diamonds2">diamonds2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/diamonds">diamonds</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/dragon2">dragon2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/dragon3">dragon3</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/dragon">dragon</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/fern">fern</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/gasket">gasket</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/gasket_mod2">gasket_mod2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/gasket_mod">gasket_mod</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/ioccc">ioccc</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/maze">maze</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/octagon">octagon</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/pentagon">pentagon</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/pentagons">pentagons</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/rings2">rings2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/rings">rings</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/spirals2">spirals2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/spirals3">spirals3</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/spirals4">spirals4</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/spirals">spirals</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/squares">squares</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/stars2">stars2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/stars">stars</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/tree2">tree2</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/tree3">tree3</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/tree4">tree4</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/tree">tree</a> - sample input</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/triangle">triangle</a> - sample input</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2006_stewart.tar.bz2">2006_stewart.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/README.md">README.md</a> - markdown source for this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2006/stewart/.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.inventory.html -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2025 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-2025 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 <b>licensed by Landon Curt Noll</b> 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"><br>
|
||
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.<br>
|
||
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>
|
||
of <b>CC BY-SA 4.0</b>.<br>
|
||
</p>
|
||
</div>
|
||
|
||
<div id="coda"><h3>Coda</h3>
|
||
<p>
|
||
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2006%2Fstewart%2Findex.html" rel="nofollow">Nu HTML check this web page</a><br>
|
||
<a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a><br>
|
||
</p>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.inventory.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|