From 28493e9a0e759cf7557a505152f7cdfb52b3a5bf Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:30:26 -0800 Subject: [PATCH] Add try.sh/try.alt.sh template scripts The scripts can be found under template/entry. A new FAQ entry has been added and the guidelines have been updated. The rules have a new div id ("version") to match what was added to guidelines yesterday (since it's obvious what kind of version it is. Once this has been merged html files need to be checked to make sure everything is okay. --- faq.html | 19 +++++++++++++++++++ faq.md | 28 +++++++++++++++++++++++++++- next/guidelines.html | 14 ++++++++++++-- next/guidelines.md | 15 +++++++++++++-- next/rules.html | 2 ++ next/rules.md | 2 ++ template/entry/try.alt.sh | 32 ++++++++++++++++++++++++++++++++ template/entry/try.sh | 32 ++++++++++++++++++++++++++++++++ 8 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 template/entry/try.alt.sh create mode 100644 template/entry/try.sh diff --git a/faq.html b/faq.html index e2cc4d9b4..e07c66971 100644 --- a/faq.html +++ b/faq.html @@ -439,6 +439,7 @@
  • Q 0.2: What platform should I assume for my submission?
  • Q 0.3: What should I put in my submission Makefile?
  • Q 0.4: What should I put in the remarks.md file of my submission?
  • +
  • Q 0.5: What should I do with the try.sh and try.alt.sh scripts?
  • 1. Entering the IOCCC: more help and details

    Jump to: top

    +
    +

    Q 0.5 What should I do with the try.sh and try.alt.sh scripts?

    +
    +

    If your submission has more than one use, or if you have interesting ways to +invoke your program, perhaps using other commonly installed tools (or tools +included in your submission), it can be helpful to include a try.sh script.

    +

    A template try.sh can be used as a +starting point, or you can look at some of the others in the website, to get +some ideas.

    +

    It is not detrimental to your chances of winning if you do not include one as +not all submissions can make use of them. Nevertheless, it is helpful to include +ways to use your program, and if you have creative ways this can be a bonus. It +does not mean that a program that cannot be used with other programs is less +interesting or less likely to win, but we do enjoy interesting and creative uses +of submissions.

    +

    If you have alternate code that you are including, then you can use the +try.alt.sh template instead.

    +

    Jump to: top



    diff --git a/faq.md b/faq.md index d40fdb5bd..71230c8e9 100644 --- a/faq.md +++ b/faq.md @@ -13,6 +13,7 @@ This is FAQ version **28.1.3 2024-10-25**. - **Q 0.2**: What platform should I assume for my submission? - **Q 0.3**: What should I put in my submission Makefile? - **Q 0.4**: What should I put in the remarks.md file of my submission? +- **Q 0.5**: What should I do with the `try.sh` and `try.alt.sh` scripts? ## 1. [Entering the IOCCC: more help and details](#submitting_help) @@ -511,7 +512,6 @@ The following rules should exist in your Makefile: Jump to: [top](#) -
    @@ -562,6 +562,32 @@ rounds; we look at the author name only if an entry wins. See the guidelines if this is not clear! - leaving the remark section empty. +Jump to: [top](#) + + +
    +### Q 0.5 What should I do with the `try.sh` and `try.alt.sh` scripts? +
    + +If your submission has more than one use, or if you have interesting ways to +invoke your program, perhaps using other commonly installed tools (or tools +included in your submission), it can be helpful to include a `try.sh` script. + +A [template try.sh](%%REPO_URL%%/template/entry/try.sh) can be used as a +starting point, or you can look at some of the others in the website, to get +some ideas. + +It is not detrimental to your chances of winning if you do not include one as +not all submissions can make use of them. Nevertheless, it is helpful to include +ways to use your program, and if you have creative ways this can be a bonus. It +does not mean that a program that cannot be used with other programs is less +interesting or less likely to win, but we do enjoy interesting and creative uses +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. + + Jump to: [top](#)
    diff --git a/next/guidelines.html b/next/guidelines.html index 82477ae56..977607053 100644 --- a/next/guidelines.html +++ b/next/guidelines.html @@ -465,7 +465,7 @@ writing by contacting the judges.

    -These IOCCC guidelines are version 28.20 2024-11-26. +These IOCCC guidelines are version 28.21 2024-11-27.

    IMPORTANT: Be SURE to read the IOCCC rules.

    Jump to: top

    @@ -1091,12 +1091,22 @@ Again, please note that in macOS, /usr/bin/gcc is actually cl

    -We LIKE entries that use an edited variant of the +We LIKE submissions that use an edited variant of the example Makefile, renamed as Makefile of course. This makes it easier for the IOCCC Judges to test your submission. And if your submissions wins, it makes it easier to integrate it into the Official IOCCC winner website.

    +

    +We LIKE submissions that use an edited version of the +try.sh template script (and if you have alternate code, +the same applies with the 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 +FAQ on “submitting try.sh and try.alt.sh scripts”. +

    Doing masses of #defines to obscure the source has become ‘old’. We tend to ‘see thru’ masses of #defines due to our pre-processor tests that we apply. Simply abusing #defines or -Dfoo=bar won’t go as far diff --git a/next/guidelines.md b/next/guidelines.md index dc526176d..a73ec5cd2 100644 --- a/next/guidelines.md +++ b/next/guidelines.md @@ -52,7 +52,7 @@ Jump to: [top](#)

    -These [IOCCC guidelines](guidelines.html) are version **28.20 2024-11-26**. +These [IOCCC guidelines](guidelines.html) are version **28.21 2024-11-27**.

    **IMPORTANT**: Be **SURE** to read the [IOCCC rules](rules.html). @@ -862,13 +862,24 @@ Jump to: [top](#)

    -We **LIKE** entries that use an edited variant of the +We **LIKE** submissions that use an edited variant of the [example Makefile](https://github.com/ioccc-src/mkiocccentry/blob/master/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).

    +

    +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 +FAQ on "[submitting try.sh and try.alt.sh scripts](../faq.html#try_scripts)". +

    + Doing masses of `#define`s to obscure the source has become 'old'. We tend to 'see thru' masses of `#define`s due to our pre-processor tests that we apply. Simply abusing `#define`s or `-Dfoo=bar` won't go as far diff --git a/next/rules.html b/next/rules.html index 294652eba..41c82aaf3 100644 --- a/next/rules.html +++ b/next/rules.html @@ -460,8 +460,10 @@ and remains unaltered. All other uses must receive prior permission in writing by contacting the judges.

    Jump to: top

    +

    IOCCC Rules version

    +

    Jump to: top

    These IOCCC rules are version 28.10 2024-10-25. diff --git a/next/rules.md b/next/rules.md index ad8e02388..a02271cf6 100644 --- a/next/rules.md +++ b/next/rules.md @@ -49,8 +49,10 @@ writing by [contacting the judges](../contact.html). Jump to: [top](#)

    +
    ## IOCCC Rules version
    +
    Jump to: [top](#) diff --git a/template/entry/try.alt.sh b/template/entry/try.alt.sh new file mode 100644 index 000000000..824d31885 --- /dev/null +++ b/template/entry/try.alt.sh @@ -0,0 +1,32 @@ +#!/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. +# + +# 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 + +make CC="$CC" alt >/dev/null || exit 1 + +# 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 + +read -r -n 1 -p "Press any key to run: ./prog.alt: " +echo 1>&2 +./prog.alt diff --git a/template/entry/try.sh b/template/entry/try.sh new file mode 100644 index 000000000..096e1c13a --- /dev/null +++ b/template/entry/try.sh @@ -0,0 +1,32 @@ +#!/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. +# + +# 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 + +make CC="$CC" all >/dev/null || exit 1 + +# 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 + +read -r -n 1 -p "Press any key to run: ./prog: " +echo 1>&2 +./prog