Add 2015/endoh3/try.sh + format/typo checks

A new make rule (or alias for mullender and back_to) called 'future' was
added for the theme. The try.sh script uses make future ('back_to' just
doesn't look that good in my eyes even when I added it).

The try.sh tries to stay in character with the award theme a bit too
though that will only be noticeable if you pay attention. I found the
films very boring (though maybe years later I would find it more
enjoyable) so I'm sure that something more fun could have been
added if I knew them more but I do not. Well I tried anyway.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-08 10:20:44 -08:00
1 parent 29903d763b
commit d9b2810392
4 files changed
+50 -10

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ all: data ${TARGET}
${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
mullender back_to: ${PROG}.c mullender.c
future mullender back_to: ${PROG}.c mullender.c
${CC} ${CFLAGS} $< -o ${PROG} ${LDFLAGS} ${BACK_TO}
+9 -7
View File
@@ -17,14 +17,12 @@ make
To see the original [mullender](mullender.c) in action:
```sh
cc -o prog prog.c mullender.c # or make mullender or make back_to
./prog
q
^C # where ^C is ctrl-C, interrupt.
./try.sh
```
Observe what happens when you hit enter or another character! Send INTR to end
the program.
Observe what happens when you hit enter or another character! You might even try
typing out, one character at a time, `1984/mullender`, and then see what it looks
like at the end. Send INTR to end the program.
More generally use:
@@ -34,7 +32,7 @@ cc -o prog prog.c foo.c
^C # if necessary, where ^C is ctrl-C, interrrupt
```
to run `prog` as whatever foo.c is in the joke PDP-11 emulator.
to compile and run `prog` as whatever foo.c is in the joke PDP-11 emulator.
## Judges' remarks:
@@ -55,6 +53,7 @@ clue, see the end of the author's remarks.) If in doubt, use
## Author's remarks:
### Hint / Compatibility
* A little-endian system is required due to an external factor.
@@ -65,6 +64,7 @@ the same reason. But I believe it is reasonably portable.
the source code from all angles..
* Find `main()` function.
### Spoiler
This program is a joke PDP-11 emulator. ("ll-dpd" is embedded in the code.
@@ -80,6 +80,7 @@ clang -o prog prog.c mullender.c
You can enjoy the legendary winner of the first IOCCC, again.
### Internal
This program uses `__attribute__((constructor))`, which is a GCC extension, to
@@ -104,6 +105,7 @@ needed for [mullender.c](mullender.c) to work:
* 4: Auto-decrement deferred
* 6: Index (incomplete)
### Limitations
Non-trivial combination of instruction and addressing mode may cause undefined
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 2015/endoh3
#
# 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
# clear screen so that only the entry is shown
clear
read -r -n 1 -p "Press any key to run: less -EXF prog.c (space = next page, q = quit): "
echo 1>&2
less -EXF prog.c
echo 1>&2
echo "$ make future" 1>&2
make future || exit 1
echo 1>&2
echo 1>&2
echo "Will go back to the future and run 1984/mullender through prog. To quit" 1>&2
echo "the program hit ctrl-c/intr." 1>&2
echo 1>&2
echo "You might want to try hitting enter or another key when the output reaches" 1>&2
echo "the end of the line." 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "$ ./prog" 1>&2
./prog
+4 -2
View File
@@ -3818,9 +3818,11 @@ they avoided.
symbols of `main()`. The fix is through the compiler option `-fcommon` which
will let it compile like it does with macOS.
Cody also made it easier to enjoy the theme of [Back to the
Cody also added the [try.sh](2015/endoh3/try.sh) script which makes use of the
make rule he added (to enjoy the theme of the entry, [Back to the
Future](https://en.wikipedia.org/wiki/Back_to_the_Future) using this entry by
simply typing `make back_to` or `make mullender`.
simply typing `make back_to` or `make mullender`) and then runs the famous
[1984/mullender.c](/1984/mullender/mullender.c).
## [2015/hou](2015/hou/prog.c) ([README.md](2015/hou/README.md))