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.
652 lines
28 KiB
HTML
652 lines
28 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>2015/burton - Most Useful</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2015 IOCCC entry burton - Most Useful">
|
||
<meta name="keywords" content="IOCCC, 2015, IOCCC 2015, IOCCC entry, burton, Most Useful">
|
||
</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: 2015/burton/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2015/burton/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2015/burton/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2015/burton/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>2015/burton - Most Useful</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/navbar.first.html -->
|
||
|
||
<div class="navbar">
|
||
<a class="Left Disabled" href="#">first entry</a>
|
||
<a class="Left" href="../index.html">↑ 2015 ↑</a>
|
||
<a class="Left" href="../dogon/index.html">dogon →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/prog.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/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%2F2015%2Fburton%2Findex.html">✓</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/navbar.first.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#Dave_Burton">Dave Burton</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: 2015/burton/README.md -->
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make</code></pre>
|
||
<h2 id="to-use">To use:</h2>
|
||
<pre><code> ./prog "expression"</code></pre>
|
||
<p>or:</p>
|
||
<pre><code> ./prog</code></pre>
|
||
<p>Type in expressions on standard input.</p>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> ./try.sh</code></pre>
|
||
<p>Notice how the script reads in from a file. If you type just:</p>
|
||
<pre><code> ./prog</code></pre>
|
||
<p>it will prompt you in the same way. Send ctrl-c to exit.</p>
|
||
<p>Finally, if you wish to read the man page:</p>
|
||
<pre><code> man ./calc.1</code></pre>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<p>An alternate version of this entry, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/prog.alt.c">prog.alt.c</a>, is provided.
|
||
This alternate code is discussed in the “prog.c vs prog.alt.c” section of the
|
||
author’s remarks below.</p>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<pre><code> make alt</code></pre>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<p>Use <code>prog.alt</code> as you would <code>prog</code> above.</p>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>“Look, Ma, no <del>hands</del> digits!”</p>
|
||
<p>The place where some arithmetic operations are done, for example, division or
|
||
modulo, are easy to find. Where are addition and subtraction?</p>
|
||
<p>We were impressed with the level of detail the author “blogged” the obfuscation
|
||
process.</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="calc---an-integer-expression-calculator-that-outputs-in-both-hex-and-decimal">calc - an integer expression calculator that outputs in both hex and decimal</h3>
|
||
<p>All useful tools should include sufficient documentation.
|
||
See the included man page. ;-)</p>
|
||
<h3 id="notes">Notes</h3>
|
||
<p>This program is named <code>calc</code>. Onomatopoeia of sorts, in the visual realm. The
|
||
formatting was easier: Form Follows Function (although <a href="../../2011/hou/hint.html" title="Hou Qiming">Hou</a> did this
|
||
better). It was tempting to call it iCalc, with <code>i</code> for integer (and it was
|
||
written on an <code>iDevice</code>), but sanity prevailed.</p>
|
||
<p>Printed in 8 pt Courier, it makes aesthetically pleasing 8.5 x 11 wall art.</p>
|
||
<h3 id="prog.c-vs-prog.alt.c">prog.c vs prog.alt.c</h3>
|
||
<p><a href="../../authors.html#Dominik_Muth">Dominik Muth</a> observed a syntax error on <code>1+1</code>,
|
||
<code>1-1</code>, <code>1|1</code>, and <code>1^1</code> when using an ARM based computer, although <code>1*1</code> and
|
||
others worked correctly. This occurs because some platforms by default treat
|
||
<code>char</code> as <code>unsigned char</code>. The original code has this weakness, which can be
|
||
corrected by adding <code>-fsigned-char</code> to the compile line.</p>
|
||
<p>The modified code is agnostic to <code>char</code> signedness.</p>
|
||
<h3 id="why-is-this-entry-obfuscatedinteresting">Why is this entry obfuscated/interesting?</h3>
|
||
<p>Yes, this is another calculator program.</p>
|
||
<p>However, unlike any other calculator source code the author is aware of,
|
||
this one contains no digits. At all. Anywhere. As in</p>
|
||
<pre><code> grep '[0-9]' prog.c || echo no digits!</code></pre>
|
||
<p>Nor are the digits simply obfuscated. There are no character constants. There
|
||
is only one single, short string, and it does not contain any obfuscated digits.
|
||
And yet the output is in decimal and hexadecimal, and it accepts octal, decimal,
|
||
and hex input.</p>
|
||
<p>Flow control is by <code>for</code> and <code>return</code>. It is <code>if</code>-less, <code>switch</code>-less,
|
||
<code>while</code>-less, and hopeless. Literally, if not figuratively. ;-)</p>
|
||
<p>The code size is intentionally 2015, as stated by <code>iocccsize -i</code>, and can be
|
||
reformatted without changes (as in <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/rule2.c">rule2.c</a> source) to exactly 4096 octets.</p>
|
||
<p>Finally, <code>calc</code> is interesting, if for no other reason than it is practically
|
||
useful: Hex/decimal conversion, arithmetic, byte-swapping, bit-shifting, and
|
||
logical operations with memory, on the command line, or interactively.</p>
|
||
<h3 id="but-the-question-is-why-is-the-entry-obfuscated">But the question is why is the entry obfuscated?</h3>
|
||
<p>The code follows many industry best-practices:</p>
|
||
<ul>
|
||
<li><p>You know what it does just by looking at it.</p></li>
|
||
<li><p>Numbers and digits have often been used for obfuscation,
|
||
so in a bid for better clarity, this code has no digits at all.</p></li>
|
||
<li><p>In the spirit of clarity, most of the variables are declared before use, so
|
||
they are readily visible, with single letter names that don’t clutter the
|
||
screen, in a tautological arrangement.</p></li>
|
||
<li><p>More helpful is the use of <code>typedef</code>s instead of <code>#define</code>, so the types
|
||
remain useful even in the debugger, and source code beautifiers will not undo
|
||
careful presentation.</p></li>
|
||
<li><p><code>#defines</code> are used here in the best spirit of the preprocessor: to shorten
|
||
repetitive constructs, not for obscurity.</p></li>
|
||
<li><p>All functions are short (and therefore easy to understand?) and do only one
|
||
thing, well, ….</p></li>
|
||
<li><p>Curly braces invite endless holy wars over readability. This code only uses
|
||
them for function definitions, thereby greatly improving readability, and
|
||
reducing arguments about said readability.</p></li>
|
||
<li><p>One of C’s many blessings (until recently) is a modicum of keywords, of which
|
||
only 8 are used: <code>for</code>, <code>return</code>, <code>typedef</code>, <code>void</code>, <code>char</code>, <code>short</code>, <code>unsigned</code>
|
||
and <code>long</code>; 10 if <code>#include</code> and <code>#define</code> are counted.</p></li>
|
||
<li><p>The code helpfully declares <code>"syntax_error!"</code> right up front, filling the
|
||
reader with confidence.</p></li>
|
||
<li><p>In spite of its inherent clarity, the code was presented to both <code>indent(1)</code>
|
||
and <code>clang-format(1)</code>, after running it through the preprocessor, sustaining its
|
||
better qualities.</p></li>
|
||
<li><p>That the code is obfuscated is spelled out two different ways in the source;
|
||
it helps to reformat the code to see the second spelling.</p></li>
|
||
<li><p>The author is overly fond of the code that handles input. There is no memory
|
||
allocation, nor pre-allocation of arrays, so where does the memory come from?
|
||
The multi-base <code>strtol(3)</code> code is pretty tricky. No special attempt was made to
|
||
replace operations with obscure mathematical relations, as the (lack of) beauty
|
||
is in the parsing – ask not where is the modulus operation, but how does it
|
||
know when to mod – okay, but where is add and subtract? And really, who
|
||
doesn’t enjoy a <code>setjmp(3)</code> in the argument list?</p></li>
|
||
<li><p>Finally, documentation of the source code structure is helpfully provided in
|
||
rot13 format. But isn’t it unsportsmanlike to rely upon it? However, even with
|
||
this helpful guide, things like reading input lines remain as tricky to read as
|
||
they are to write.</p></li>
|
||
</ul>
|
||
<h3 id="compiler-warnings">Compiler warnings</h3>
|
||
<p><code>calc</code> is C99 compliant, and is ANSI/C90 compliant except for wanting 64-bit <code>long long</code>. Changing the two <code>long long</code> typedefs to <code>long</code>, and compiling with <code>gcc -m32</code> yields a program that operates on 32-bit values, with wrap-around of
|
||
shifts mod 32:</p>
|
||
<pre><code> 1<<48
|
||
65536 0x00010000</code></pre>
|
||
<p>gcc 4.2.1 without arguments compiles cleanly (e.g. <code>cc prog.c -o prog</code>).
|
||
This is my workaday compiler. gcc is also clean with <code>-ansi</code>, and <code>-std=c99</code>.</p>
|
||
<p>clang 3.6.0 lives up to its namesake, resounding on non-problems.
|
||
To stifle these complaints:</p>
|
||
<pre><code> -Wno-return-type -Wno-parentheses -Wno-empty-body</code></pre>
|
||
<p>When invoked with <code>-ansi -pedantic</code>, there are two warnings, which can be ignored:</p>
|
||
<ul>
|
||
<li><code>ISO C90 does not support 'long long'</code></li>
|
||
</ul>
|
||
<p>With <code>-Wall -std=c99</code>, both are quite noisy, and all can be ignored:</p>
|
||
<ul>
|
||
<li><code>array subscript has type 'char' [-Wchar-subscripts]</code></li>
|
||
<li><code>value computed is not used [-Wunused-value]</code></li>
|
||
<li><code>operation on 'j' may be undefined [-Wsequence-point]</code></li>
|
||
</ul>
|
||
<h3 id="test-suite">Test Suite:</h3>
|
||
<p>If the program name begins with an <code>e</code>, it echoes <code>stdin</code> to <code>stdout</code>.
|
||
This allows for a convenient test suite:</p>
|
||
<pre><code> ln -sf prog eprog
|
||
PATH=. eprog < test.in | diff - test.out</code></pre>
|
||
<h3 id="spoilers">Spoilers:</h3>
|
||
<p>If you do not want to puzzle out how it works, see <a href="spoilers.html">spoilers.html</a>.</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: 2015/burton/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-2015burton">Inventory for 2015/burton</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/prog.c">prog.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/prog.alt.c">prog.alt.c</a> - alternate source code</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/prog.orig.c">prog.orig.c</a> - original source code</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/try.sh">try.sh</a> - script to try entry</li>
|
||
<li><a href="try.this.txt">try.this.txt</a> - try.sh input</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/calc.1">calc.1</a> - man page for integer expression calculator</li>
|
||
<li><a href="road.to.obscurity.html">road.to.obscurity.html</a> - obfuscated calculator development notes</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/rule2.c">rule2.c</a> - iocccsize reformatted to exactly 4096 octets</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/test32.out">test32.out</a> - test suite comparison data for 32-bit systems</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/test.in">test.in</a> - test suite input data</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/test.out">test.out</a> - test suite comparison data</li>
|
||
<li><a href="spoilers.html">spoilers.html</a> - web page with spoiler about this entry</li>
|
||
<li><a href="src.doc.txt">src.doc.txt</a> - hints about the source code</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2015_burton.tar.bz2">2015_burton.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/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/2015/burton/.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/2015/burton/.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/2015/burton/.path">.path</a> - directory path from top level directory</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/road.to.obscurity.md">road.to.obscurity.md</a> - markdown source for road.to.obscurity.html</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2015/burton/spoilers.md">spoilers.md</a> - markdown source for spoilers.html</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%2F2015%2Fburton%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 -->
|