Add missing 1994/shapiro/shapiro.alt.c
With a tip from Leo the missing alt code has been added to the website. Ta, Leo (🦁⭐️🌌)!
This commit is contained in:
1 parent
689f99fd92
commit
45fb924ecf
9 files changed
+111
-24
No files matched your search
@@ -45,6 +45,14 @@
|
|||||||
"display_via_github" : false,
|
"display_via_github" : false,
|
||||||
"entry_text" : "author's hints"
|
"entry_text" : "author's hints"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"file_path" : "shapiro.alt.c",
|
||||||
|
"inventory_order" : 150,
|
||||||
|
"OK_to_edit" : true,
|
||||||
|
"display_as" : "c",
|
||||||
|
"display_via_github" : true,
|
||||||
|
"entry_text" : "author provided unobfuscated and formatted source code"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"file_path" : "1994_shapiro.tar.bz2",
|
"file_path" : "1994_shapiro.tar.bz2",
|
||||||
"inventory_order" : 1415926535,
|
"inventory_order" : 1415926535,
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ OBJ= ${PROG}.o
|
|||||||
DATA= shapiro.md
|
DATA= shapiro.md
|
||||||
TARGET= ${PROG}
|
TARGET= ${PROG}
|
||||||
#
|
#
|
||||||
ALT_OBJ=
|
ALT_OBJ= ${PROG}.alt.o
|
||||||
ALT_TARGET=
|
ALT_TARGET= ${PROG}.alt
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
@@ -146,6 +146,10 @@ ${PROG}_t1: ${PROG}.c
|
|||||||
alt: data ${ALT_TARGET}
|
alt: data ${ALT_TARGET}
|
||||||
@${TRUE}
|
@${TRUE}
|
||||||
|
|
||||||
|
|
||||||
|
${PROG}.alt: ${PROG}.alt.c
|
||||||
|
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
# data files
|
# data files
|
||||||
#
|
#
|
||||||
data: ${DATA}
|
data: ${DATA}
|
||||||
|
|||||||
+21
-4
@@ -4,13 +4,15 @@
|
|||||||
make all
|
make all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
There is an alternate version that is unobfuscated, provided by the author. See
|
||||||
|
[Alternate code](#alternate-code) below.
|
||||||
|
|
||||||
|
|
||||||
### Bugs and (Mis)features:
|
### Bugs and (Mis)features:
|
||||||
|
|
||||||
The current status of this entry is:
|
The current status of this entry is:
|
||||||
|
|
||||||
> **STATUS: INABIAF - please DO NOT fix**<br>
|
> **STATUS: INABIAF - please DO NOT fix**<br>
|
||||||
> **STATUS: missing file - please provide it**
|
|
||||||
|
|
||||||
For more detailed information see [1994/shapiro in bugs.html](../../bugs.html#1994_shapiro).
|
For more detailed information see [1994/shapiro in bugs.html](../../bugs.html#1994_shapiro).
|
||||||
|
|
||||||
@@ -41,6 +43,24 @@ Notice what you see in the output of `ps`! Observe too what happens after you
|
|||||||
bring it back to the foreground.
|
bring it back to the foreground.
|
||||||
|
|
||||||
|
|
||||||
|
## Alternate code:
|
||||||
|
|
||||||
|
This version, [shapiro.alt.c](%%REPO_URL%%/1994/shapiro/shapiro.alt.c), is an
|
||||||
|
unobfuscated version provided by the author.
|
||||||
|
|
||||||
|
|
||||||
|
## Alternate build:
|
||||||
|
|
||||||
|
``` <!---sh-->
|
||||||
|
make alt
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Alternate use:
|
||||||
|
|
||||||
|
Use `shapiro.alt` as you would `shapiro` above.
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
This entry has many different levels of obfuscation, and yet the
|
This entry has many different levels of obfuscation, and yet the
|
||||||
@@ -51,9 +71,6 @@ From time to time, run `ps(1)` and look at the new processes.
|
|||||||
If you want more information on the internals of this program, see
|
If you want more information on the internals of this program, see
|
||||||
[shapiro.html](shapiro.html).
|
[shapiro.html](shapiro.html).
|
||||||
|
|
||||||
The missing file `shapiro.alt.c` is an unobfuscated version of this program. See
|
|
||||||
[1994/shapiro in bugs.html](../../bugs.html#1994_shapiro).
|
|
||||||
|
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -446,11 +446,12 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
<!-- BEFORE: 1st line of markdown file: 1994/shapiro/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 1994/shapiro/README.md -->
|
||||||
<h2 id="to-build">To build:</h2>
|
<h2 id="to-build">To build:</h2>
|
||||||
<pre><code> make all</code></pre>
|
<pre><code> make all</code></pre>
|
||||||
|
<p>There is an alternate version that is unobfuscated, provided by the author. See
|
||||||
|
<a href="#alternate-code">Alternate code</a> below.</p>
|
||||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||||
<p>The current status of this entry is:</p>
|
<p>The current status of this entry is:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><strong>STATUS: INABIAF - please DO NOT fix</strong><br>
|
<p><strong>STATUS: INABIAF - please DO NOT fix</strong><br></p>
|
||||||
<strong>STATUS: missing file - please provide it</strong></p>
|
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>For more detailed information see <a href="../../bugs.html#1994_shapiro">1994/shapiro in bugs.html</a>.</p>
|
<p>For more detailed information see <a href="../../bugs.html#1994_shapiro">1994/shapiro in bugs.html</a>.</p>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
@@ -467,14 +468,19 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
./shapiro_t1</code></pre>
|
./shapiro_t1</code></pre>
|
||||||
<p>Notice what you see in the output of <code>ps</code>! Observe too what happens after you
|
<p>Notice what you see in the output of <code>ps</code>! Observe too what happens after you
|
||||||
bring it back to the foreground.</p>
|
bring it back to the foreground.</p>
|
||||||
|
<h2 id="alternate-code">Alternate code:</h2>
|
||||||
|
<p>This version, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/shapiro.alt.c">shapiro.alt.c</a>, is an
|
||||||
|
unobfuscated version provided by the author.</p>
|
||||||
|
<h2 id="alternate-build">Alternate build:</h2>
|
||||||
|
<pre><code> make alt</code></pre>
|
||||||
|
<h3 id="alternate-use">Alternate use:</h3>
|
||||||
|
<p>Use <code>shapiro.alt</code> as you would <code>shapiro</code> above.</p>
|
||||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||||
<p>This entry has many different levels of obfuscation, and yet the
|
<p>This entry has many different levels of obfuscation, and yet the
|
||||||
source file is self documenting. :-)</p>
|
source file is self documenting. :-)</p>
|
||||||
<p>From time to time, run <code>ps(1)</code> and look at the new processes.</p>
|
<p>From time to time, run <code>ps(1)</code> and look at the new processes.</p>
|
||||||
<p>If you want more information on the internals of this program, see
|
<p>If you want more information on the internals of this program, see
|
||||||
<a href="shapiro.html">shapiro.html</a>.</p>
|
<a href="shapiro.html">shapiro.html</a>.</p>
|
||||||
<p>The missing file <code>shapiro.alt.c</code> is an unobfuscated version of this program. See
|
|
||||||
<a href="../../bugs.html#1994_shapiro">1994/shapiro in bugs.html</a>.</p>
|
|
||||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||||
<p>The basic theme (pun) of this program is:</p>
|
<p>The basic theme (pun) of this program is:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -535,6 +541,7 @@ test it on.)</p>
|
|||||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/Makefile">Makefile</a> - entry Makefile</li>
|
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/Makefile">Makefile</a> - entry Makefile</li>
|
||||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/shapiro.orig.c">shapiro.orig.c</a> - original source code</li>
|
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/shapiro.orig.c">shapiro.orig.c</a> - original source code</li>
|
||||||
<li><a href="shapiro.html">shapiro.html</a> - author’s hints</li>
|
<li><a href="shapiro.html">shapiro.html</a> - author’s hints</li>
|
||||||
|
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/shapiro.alt.c">shapiro.alt.c</a> - author provided unobfuscated and formatted source code</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2 id="secondary-files">Secondary files</h2>
|
<h2 id="secondary-files">Secondary files</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/* file: better_time.c */
|
||||||
|
/*
|
||||||
|
* If you enjoyed the functionality of my 1994 IOCCC entry (you like having
|
||||||
|
* a clock on your screen at all times) but you do not want to use up 7
|
||||||
|
* process slots to run the code, then this is the program for you. This
|
||||||
|
* program uses ANSI/VTxxx escape sequences and perodic time(3) calls to
|
||||||
|
* print a clock in the upper right corner of you screen.
|
||||||
|
*
|
||||||
|
* -Andrew Shapiro
|
||||||
|
* CSES/CIRES University of Colorado
|
||||||
|
* Campus Box 216
|
||||||
|
* Boulder, CO 80309-0216, USA
|
||||||
|
*
|
||||||
|
* shapiro@alumni.cs.colorado.edu
|
||||||
|
* andrew@gooter.metronet.org
|
||||||
|
*
|
||||||
|
* To build:
|
||||||
|
* cc -o shapiro.alt shapiro.alt.c
|
||||||
|
*
|
||||||
|
* To run:
|
||||||
|
* shapiro.alt &
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#define ESC '\033'
|
||||||
|
#define MOVETO "\033[%d;%d;H"
|
||||||
|
#define SAVE "\0337"
|
||||||
|
#define RESTORE "%c8",ESC
|
||||||
|
#define ROW 1
|
||||||
|
#define COL 50
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
time_t i;
|
||||||
|
char * atime;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
time(&i);
|
||||||
|
atime = asctime(localtime(&i));
|
||||||
|
atime[strlen(atime)-1] = '\0';
|
||||||
|
printf(SAVE);
|
||||||
|
printf(MOVETO,ROW,COL);
|
||||||
|
printf(" +--------------------------+ ");
|
||||||
|
printf(MOVETO,ROW+1,COL);
|
||||||
|
printf(" + %s +",atime);
|
||||||
|
printf(MOVETO,ROW+2,COL);
|
||||||
|
printf(" +--------------------------+ ");
|
||||||
|
printf(MOVETO,ROW+3,COL);
|
||||||
|
printf(" ");
|
||||||
|
printf(RESTORE);
|
||||||
|
fflush(stdout); /**/
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1620,11 +1620,6 @@ and it functions correctly it will address the systems where <code>EOF != -1</co
|
|||||||
if it checked for <code>!= EOF</code>.</p>
|
if it checked for <code>!= EOF</code>.</p>
|
||||||
<p>Since it works there is no need to fix this except for a challenge to yourself.</p>
|
<p>Since it works there is no need to fix this except for a challenge to yourself.</p>
|
||||||
<p>Jump to: <a href="#">top</a></p>
|
<p>Jump to: <a href="#">top</a></p>
|
||||||
<h3 id="status-missing-file---please-provide-it">STATUS: missing file - please provide it</h3>
|
|
||||||
<p>The index.html file refers to an alternate version of the code that is not
|
|
||||||
obfuscated but it is missing from the entry directory and the archive. Do you
|
|
||||||
have this file?</p>
|
|
||||||
<p>Jump to: <a href="#">top</a></p>
|
|
||||||
<div id="1994_tvr">
|
<div id="1994_tvr">
|
||||||
<h2 id="tvr">1994/tvr</h2>
|
<h2 id="tvr">1994/tvr</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -1697,7 +1692,7 @@ not show any output, stuck in a loop.</p>
|
|||||||
<h2 id="vanschnitz">1995/vanschnitz</h2>
|
<h2 id="vanschnitz">1995/vanschnitz</h2>
|
||||||
</div>
|
</div>
|
||||||
<p>Jump to: <a href="#">top</a></p>
|
<p>Jump to: <a href="#">top</a></p>
|
||||||
<h3 id="status-missing-file---please-provide-it-1">STATUS: missing file - please provide it</h3>
|
<h3 id="status-missing-file---please-provide-it">STATUS: missing file - please provide it</h3>
|
||||||
<h3 id="source-code-1995vanschnitzvanschnitz.c">Source code: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1995/vanschnitz/vanschnitz.c">1995/vanschnitz/vanschnitz.c</a></h3>
|
<h3 id="source-code-1995vanschnitzvanschnitz.c">Source code: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1995/vanschnitz/vanschnitz.c">1995/vanschnitz/vanschnitz.c</a></h3>
|
||||||
<h3 id="information-1995vanschnitzindex.html">Information: <a href="1995/vanschnitz/index.html">1995/vanschnitz/index.html</a></h3>
|
<h3 id="information-1995vanschnitzindex.html">Information: <a href="1995/vanschnitz/index.html">1995/vanschnitz/index.html</a></h3>
|
||||||
<p>The authors stated that they included a version that allows people with just K&R
|
<p>The authors stated that they included a version that allows people with just K&R
|
||||||
|
|||||||
@@ -1702,14 +1702,6 @@ Since it works there is no need to fix this except for a challenge to yourself.
|
|||||||
|
|
||||||
Jump to: [top](#)
|
Jump to: [top](#)
|
||||||
|
|
||||||
### STATUS: missing file - please provide it
|
|
||||||
|
|
||||||
The index.html file refers to an alternate version of the code that is not
|
|
||||||
obfuscated but it is missing from the entry directory and the archive. Do you
|
|
||||||
have this file?
|
|
||||||
|
|
||||||
Jump to: [top](#)
|
|
||||||
|
|
||||||
<div id="1994_tvr">
|
<div id="1994_tvr">
|
||||||
## 1994/tvr
|
## 1994/tvr
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2241,6 +2241,9 @@ assumed that <code>getc()</code> will return <code>-1</code> on EOF or error, no
|
|||||||
where <code>EOF != -1</code> it could result in an infinite loop.</p>
|
where <code>EOF != -1</code> it could result in an infinite loop.</p>
|
||||||
<p>For an interesting problem that occurred here and what was done to solve it,
|
<p>For an interesting problem that occurred here and what was done to solve it,
|
||||||
check <a href="bugs.html#1994_shapiro">1994/shapiro in bugs.html</a>.</p>
|
check <a href="bugs.html#1994_shapiro">1994/shapiro in bugs.html</a>.</p>
|
||||||
|
<p>Cody also provided the missing
|
||||||
|
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1994/shapiro/shapiro.alt.c">shapiro.alt.c</a> file, found by Leo.
|
||||||
|
Thanks Leo!</p>
|
||||||
<p>Jump to: <a href="#">top</a></p>
|
<p>Jump to: <a href="#">top</a></p>
|
||||||
<div id="1994_smr">
|
<div id="1994_smr">
|
||||||
<h2 id="winning-entry-1994smr">Winning entry: <a href="1994/smr/index.html">1994/smr</a></h2>
|
<h2 id="winning-entry-1994smr">Winning entry: <a href="1994/smr/index.html">1994/smr</a></h2>
|
||||||
|
|||||||
@@ -2658,6 +2658,10 @@ where `EOF != -1` it could result in an infinite loop.
|
|||||||
For an interesting problem that occurred here and what was done to solve it,
|
For an interesting problem that occurred here and what was done to solve it,
|
||||||
check [1994/shapiro in bugs.html](bugs.html#1994_shapiro).
|
check [1994/shapiro in bugs.html](bugs.html#1994_shapiro).
|
||||||
|
|
||||||
|
Cody also provided the missing
|
||||||
|
[shapiro.alt.c](%%REPO_URL%%/1994/shapiro/shapiro.alt.c) file, found by Leo.
|
||||||
|
Thanks Leo!
|
||||||
|
|
||||||
|
|
||||||
Jump to: [top](#)
|
Jump to: [top](#)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user