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,
|
||||
"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",
|
||||
"inventory_order" : 1415926535,
|
||||
|
||||
@@ -118,8 +118,8 @@ OBJ= ${PROG}.o
|
||||
DATA= shapiro.md
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
|
||||
|
||||
#################
|
||||
@@ -146,6 +146,10 @@ ${PROG}_t1: ${PROG}.c
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
|
||||
${PROG}.alt: ${PROG}.alt.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
|
||||
+21
-4
@@ -4,13 +4,15 @@
|
||||
make all
|
||||
```
|
||||
|
||||
There is an alternate version that is unobfuscated, provided by the author. See
|
||||
[Alternate code](#alternate-code) below.
|
||||
|
||||
|
||||
### Bugs and (Mis)features:
|
||||
|
||||
The current status of this entry is:
|
||||
|
||||
> **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).
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
## 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:
|
||||
|
||||
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
|
||||
[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:
|
||||
|
||||
|
||||
+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 -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<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>
|
||||
<p>The current status of this entry is:</p>
|
||||
<blockquote>
|
||||
<p><strong>STATUS: INABIAF - please DO NOT fix</strong><br>
|
||||
<strong>STATUS: missing file - please provide it</strong></p>
|
||||
<p><strong>STATUS: INABIAF - please DO NOT fix</strong><br></p>
|
||||
</blockquote>
|
||||
<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>
|
||||
@@ -467,14 +468,19 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
./shapiro_t1</code></pre>
|
||||
<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>
|
||||
<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>
|
||||
<p>This entry has many different levels of obfuscation, and yet the
|
||||
source file is self documenting. :-)</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
|
||||
<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>
|
||||
<p>The basic theme (pun) of this program is:</p>
|
||||
<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/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="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>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user