Prepare for the winners of **IOCCC28**. > However these are not the 2024 droids you are looking for. :-) The HTML menu (both JavaScript and non-JavaScript) has been updated. The `Status -> Rules and guidelines' have been replaced with two separate menus `Status -> IOCCC rules` and `Status -> IOCCC guidelines`. Added a new top level `social.html` page: built from a new `social.md`. Sorted rules for building specific web pages in the top level `Makefile`. Added `make social` to make the `social.html` page from `social.md`. The `bin/gen-top-html.sh` now is able to process a argument of **social** to process the new top level `social.html` page. Changed `bin/gen-top-html.sh` VERSION from "2.0.0 2025-03-13" to "2.0.1 2025-07-25". Below `About -> Home page` a new `About -> IOCCC social media` menu item as added. Because the menu change touched every HTML file, we changed the general copyright date range for HTML files from "1984-2024" to "1984-2025" due to the extensive changes made for **IOCCC28**. Those markdown files that were modified in 2025 had their copyright date range also changed from "1984-2024" to "1984-2025". Rebuilt tarballs and sitemap due to the extensive HTML rebuilding. Ran `make update` to perform the above.
753 lines
30 KiB
HTML
753 lines
30 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>2004/jdalbec - Best abuse of the periodic table</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2004 IOCCC entry jdalbec - Best abuse of the periodic table">
|
||
<meta name="keywords" content="IOCCC, 2004, IOCCC 2004, IOCCC entry, jdalbec, Best abuse of the periodic table">
|
||
</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: 2004/jdalbec/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2004/jdalbec/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2004/jdalbec/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2004/jdalbec/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>2004/jdalbec - Best abuse of the periodic table</h2>
|
||
<h3>Conway's look'n'say sequence split into elements</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="../hoyle/index.html">← 2004/hoyle</a>
|
||
<a class="Left" href="../index.html">↑ 2004 ↑</a>
|
||
<a class="Left" href="../kopczynski/index.html">2004/kopczynski →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/jdalbec.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2004%2Fjdalbec%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#John_Dalbec">John Dalbec</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: 2004/jdalbec/README.md -->
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make</code></pre>
|
||
<p>There is an alternate version that allows one to control the number of numbers
|
||
to print on a line. See <a href="#alternate-code">Alternate code</a> below.</p>
|
||
<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#2004_jdalbec">2004/jdalbec in bugs.html</a>.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<pre><code> ./jdalbec number ...</code></pre>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> ./try.sh</code></pre>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<p>This version lets you control how many numbers to show on a line before adding a
|
||
newline as it can be harder to see when there are a lot of numbers. For lines
|
||
that don’t end up having too many line breaks it also makes it easier to see
|
||
which line it is on.</p>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<pre><code> make alt</code></pre>
|
||
<p>The macro <a href="https://en.wikipedia.org/wiki/Silver">Ag</a> controls how
|
||
many number of lines to print on a line. Set at default to 11 protons, salt, if
|
||
you wish to make it silver, 47 (a prime) protons, do:</p>
|
||
<pre><code> make clobber Ag=47 alt</code></pre>
|
||
<p>though it might be odd to have 47 numbers on a line as it would defeat the
|
||
purpose. :-) Or if you prefer some prime, golden irony:</p>
|
||
<pre><code> make clobber Ag=79 alt</code></pre>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<p>Use <code>jdalbec.alt</code> as you would <code>jdalbec</code> above.</p>
|
||
<h3 id="alternate-try">Alternate try:</h3>
|
||
<pre><code> ./try.alt.sh</code></pre>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>We still aren’t sure whether or not this is a useful program, but
|
||
it’s the first atomic fission we’ve seen in the IOCCC.</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<p>It’s elementary!</p>
|
||
<p>See <a href="http://mathworld.wolfram.com/LookandSaySequence.html" class="uri">http://mathworld.wolfram.com/LookandSaySequence.html</a> and
|
||
<a href="http://mathworld.wolfram.com/CosmologicalTheorem.html" class="uri">http://mathworld.wolfram.com/CosmologicalTheorem.html</a> and the references
|
||
listed there.</p>
|
||
<p>Go read the web pages and come back.</p>
|
||
<p>This program implements the <a href="https://mathworld.wolfram.com/LookandSaySequence.html">look-and-say sequence (one of the above listed
|
||
links)</a> with the added
|
||
feature that each “decay product” is automatically split into its constituent
|
||
“elements” separated by spaces. Furthermore, arguments passed to the program
|
||
are treated as separate elements for the purpose of computing further decay
|
||
products. (Compare the output of <code>./jdalbec 1</code>, <code>./jdalbec 11</code>, and <code>./jdalbec 1 1</code>.) This allows output lines from the program to be passed back to the
|
||
program as input (minus the initial generation number).</p>
|
||
<p>The common elements are listed in
|
||
<a href="http://mathworld.wolfram.com/CosmologicalTheorem.html">CosmologicalTheorem.html</a>.
|
||
The non-<a href="https://en.wikipedia.org/wiki/Primordial_nuclide">primordial</a>
|
||
<a href="https://en.wikipedia.org/wiki/Transuranium_element">transuranic elements</a> are
|
||
the <a href="https://en.wikipedia.org/wiki/Isotope">isotopes</a> of
|
||
<a href="https://en.wikipedia.org/wiki/Neptunium">Neptunium</a> and
|
||
<a href="https://en.wikipedia.org/wiki/Plutonium">Plutonium</a>. Isotopes of a given
|
||
<a href="https://en.wikipedia.org/wiki/Chemical_element">element</a> differ only in the
|
||
last digit. Four common elements could also be written as isotopes of these two
|
||
elements: <code>He=Np(2)</code>, <code>Li=Pu(2)</code>, <code>Ta=Np(3)</code>, <code>W=Pu(3)</code>. To get other isotopes,
|
||
just change the last digit to a number greater than 3.</p>
|
||
<p>The build file runs <a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/jdalbec.c">jdalbec.c</a> through the C preprocessor to
|
||
generate <code>jdalbec2.c</code> which is edited with <code>ed(1)</code> (NOTE: this was
|
||
changed to <code>sed(1)</code> by the judges) to correct spacing
|
||
problems caused by some preprocessors. (I know you dislike
|
||
Perl, but hopefully <code>ed(1)</code> is more common on POSIX systems than
|
||
Perl.) The build file then compiles <code>jdalbec2.c]</code> and removes the
|
||
<code>jdalbec2.c</code> file.</p>
|
||
<p>I don’t think I’m abusing the <a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/Makefile">Makefile</a> since I’m only using
|
||
147 characters including white space and the <code>#!</code> line and the
|
||
commented-out <code>-Wall -pedantic</code> options. The <a href="../rules.txt">rules for the
|
||
16th IOCCC</a> specifically allowed build files up to 521
|
||
characters long so my build file would have been well within
|
||
those limits. (What typo?)</p>
|
||
<p><code>gcc -E -Wall -pedantic</code> complains that trigraphs are present and that
|
||
<code>"pasting ... does not yield a valid processing token"</code>.</p>
|
||
<p><code>gcc -ansi -Wall -pedantic</code> complains about <code>#line</code> directives,
|
||
trigraphs, and expressions and statements that have no effect.
|
||
The last complaint is false in all but one case. Removing
|
||
the offending expressions causes some compilers to report
|
||
syntax errors because they can’t determine whether a name
|
||
refers to a variable or a type.</p>
|
||
<p>Since buffer overflows are a common security problem these
|
||
days I have stolen the idea of using a “safe” buffer API from
|
||
<code>vsftpd</code>. This means the program should never crash, right?</p>
|
||
<p>The program was tested on:
|
||
AMD K6/MMX 266MHz, Debian GNU/Linux testing “Sarge”, gcc 3.3.2
|
||
Intel 486DX 33MHz, Red Hat Linux 7.3, gcc 2.96
|
||
PowerPC Macintosh G4 Quicksilver, Mac OS X 10.3.2, gcc 3.3
|
||
PowerPC Macintosh G4 Quicksilver, Mac OS X 10.1.5, cc 2.95.2
|
||
PowerPC Macintosh Performa 5200CD, Mac OS 8.6, CodeWarrior 11
|
||
Sun SPARC Ultra 10, Solaris 8, gcc 3.2</p>
|
||
<p>Compiling on Mac OS 8.6 requires some degree of manual
|
||
intervention because Mac OS 8.6 doesn’t have shell scripting
|
||
or even a normal command prompt. The <code>CodeWarrior</code> 11 compiler
|
||
is the reason I had to use trigraphs. I have to preprocess
|
||
<code>jdalbec.c</code> without trigraphs, save the result as <code>jdalbec2.c</code>, then
|
||
compile <code>jdalbec2.c</code> with trigraphs to get the program to work.
|
||
I also have to add an include file and a function call to the
|
||
program to get a pseudo command line so I can pass arguments.
|
||
The compiler also requires function prototypes by default,
|
||
which is why I have prototypes for all my functions.</p>
|
||
<p>Compiling on Mac OS X 10.1.5 requires changing <code>??=</code> to <code>#</code> on
|
||
line 3 because the compiler doesn’t recognize <code>??=</code> as a trigraph
|
||
(which I consider a compiler bug). The initial preprocessing
|
||
step on Mac OS X 10.1.5 generates lots of errors in “smart
|
||
mode” because the “smart” preprocessor expects a valid C
|
||
program as input. The preprocessor then falls back to “basic
|
||
mode” and preprocesses <a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/jdalbec.c">jdalbec.c</a> successfully without warnings,
|
||
even when I give it the <code>-Wall -pedantic</code> options. It inserts
|
||
a lot of extra spaces into the preprocessed output which is
|
||
why I had to add the <code>ed(1)</code> step to the build file so that my
|
||
macro <code>#defines</code> would work. The compile step gives the usual
|
||
messages with <code>-Wall -pedantic</code>. The link step generates a
|
||
warning about a name conflict between my <code>BC()</code> and a <code>BC()</code> from
|
||
curses in the main system library.</p>
|
||
<h3 id="bugs-features"><del>BUGS</del> FEATURES:</h3>
|
||
<p>Arguments matching <code>/[^2]22$/</code> cause the program to segfault
|
||
after rapidly exhausting the available stack space. I could
|
||
probably fix this by adding some special cases to the code,
|
||
but [Blaine the Mono] it’s quite a bit more exciting this way,
|
||
don’t you think?[/Blaine] Since the trailing <code>22</code> will be
|
||
its own atom anyway, you can just insert a space in front of
|
||
it if you run into this feature (e.g. <code>1 22</code> instead of <code>122</code>).</p>
|
||
<p>Note: you may want to be sure you have a limit on stack size before trying this.
|
||
I ran it on Debian GNU/Linux and discovered that I did not have a limit on stack
|
||
size. Fortunately the OS killed the process after a while. This is consistent
|
||
with the output of <a href="https://github.com/ioccc-src/winner/blob/master/1996/schweikh3/schweikh3.c">1996/schweikh3</a> which reports
|
||
<code>malloc lied! Killed by SIGKILL</code>.</p>
|
||
<p>Arguments matching <code>/(?:.){10,}/</code> will produce visually incorrect
|
||
results (e.g., generation 1 starting from 1111111111 will
|
||
print as <code>: 1</code>), but there’s nothing interesting about these
|
||
arguments that can’t be modeled using shorter runs of the same
|
||
symbol.</p>
|
||
<p>Arguments matching <code>/(?:.){257,}/</code> may produce mathematically
|
||
incorrect results (e.g., generation 1 starting from a string
|
||
of 257 <code>1</code>s will be calculated as <code>11</code>); the remark from the
|
||
previous paragraph applies here also.</p>
|
||
<p>The program has exactly 2004 IOCCC countable bytes. It’s
|
||
tailor-made for this competition!</p>
|
||
<p>Although there are no comments, the program still manages to
|
||
be self-documenting in an obscure fashion (periodic table of
|
||
the (non-primordial) elements, “<code>OBFUSCATED C</code>”).</p>
|
||
<h3 id="obfuscation">Obfuscation</h3>
|
||
<p>The program is obfuscated:</p>
|
||
<ul>
|
||
<li>By invoking <code>cpp</code> twice.</li>
|
||
<li>By the use of <code>#define</code>s.</li>
|
||
<li>By the use of <code>typedef</code>s.</li>
|
||
<li>By the use of global constants.</li>
|
||
<li>By the use of global functions that replace the standard ones (I particularly
|
||
like substituting <code>At</code> (<a href="https://en.wikipedia.org/wiki/Astatine">Astatine</a>,
|
||
highly unstable) for <code>abort()</code>). By overloading symbols (for example, <code>B</code> is a
|
||
type, a structure, a structure member, a macro parameter, and a variable).</li>
|
||
<li>By standard tricks like writing <code>'\0'</code> as <code>1["3"]</code> or <code>2["22"]</code>.</li>
|
||
<li>By using ternary operators to avoid <code>else</code>.</li>
|
||
<li>By using the <code>Sb()</code> function to create sub-buffers from either end.</li>
|
||
<li>By naming everything after chemical elements or pairs of elements.</li>
|
||
<li>Because it says so in the source. ;)</li>
|
||
</ul>
|
||
<!--
|
||
|
||
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: 2004/jdalbec/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-2004jdalbec">Inventory for 2004/jdalbec</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/jdalbec.c">jdalbec.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/jdalbec.alt.c">jdalbec.alt.c</a> - alternate source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/jdalbec.orig.c">jdalbec.orig.c</a> - original source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/try.alt.sh">try.alt.sh</a> - script to try alternate code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/try.sh">try.sh</a> - script to try entry</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2004_jdalbec.tar.bz2">2004_jdalbec.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/README.md">README.md</a> - markdown source for this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2004/jdalbec/.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/2004/jdalbec/.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%2F2004%2Fjdalbec%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 -->
|