Files
ioccc/2011/toledo/index.html
T
Landon Curt Noll 085a708660 Added comments about where markdown content came from
The HTML files now include a comment indicating from where the main
part of the markdown content.

Changed `bin/gen-other-html.sh` VERSION from "1.0 2024-02-27"
to "1.0.1 2024-03-08".

Changed `bin/gen-top-html.sh` VERSION from "1.2 2024-02-29"
to "1.2.1 2024-03-08".

Changed `bin/gen-year-index.sh` VERSION from "1.0.1 2024-02-23"
to "1.0.2 2024-03-08".

Changed `bin/md2html.sh` VERSION from "1.0.1 2024-02-23"
to "1.1 2024-03-08".

Changed `bin/quick-readme2index.sh` VERSION from "1.1.1 2024-02-23"
to "1.1.2 2024-03-08".
2024-03-08 22:32:03 -08:00

443 lines
21 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! 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/top.default.html -->
<!-- -->
<!-- The original markdown content was formed by the tool: bin/readme2index.sh -->
<!-- The main part of the markdown content came from: 2011/toledo/README.md -->
<!-- The HTML was converted from markdown by the tool: bin/md2html.sh -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<link rel="stylesheet" href="../../ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2011/toledo - Best non-chess game</title>
<meta name="description" content="2011 IOCCC entry toledo - Best non-chess game">
<meta name="keywords" content="IOCCC, 2011, IOCCC 2011, IOCCC entry, toledo, Best non-chess game">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<div class="header">
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2011/toledo - Best non-chess game</h2>
</div>
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<div class="topnav">
<a class="Left" href="../richards/index.html">&larr; richards</a>
<a class="Left" href="../index.html">&uarr; 2011 &uarr;</a>
<a class="Left" href="../vik/index.html">vik &rarr;</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2011/toledo/toledo.c">C code</a>
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2011/toledo/Makefile">Makefile</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="../../index.html">IOCCC Home</a>
<a href="../../years.html">Winning Entries</a>
<a href="../../authors.html">People who have won</a>
<a href="../../location.html">Location of authors</a>
</div>
<hr>
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="../../bugs.html">Bugs &amp; (mis)features</a>
<a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a>
<a href="../../faq.html#fix_web_site">Fixing the web site</a>
<a href="../../faq.html#fix_author">Fixing author info</a>
<a href="../../thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="../../judges.html">The IOCCC Judges</a>
<a href="../../contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo
G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<em>United Mexican States</em> (<em>Mexico</em>) <br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<p>If you have X11 installed:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There are two alternate versions, <a href="toledo.alt.c">one that
lets you reconfigure the controls and size</a> and <a
href="toledo.alt2.c">another that should work for Windows</a>. See <a
href="#alternate-code">Alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The first alt version, <a href="toledo.alt.c">toledo.alt.c</a>,
allows you to reconfigure the controls and the dimensions more
easily.</p>
<p>The second version, <a href="toledo.alt2.c">toledo.alt2.c</a>, should
work for Windows but does not allow you to reconfigure the keys or
dimensions. This is because it cannot be tested by us.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>For the one that lets you reconfigure the keys you will want to look
at the included header file, <a href="keysym.h">keysym.h</a>, to find
the correct macros. Once you have the right names you can define the
macros <code>FIRE</code>, <code>FORWARD</code>, <code>BACKWARD</code>,
<code>LEFT</code>, <code>RIGHT</code>, <code>WIDTH</code> and
<code>HEIGHT</code>. Here are the defaults:</p>
<pre><code>FIRE= XK_BackSpace:XK_Tab
FORWARD= XK_Up:XK_w
BACKWARD= XK_Down:XK_s
LEFT= XK_Left:XK_a
RIGHT= XK_Right:XK_d
WIDTH= 512
HEIGHT= 288</code></pre>
<p>but you can change them about however you like, even with other keys.
For instance to swap <code>LEFT</code> and <code>RIGHT</code>:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt</span></code></pre></div>
<p>but you can specify something completely else and you can pick and
choose which controls you wish to redefine. You might also wish to
change the dimensions of the game, <code>WIDTH</code> and
<code>HEIGHT</code> which have an arbitrarily selected lower limit as
well as the default values.</p>
<p>Observe that each of the controls are a pair in the form of
<code>player2:player1</code> (yes, player 2 comes first!).</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This two player game uses X11. The control keys can be configured by
modifying the <code>A</code>, <code>B</code>, <code>C</code>,
<code>D</code> and <code>E</code> macros at compilation.</p>
<p>After a quick splash screen the objective should be clear. There are
Red, Green and Cyan tanks. A larger window can be made by altering the
source early on, right before the code gets hard to follow, or using the
<a href="#alternate-code">alternate version</a>.</p>
<p>Like Oscar’s previous winning X11 program for the 19th IOCCC, if you
remove both the X11 include files and replace them with</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&quot;layer.c&quot;</span></span></code></pre></div>
<p>you ought to be able to compile and run this program on Windows.
NOTE: this is what <a href="toledo.alt2.c">toledo.alt2.c</a> is for.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<pre><code> /=========\\
\==\ /==/ ||
|| || /====\ |\/=\ || //==\ ==\ |=\
|| || || || || || // || =| | |
|| || //===| || || ||=// \\=\\ ==/ |=/
|| || || || || || || \\ || User&#39;s
\===/ \\==// || || || \\ \==// Manual</code></pre>
<p>This is a color X11 3D tank-game for two players, just compile and
run it without arguments.</p>
<p>You will see briefly a tank spinning before each level.</p>
<p>The Left half of the window shows the red player view and the right
half shows the green player view; the background will change to blue
when the view goes inactive.</p>
<p>The objective is to chase and destroy the other player’s tank. There
is also an aqua tank for testing your aim and getting extra points.</p>
<p>Caveat: You can shoot only 3 bullets at a time.<br />
Trick: You can fire faster if they explode on anything.<br />
Believe it or not, it has strategy!</p>
<p>When only one tank remains on the field, the level will advance.
Don’t forget to destroy the aqua tank.</p>
<p>The <strike>battle</strike>playground is surrounded by mountains and
each level is filled with random obstacles (pyramids and cubes).</p>
<p>The bars show players energy and score; each bar shows energy and
indicates the current player view (wider on the left). The right part
grows with every point.</p>
<p>Keys for player 1 (lowercase):</p>
<ul>
<li>Tab - Fire</li>
<li>w - Go ahead</li>
<li>s - Go backwards</li>
<li>a - Turn left</li>
<li>d - Turn right</li>
</ul>
<p>Keys for player 2:</p>
<ul>
<li>Backspace - Fire</li>
<li>Up arrow - Go ahead</li>
<li>Down arrow - Go backwards</li>
<li>Left arrow - Turn left</li>
<li>Right arrow - Turn right</li>
</ul>
<p>Note: Numeric keys don’t work.</p>
<p>If you don’t like the keys assignment, you can change it in the
Makefile or use the <a href="#alternate-code">alternate version</a>.</p>
<h3 id="parental-advisory-warning">PARENTAL ADVISORY WARNING:</h3>
<p>This game is highly violent: when the tank explodes you can see the
little stick man blowing in parts.</p>
<p>Not really, just kidding :D</p>
<h3 id="platforms-tested">PLATFORMS TESTED:</h3>
<ul>
<li>openSUSE 10.2 x86-32, X11R6 1024x768 32-bits color.</li>
<li>Fedora Core 8 x86-64, X11R6 1280x1024 32-bits color.</li>
<li>Fedora Core 11 x86-64, X11R6 1024x768 32-bits color.</li>
<li>Fedora Core 14 x86-64, X11R6 1024x768 32-bits color.</li>
</ul>
<h3 id="complete-feature-set">COMPLETE FEATURE SET:</h3>
<ul>
<li>Multiplayer out of the box.</li>
<li>Totally self-contained, no external files.</li>
<li>Fast-and-furious action at 29.97 frames per second.</li>
<li>Just as the movies, 16:9 aspect-ratio.</li>
<li>Beautiful mountains landscape plus horizon line :)</li>
<li>Tanks and bullets exploding as wires with weird physics.</li>
<li>Tanks back off when firing.</li>
<li>There is an infinite number of levels.</li>
<li>Always different levels.</li>
<li>Animated intro.</li>
<li>It has color!</li>
</ul>
<h3 id="features-that-programmers-will-find-appealing">FEATURES THAT
PROGRAMMERS WILL FIND APPEALING:</h3>
<ul>
<li>Works both with 32 and 64-bit CPUs.</li>
<li>Double buffered, portable to any X11 with 24/32-bit color.</li>
<li>Memory-hungry as must be any 3D program; uses a 256 MB array.</li>
<li>Total and absolute irreverent coding style, so it generates a lot of
warnings when compiled.</li>
<li>It can take several minutes to compile (known culprits: Fedora Core
11-14 on x86-64 512 MB).</li>
<li>It is written in the only true C: K&amp;R, and no, that doesn’t mean
Katherine &amp; Rose.</li>
<li>Vectorial scalable graphics: do you want a bigger viewport? Change
variables <code>M</code> and <code>N</code> (see the <a
href="#alternate-code">alternate code</a>).</li>
<li>Half of the program is formatted as 3D cube. View with tabs at 8
columns and a square font.</li>
<li>The other half of the program is unprintable source code, so no
typing from paper, you have to write a converter of tabs and form-feeds
to its C escaped forms.</li>
<li>No text, so this program can be used and understood easily in any
country.</li>
<li>This program is highly ecological, it sleeps when it is not doing
anything.</li>
<li>Virtual world with its own physics laws.</li>
<li>When closing the window it will show an X11 error :P</li>
</ul>
<h3 id="obfuscation-tricks">OBFUSCATION TRICKS:</h3>
<ul>
<li>Loop code included inside loop test.</li>
<li>Function arguments used as variables.</li>
<li>Operators used freely.</li>
<li>Pre-calculated values to save bytes.</li>
<li>Uses the <code>+++</code>, <code>+-</code> and <code>*+</code>
undocumented C operators :P</li>
</ul>
<pre><code>
....,,,,---++++++--,,..\
.,,,....... .$@@@@@@@@@@@@$$@@@@@@@@@@@@@@#+\
@@@@@###@@@@$$$@@@@$$$@@@-......-@+......,,,,,,##\
=++==++++++++=@@$==#$$$$$---,,,,@@@,,,,,,-------@@,..........,,.\
,===#$$$$$$###$####=======@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=##$@@@@@@@@.
+@,,++++++++=+=========++++===++++++++++-+++@@-,,,,,,,,---+++=++++--,,... @.
.@. .......,,,,-----++=@=++==@$=+--,,... @.
$# S P O I L E R .,,-#@--,,,@$..... @.
.@ ..,--+==++-,,,,.,,,,=@+++++====+++++---,,,....@.
@+ ..,,-+++++++-,,.. @. ....,,,,,---+@@\
,@ ..,--+++=+++,,.. $# .==+\
@#--++==++-,,.. ,@ S P O I L E R .==+\
,#@@$+,,. @. ==+\
.,,+++++,,. S P O I L E R $= +=+\
..,-==++-,. ,@ ---\
.,-+=+++,.. @. .++-\
.,,++=++-,. @+ ==+\
.,-++==+-,. +@ ==+\
..,+++=+-,.. .@. +=+\
.,-+++++,@@==
</code></pre>
<h3 id="the-history-of-this-program">THE HISTORY OF THIS PROGRAM:</h3>
<p>When I started working on this program, I figured that it would be
easy to fit on the character limit, but I missed three things: the
enormous X11 names, the non-portable key codes and my 2 KB of
artwork.</p>
<p>Very hard coding did the first thing. In fact I worked out
twenty-nine different versions and at one step I had four parallel
versions with different characteristics removed (mountains, horizon
lines, score/status bars and explosions) but I’ve managed to fit it all
together!</p>
<p>The second thing was solved using the Makefile: it is under 160 bytes
and you get adjustable controls. The greatest mystery on the Earth is
why X11 gives non-portable key codes to the user.</p>
<p>And finally, the third “Thing” was growing and growing, and growing,
eating bytes for lunch… after endless rounds of crunching I obtained
three-hundred seventy-eight bytes of artwork and guess what? It doesn’t
fit.</p>
<p>So I had to integrate a decompressor based on the space, tabulators
and other non-counted characters.</p>
<p>The final program is composed of eight micro-functions: one is the
core and does most of the hard work and the other functions help do the
X11 things, explosion effects, 3D calculations and viewing.</p>
<ul>
<li><code>K()</code> - 3D transformation</li>
<li><code>s()</code> - Rendering</li>
<li><code>b()</code> - Line color selection</li>
<li><code>G()</code> - Explosion animation</li>
<li><code>g()</code> - Moves 3D object backward and forward</li>
<li><code>F()</code> - Collision detection</li>
<li><code>T()</code> - Core (also known as main loop :D)</li>
<li><code>main()</code> - Initialization and ‘uncruncher’, what a common
name!; C programs should start in the cool() function :).</li>
</ul>
<p>The source code was formatted as a cube using a specially written
program. This program is smaller and obfuscated what is needed so the
reformatting doesn’t exceeded the character limits. The crunched vectors
were generated by another special program and the tank that surrounds
this text was generated by yet another program.</p>
<p><em>Have fun!</em></p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2011toledo"><a name="inventory"></a>Inventory for
2011/toledo</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/toledo.c">toledo.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/toledo.alt.c">toledo.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/toledo.alt2.c">toledo.alt2.c</a>
- alternate alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/toledo.orig.c">toledo.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/keysym.h">keysym.h</a>
- included header file</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/layer.c">layer.c</a>
- translation layer to make 3D Tanks game</li>
<li><a href="2011_toledo.tar.bz2">2011_toledo.tar.bz2</a> - download
entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/toledo/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2011%2Ftoledo%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->