Merge pull request #2759 from xexyl/try-next

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-12-02 09:47:43 -08:00
commit 7fcf75ed58
12 files changed
+228 -88

No files matched your search

+50 -1
View File
@@ -10,6 +10,18 @@
# files for new authors, and update `author/author_handle.json`
# for authors who won previously.
#
# This script was written in 2024 by:
#
# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
#
# with useful improvements by:
#
# @xexyl
# https://xexyl.net Cody Boone Ferguson
# https://ioccc.xexyl.net
#
# "Because sometimes even the IOCCC Judges need some help." :-)
#
# Copyright (c) 2024 by Landon Curt Noll. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
@@ -1011,6 +1023,7 @@ export REMARKS_MD="$YYYY_DIR/remarks.md"
export TAR_BZ2="$YYYY_DIR/$ENTRY_ID.tar.bz2"
export ENTRY_JSON="$YYYY_DIR/.entry.json"
export DOT_GITIGNORE="$YYYY_DIR/.gitignore"
export TRY_SH="$YYYY_DIR/try.sh"
export DOT_PATH="$YYYY_DIR/.path"
export README_MD="$YYYY_DIR/README.md"
export INDEX_HTML="$YYYY_DIR/index.html"
@@ -1023,6 +1036,7 @@ export TEMPLATE_ENTRY_DIR="$TEMPLATE_DIR/entry"
export TEMPLATE_GITIGNORE="$TEMPLATE_ENTRY_DIR/gitignore"
export TEMPLATE_README_MD_HEAD="$TEMPLATE_ENTRY_DIR/README.md.head"
export TEMPLATE_README_MD_TAIL="$TEMPLATE_ENTRY_DIR/README.md.tail"
export TEMPLATE_TRY_SH="$TEMPLATE_DIR/try.sh"
# determine TARBALL filename
@@ -1114,7 +1128,10 @@ if [[ ! -f $TEMPLATE_README_MD_TAIL ]]; then
echo "$0: ERROR: missing template README.md.tail file: $TEMPLATE_README_MD_TAIL" 1>&2
exit 6
fi
if [[ ! -f $TRY_SH ]]; then
echo "$0: ERROR: missing template try.sh file: $TRY_SH" 1>&2
exit 6
fi
# firewall - verify chkentry tool
#
@@ -1911,6 +1928,7 @@ if [[ -z $NOOP ]]; then
((++count))
manifest_csv "$ORIG_C" 50 false c true "original source code" >> "$TMP_MANIFEST_CSV"
# collect manifest for extra_file(s)
#
export PATTERN
@@ -2121,6 +2139,37 @@ if [[ -z $NOOP ]]; then
manifest_csv .gitignore 4000000000 true gitignore true "list of files that should not be committed under git" \
>> "$TMP_MANIFEST_CSV"
# if try.sh does not exist, copy example over, otherwise just update
# manifest
#
if [[ ! -f $TRY_SH ]]; then
if [[ $V_FLAG -ge 3 ]]; then
echo "$0: debug[3]: about to run: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH" 1>&2
cp -f -p -v "$YYYY_DIR/$PROG_C" "$TRY_SH"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p -v $TEMPLATE_TRY_SH $TRY_SH failed," \
"error code: $status" 1>&2
exit 55
fi
else
cp -f -p "$TEMPLATE_TRY_SH" "$TRY_SH"
status="$?"
if [[ $status -ne 0 ]]; then
echo "$0: ERROR: cp -f -p $TEMPLATE_TRY_SH $TRY_SH failed," \
"error code: $status" 1>&2
exit 56
fi
fi
fi
# write manifest csv line for try.sh
#
((++count))
manifest_csv try.sh 100 true shellscript true "script to try entry" \
>> "$TMP_MANIFEST_CSV"
# form .path if needed
#
if [[ ! -f $DOT_PATH ]]; then
+18 -7
View File
@@ -788,9 +788,8 @@ or <a href="https://unix.org/online.html">later SUS</a>.</p>
<h3 id="q-0.3-what-should-i-put-in-my-submission-makefile">Q 0.3: What should I put in my submission Makefile?</h3>
</div>
</div>
<p>We recommend starting with the <a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">sample
<p>We recommend starting with the <a href="next/Makefile.example">sample
Makefile</a>
as found in the <a href="https://github.com/ioccc-src/mkiocccentry">mkiocccentry GitHub repo</a>,
(renamed as <code>Makefile</code> of course) as a starting point for your
entry’s <code>Makefile</code>.</p>
<p>The <code>Makefile</code> is a file used by the <code>make(1)</code> command that contains
@@ -835,9 +834,16 @@ program(s), clean up any files made by the program etc.</li>
</ul></li>
<li><code>try</code>
<ul>
<li>run the program in a way you suggest</li>
<li>run the program in a way you suggest. If you use the <code>try.sh</code> script
system, which we do like, you can have this rule invoke the script
(<code>./try.sh</code>).</li>
</ul></li>
</ul>
<p>Although the <code>mkiocccentry(1)</code> tool only checks for those rules, the most up to
date
<a href="next/Makefile.example">Makefile.example</a>,
does have other rules like <code>everything</code> and <code>alt</code>, and we encourage you to use
that one.</p>
<p>Jump to: <a href="#">top</a></p>
<div id="remarks_md">
<div id="remarks">
@@ -898,6 +904,9 @@ interesting or less likely to win, but we do enjoy interesting and creative uses
of submissions.</p>
<p>If you have alternate code that you are including, then you can use the
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/template/entry/try.alt.sh">try.alt.sh template</a> instead.</p>
<p>We recommend that you include the use of these scripts in the <code>try</code> rule in the
example Makefile that you modify for your submission. See the
FAQ on “<a href="#makefile">submission Makefiles</a>.</p>
<p>Jump to: <a href="#">top</a></p>
<hr style="width:50%;text-align:left;margin-left:0">
<hr style="width:50%;text-align:left;margin-left:0">
@@ -3079,10 +3088,9 @@ toolkit, which includes the IOCCC version of the <code>jparse(1)</code> tool, lo
under the <code>mkiocccentry</code> directory as <code>jparse/jparse</code>.</p>
<p>Additionally you may install the <code>jparse(1)</code> tool from the <a href="https://github.com/xexyl/jparse">jparse
repo</a>:</p>
<pre class="&lt;!--sh--&gt;"><code> git clone https://github.com/xexyl/jparse.git
cd jparse
make clobber all test
sudo make install</code></pre>
<pre class="&lt;!--sh--&gt;"><code> git clone https://github.com/ioccc-src/mkiocccentry.git
cd mkiocccentry &amp;&amp; make clobber all&quot; 1&gt;&amp;2
cd jparse &amp;&amp; sudo make install clobber&quot; 1&gt;&amp;2</code></pre>
<p>The syntax of <code>jparse(1)</code> is very simple:</p>
<pre class="&lt;!--sh--&gt;"><code> jparse foo.json</code></pre>
<p>If the tool exits 0 then the document is valid JSON; otherwise it’ll
@@ -3092,6 +3100,9 @@ verbosity with the <code>-v</code> option. For instance:</p>
<pre class="&lt;!--sh--&gt;"><code> jparse -v 3 foo.json</code></pre>
<p>If the tool is not installed then you will obviously have to specify the path of
the tool.</p>
<p><strong>NOTE</strong>: the <code>jparse</code> subdirectory is a clone of the official <a href="https://github.com/xexyl/jparse/issues">jparse
repo</a> but we recommend you compile and
install via the <code>mkiocccentry</code> repo because it has the dependencies built in.</p>
<p>Jump to: <a href="#">top</a></p>
<hr style="width:50%;text-align:left;margin-left:0">
<hr style="width:50%;text-align:left;margin-left:0">
+21 -7
View File
@@ -460,8 +460,7 @@ Jump to: [top](#)
</div>
We recommend starting with the [sample
Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)
as found in the [mkiocccentry GitHub repo](https://github.com/ioccc-src/mkiocccentry),
Makefile](next/Makefile.example)
(renamed as `Makefile` of course) as a starting point for your
entry's `Makefile`.
@@ -508,7 +507,15 @@ The following rules should exist in your Makefile:
program(s), clean up any files made by the program etc.
- `try`
* run the program in a way you suggest
* run the program in a way you suggest. If you use the `try.sh` script
system, which we do like, you can have this rule invoke the script
(`./try.sh`).
Although the `mkiocccentry(1)` tool only checks for those rules, the most up to
date
[Makefile.example](next/Makefile.example),
does have other rules like `everything` and `alt`, and we encourage you to use
that one.
Jump to: [top](#)
@@ -587,6 +594,10 @@ of submissions.
If you have alternate code that you are including, then you can use the
[try.alt.sh template](%%REPO_URL%%/template/entry/try.alt.sh) instead.
We recommend that you include the use of these scripts in the `try` rule in the
example Makefile that you modify for your submission. See the
FAQ on "[submission Makefiles](#makefile).
Jump to: [top](#)
@@ -3299,10 +3310,9 @@ Additionally you may install the `jparse(1)` tool from the [jparse
repo](https://github.com/xexyl/jparse):
``` <!--sh-->
git clone https://github.com/xexyl/jparse.git
cd jparse
make clobber all test
sudo make install
git clone https://github.com/ioccc-src/mkiocccentry.git
cd mkiocccentry && make clobber all" 1>&2
cd jparse && sudo make install clobber" 1>&2
```
The syntax of `jparse(1)` is very simple:
@@ -3325,6 +3335,10 @@ verbosity with the `-v` option. For instance:
If the tool is not installed then you will obviously have to specify the path of
the tool.
**NOTE**: the `jparse` subdirectory is a clone of the official [jparse
repo](https://github.com/xexyl/jparse/issues) but we recommend you compile and
install via the `mkiocccentry` repo because it has the dependencies built in.
Jump to: [top](#)
<hr style="width:50%;text-align:left;margin-left:0">
File renamed without changes.
+23 -19
View File
@@ -465,7 +465,7 @@ writing by <a href="../contact.html">contacting the judges</a>.</p>
</div>
</div>
<p class="leftbar">
These <a href="guidelines.html">IOCCC guidelines</a> are version <strong>28.21 2024-11-27</strong>.
These <a href="guidelines.html">IOCCC guidelines</a> are version <strong>28.23 2024-12-01</strong>.
</p>
<p><strong>IMPORTANT</strong>: Be <strong>SURE</strong> to read the <a href="rules.html">IOCCC rules</a>.</p>
<p>Jump to: <a href="#">top</a></p>
@@ -551,11 +551,9 @@ repo</a>.
to account for the new <a href="https://github.com/ioccc-src/mkiocccentry">mkiocccentry repo</a> tools.
</p>
<p class="leftbar">
An <a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">example
Makefile</a>
is now available from the <a href="https://github.com/ioccc-src/mkiocccentry">mkiocccentry
repo</a> <strong>and you are encouraged to use
it</strong>.
You <strong>are encouraged</strong> to use <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">this
Makefile.example</a>,
rather than the one at the <code>mkiocccentry</code> repo.
</p>
<p class="leftbar">
The IOCCC submission URL, <a href="../status.html#open">when the IOCCC is open</a>, is
@@ -941,15 +939,14 @@ that’s OK too!
<h1 id="makefiles">Makefiles</h1>
</div>
<p class="leftbar">
<p>We <strong>recommend</strong> that you use the <a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">example
Makefile</a>
from the <a href="https://github.com/ioccc-src/mkiocccentry">IOCCC mkiocccentry repo</a>,
<p>We <strong>recommend</strong> that you use the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">example
Makefile</a>,
renamed as <code>Makefile</code> of course, as the starting point for your submission’s
required <code>Makefile</code>. Feel free to modify the <code>Makefile</code> to suit your obfuscated
needs.</p>
<p class="leftbar">
The rest of this section will assume that you are using some variant of the
<a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">example Makefile</a>,
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">example Makefile</a>,
renamed as <code>Makefile</code> of course.
</p>
<p class="leftbar">
@@ -1092,19 +1089,23 @@ Again, please note that in macOS, <code>/usr/bin/gcc</code> is actually <code>cl
</div>
<p class="leftbar">
We <strong>LIKE</strong> submissions that use an edited variant of the
<a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">example Makefile</a>,
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">example Makefile</a>,
renamed as <code>Makefile</code> of course. This makes it easier for the <a href="../judges.html">IOCCC Judges</a>
to test your submission. And if your submissions wins, it makes it easier to integrate it into
the <a href="https://www.ioccc.org/index.html">Official IOCCC winner website</a>.
</p>
<p class="leftbar">
We <strong>LIKE</strong> submissions that use an edited version of the
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/template/entry/try.sh">try.sh</a> template script (and if you have alternate code,
the same applies with the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/template/entry/try.alt.sh">try.alt.sh</a>
template script). Of course, it is
quite possible that only one invocation is possible, so it is not necessarily
detrimental to your submission if you do not include one, though we do like
interesting and creative uses of submissions. See also the
<a href="../template/entry/try.sh">../template/entry/try.sh</a> example script (and if you have alternate code,
the same applies with the <a href="../template/entry/try.alt.sh">try.alt.sh</a>
example script). Of course, it is quite possible that only one invocation is
possible, so it is not necessarily detrimental to your submission if you do not
include one, though we do like interesting and creative uses of submissions. See
also the
</p>
<p class="leftbar">
You might wish to add <code>./try.sh</code>, and if you have alternate code,
<code>./try.alt.sh</code>, to the <code>try</code> rule in the Makefile you submit. See also the
FAQ on “<a href="../faq.html#try_scripts">submitting try.sh and try.alt.sh scripts</a>”.
</p>
<p>Doing masses of <code>#define</code>s to obscure the source has become ‘old’. We
@@ -1339,7 +1340,7 @@ they do not work as documented.</p>
is NOT the smallest C source file that when compiled and run, dumps core:</p>
<pre><code> main;</code></pre>
<p class="leftbar">
Unless you specify <code>-fwritable-strings</code> (see <code>COTHER</code> in the <a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">example
Unless you specify <code>-fwritable-strings</code> (see <code>COTHER</code> in the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">example
Makefile</a>)
do not assume this sort of code will work:
</p>
@@ -1347,6 +1348,9 @@ do not assume this sort of code will work:
...
T[14] = &#39;;&#39;; /* modifying a string requires: -fwritable-strings */</code></pre>
<p class="leftbar">
Even so, one should probably not assume that this is universally accepted.
</p>
<p class="leftbar">
Initialized char arrays are OK to write over. For instance, this is OK:
</p>
<pre><code> char b[] = &quot;Is this OK&quot;;
@@ -1559,7 +1563,7 @@ CPU, we might just try your submission on that emulator as well :-)
<p class="leftbar">
If your submission <strong>MUST</strong> run only on a 64-bit or 32-bit architecture,
then you <strong>MUST</strong> specify the <code>-arch</code> on your command line
(see <code>ARCH</code> in the <a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">example
(see <code>ARCH</code> in the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">example
Makefile</a>). Do not assume a processor word size without specifying <code>-arch</code>. For example:
</p>
<pre><code> ARCH= -m64</code></pre>
+24 -18
View File
@@ -52,7 +52,7 @@ Jump to: [top](#)
</div>
<p class="leftbar">
These [IOCCC guidelines](guidelines.html) are version **28.21 2024-11-27**.
These [IOCCC guidelines](guidelines.html) are version **28.23 2024-12-01**.
</p>
**IMPORTANT**: Be **SURE** to read the [IOCCC rules](rules.html).
@@ -160,11 +160,9 @@ to account for the new [mkiocccentry repo](https://github.com/ioccc-src/mkioccce
</p>
<p class="leftbar">
An [example
Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)
is now available from the [mkiocccentry
repo](https://github.com/ioccc-src/mkiocccentry) **and you are encouraged to use
it**.
You **are encouraged** to use [this
Makefile.example](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example),
rather than the one at the `mkiocccentry` repo.
</p>
<p class="leftbar">
@@ -649,15 +647,14 @@ that's OK too!
<p class="leftbar">
We **recommend** that you use the [example
Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)
from the [IOCCC mkiocccentry repo](https://github.com/ioccc-src/mkiocccentry),
Makefile](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example),
renamed as `Makefile` of course, as the starting point for your submission's
required `Makefile`. Feel free to modify the `Makefile` to suit your obfuscated
needs.
<p class="leftbar">
The rest of this section will assume that you are using some variant of the
[example Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example),
[example Makefile](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example),
renamed as `Makefile` of course.
</p>
@@ -863,7 +860,7 @@ Jump to: [top](#)
<p class="leftbar">
We **LIKE** submissions that use an edited variant of the
[example Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example),
[example Makefile](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example),
renamed as `Makefile` of course. This makes it easier for the [IOCCC Judges](../judges.html)
to test your submission. And if your submissions wins, it makes it easier to integrate it into
the [Official IOCCC winner website](https://www.ioccc.org/index.html).
@@ -871,12 +868,17 @@ the [Official IOCCC winner website](https://www.ioccc.org/index.html).
<p class="leftbar">
We **LIKE** submissions that use an edited version of the
[try.sh](%%REPO_URL%%/template/entry/try.sh) template script (and if you have alternate code,
the same applies with the [try.alt.sh](%%REPO_URL%%/template/entry/try.alt.sh)
template script). Of course, it is
quite possible that only one invocation is possible, so it is not necessarily
detrimental to your submission if you do not include one, though we do like
interesting and creative uses of submissions. See also the
[../template/entry/try.sh](../template/entry/try.sh) example script (and if you have alternate code,
the same applies with the [try.alt.sh](../template/entry/try.alt.sh)
example script). Of course, it is quite possible that only one invocation is
possible, so it is not necessarily detrimental to your submission if you do not
include one, though we do like interesting and creative uses of submissions. See
also the
</p>
<p class="leftbar">
You might wish to add `./try.sh`, and if you have alternate code,
`./try.alt.sh`, to the `try` rule in the Makefile you submit. See also the
FAQ on "[submitting try.sh and try.alt.sh scripts](../faq.html#try_scripts)".
</p>
@@ -1159,7 +1161,7 @@ is NOT the smallest C source file that when compiled and run, dumps core:
<p class="leftbar">
Unless you specify `-fwritable-strings` (see `COTHER` in the [example
Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example))
Makefile](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example))
do not assume this sort of code will work:
</p>
@@ -1169,6 +1171,10 @@ do not assume this sort of code will work:
T[14] = ';'; /* modifying a string requires: -fwritable-strings */
```
<p class="leftbar">
Even so, one should probably not assume that this is universally accepted.
</p>
<p class="leftbar">
Initialized char arrays are OK to write over. For instance, this is OK:
</p>
@@ -1420,7 +1426,7 @@ CPU, we might just try your submission on that emulator as well :-)
If your submission **MUST** run only on a 64-bit or 32-bit architecture,
then you **MUST** specify the `-arch` on your command line
(see `ARCH` in the [example
Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example)). Do not assume a processor word size without specifying `-arch`. For example:
Makefile](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example)). Do not assume a processor word size without specifying `-arch`. For example:
</p>
``` <!---make-->
+3 -3
View File
@@ -466,7 +466,7 @@ writing by <a href="../contact.html">contacting the judges</a>.</p>
</div>
<p>Jump to: <a href="#">top</a></p>
<p class="leftbar">
These <a href="rules.html">IOCCC rules</a> are version <strong>28.10 2024-10-25</strong>.
These <a href="rules.html">IOCCC rules</a> are version <strong>28.11 2024-12-01</strong>.
</p>
<p><strong>IMPORTANT</strong>: Be sure to read the <a href="guidelines.html">IOCCC guidelines</a>.</p>
<p>Jump to: <a href="#">top</a></p>
@@ -905,7 +905,7 @@ those requirements.
<p class="leftbar">
The <code>Makefile</code> <strong>MUST</strong> be a <strong>non</strong>-empty file in <strong><a href="https://www.gnu.org/software/make/manual/make.html">GNU
Makefile</a></strong> form. See the
<a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">Makefile.example</a>,
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">Makefile.example</a>,
the
FAQ on “<a href="../faq.html#submission_makefiles">submission Makefile</a>”
and the
@@ -1092,7 +1092,7 @@ make(1) compatibility the IOCCC
supports</a> for more details.</p>
<p class="leftbar">
You are <strong>ENCOURAGED</strong> to use
<a href="https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example">Makefile.example</a>,
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example">Makefile.example</a>,
renamed as <code>Makefile</code> of course, for help in constructing your <code>Makefile</code>.
</p>
<p>The target of the Makefile must be called <code>prog</code>. The original
+3 -3
View File
@@ -57,7 +57,7 @@ Jump to: [top](#)
Jump to: [top](#)
<p class="leftbar">
These [IOCCC rules](rules.html) are version **28.10 2024-10-25**.
These [IOCCC rules](rules.html) are version **28.11 2024-12-01**.
</p>
**IMPORTANT**: Be sure to read the [IOCCC guidelines](guidelines.html).
@@ -607,7 +607,7 @@ those requirements.
<p class="leftbar">
The `Makefile` **MUST** be a **non**-empty file in **[GNU
Makefile](https://www.gnu.org/software/make/manual/make.html)** form. See the
[Makefile.example](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example),
[Makefile.example](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example),
the
FAQ on "[submission Makefile](../faq.html#submission_makefiles)"
and the
@@ -812,7 +812,7 @@ supports](../faq.html#make_compatibility) for more details.
<p class="leftbar">
You are **ENCOURAGED** to use
[Makefile.example](https://github.com/ioccc-src/mkiocccentry/blob/master/Makefile.example),
[Makefile.example](https://github.com/ioccc-src/temp-test-ioccc/blob/master/next/Makefile.example),
renamed as `Makefile` of course, for help in constructing your `Makefile`.
</p>
+39 -15
View File
@@ -1,32 +1,56 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC entry abstract alternate code
#
# NOTE: if your submission wins and become an entry, 'abstract' will be changed
# to the YYYY/directory name. You can remove this comment if you wish but if not
# it'll be done by the judges.
# try.alt.sh - demonstrate IOCCC entry YYYY/foo alternate code
# XXX - try.alt.sh example version: 1.0.0-1 11-28-2024 - XXX
#
# XXX - NOTE: if your submission wins and become an entry, then - XXX
# XXX - YYYY/foo will be changed to the 4 digit year and directory - XXX
# XXX - name. - XXX
# XXX - NOTE: please remove the XXX lines in this file, including this one - XXX
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
# XXX - if you need CC to be something else for some reason, say clang, - XXX
# XXX - then change "cc" to that or whatever you need. - XXX
# XXX - If you need other variables you can also set them in whatever way - XXX
# XXX - you need; this is a good method, however, in cases where it's OK - XXX
# XXX - to let the user redefine it. - XXX
[[ -z "$CC" ]] && CC="cc"
# XXX - make sure to compile the alt code, using make alt! - XXX
# XXX - if you need to build the main program for the try.alt.sh script, - XXX
# XXX - then change the 'alt' to 'all alt' in the below command. - XXX
# XXX - Later, if the submission wins, it can be changed to 'everything'. - XXX
make CC="$CC" alt >/dev/null || exit 1
# XXX - it's usually a good idea to clear the screen but if not done - XXX
# XXX - then you should remove the comment about it and the command. - XXX
# clear screen after compilation so that only the entry is shown
clear
# XXX - Invoke the program in one or more ways - XXX
# XXX - It is good to use the shell built-in read to let the user - XXX
# XXX - read what will happen and then proceed as they wish. - XXX
# XXX - You may modify the command based on your program and you - XXX
# XXX - may provide more than one invocation. - XXX
# XXX - Please remove the XXX lines - XXX
# XXX - an example follows - XXX
# XXX - Invoke the program in one or more ways - XXX
# XXX - NOTE: you can include more than one command line and you - XXX
# XXX - certainly can include pipelines. - XXX
# XXX - It is good to use the shell built-in read(1) to - XXX
# XXX - let the user know what is about to be done, as - XXX
# XXX - shown below, so they can proceed when ready. - XXX
# XXX - You may modify the command based on your program and you - XXX
# XXX - may provide more than one invocation. - XXX
# XXX - Examples follow. - XXX
# XXX - if the prompt will not be too long, say more than 80 chars - XXX
# XXX - or so: - XXX
read -r -n 1 -p "Press any key to run: ./prog.alt: "
echo 1>&2
./prog.alt
# XXX - Otherwise, for longer command lines, you might try: - XXX
echo "$ ./prog.alt some long command line"
read -r -n 1 -p "Press any key to continue: "
./prog.alt some long command line
+40 -15
View File
@@ -1,32 +1,57 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC entry abstract
#
# NOTE: if your submission wins and become an entry, 'abstract' will be changed
# to the YYYY/directory name. You can remove this comment if you wish but if not
# it'll be done by the judges.
# try.sh - demonstrate IOCCC entry YYYY/foo
# XXX - try.sh example version: 1.0.0-1 11-28-2024 - XXX
# XXX - NOTE: if your submission wins and become an entry, then - XXX
# XXX - YYYY/foo will be changed to the 4 digit year and directory - XXX
# XXX - name. - XXX
# XXX - NOTE: please remove the XXX lines in this file, including this one - XXX
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
# XXX - if you need CC to be something else, say clang, then change cc - XXX
# XXX - to whatever you need. - XXX
# XXX - If you need other variables you can also set them in whatever way - XXX
# XXX - you need; this is a good method, however, in cases where it's OK - XXX
# XXX - to let the user redefine it. - XXX
[[ -z "$CC" ]] && CC="cc"
# XXX - make sure to compile the program, using make all! - XXX
# XXX - if you need to build the alt code for the try.sh script, - XXX
# XXX - then change the 'all' to 'all alt' in the below command. - XXX
# XXX - Later, if the submission wins, it can be changed to 'everything'. - XXX
make CC="$CC" all >/dev/null || exit 1
# XXX - it's usually a good idea to clear the screen but if not done - XXX
# XXX - then you should remove the comment about it and the command. - XXX
# clear screen after compilation so that only the entry is shown
clear
# XXX - Invoke the program in one or more ways - XXX
# XXX - It is good to use the shell built-in read to let the user - XXX
# XXX - read what will happen and then proceed as they wish. - XXX
# XXX - You may modify the command based on your program and you - XXX
# XXX - may provide more than one invocation. - XXX
# XXX - Please remove the XXX lines - XXX
# XXX - an example follows - XXX
# XXX - Invoke the program in one or more ways - XXX
# XXX - NOTE: you can include more than one command line and you - XXX
# XXX - certainly can include pipelines. - XXX
# XXX - It is good to use the shell built-in read(1) to - XXX
# XXX - let the user know what is about to be done, as - XXX
# XXX - shown below, so they can proceed when ready. - XXX
# XXX - You may modify the command based on your program and you - XXX
# XXX - may provide more than one invocation. - XXX
# XXX - Examples follow. - XXX
# XXX - if the prompt will not be too long, say more than 80 chars - XXX
# XXX - or so: - XXX
read -r -n 1 -p "Press any key to run: ./prog: "
echo 1>&2
./prog
# XXX - Otherwise, for longer command lines, you might try: - XXX
echo "$ ./prog some long command line"
read -r -n 1 -p "Press any key to continue: "
./prog some long command line
+3
View File
@@ -5125,6 +5125,9 @@ manually.</p>
more easily run programs. It is not always useful but these scripts do a variety
of things to really show off the entries, so this really helps with the
presentation of the winning entries.</p>
<p>Cody also added the example scripts for future submitters,
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/template/entry/try.sh">try.sh</a> and
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/template/entry/try.alt.sh">try.alt.sh</a>.</p>
<p>Jump to: <a href="#">top</a></p>
<div id="website_improvements">
<h2 id="website-and-manifest-improvements">Website and manifest improvements</h2>
+4
View File
@@ -7038,6 +7038,10 @@ more easily run programs. It is not always useful but these scripts do a variety
of things to really show off the entries, so this really helps with the
presentation of the winning entries.
Cody also added the example scripts for future submitters,
[try.sh](%%REPO_URL%%/template/entry/try.sh) and
[try.alt.sh](%%REPO_URL%%/template/entry/try.alt.sh).
Jump to: [top](#)