diff --git a/2005/timwi/README.md b/2005/timwi/README.md index 330664d7b..ed6a87394 100644 --- a/2005/timwi/README.md +++ b/2005/timwi/README.md @@ -28,12 +28,10 @@ simple 3-character fix will make it slightly less so. Quite a few BF programs found on the Net expect byte-based memory, quite a few exceed the capacity of this interpreter, but there are many that work. Some -small [quines][] work, some don't. +small [quines](https://en.wikipedia.org/wiki/Quine_(computing)) work, some don't. Why? -[quines]: https://en.wikipedia.org/wiki/Quine_(computing) - ## Author's remarks: @@ -46,6 +44,7 @@ separated by whitespace (this will be the input to the BF program), then a `:` You must not pass any command-line arguments. + ### Features * Supports the complete set of 8 BF instructions (`+-<>[].,`). @@ -60,20 +59,22 @@ Use this to obfuscate your BF programs! * Ignores all whitespace (newlines, spaces and tabs) in the input program. + ### Limitations -Since the program, naturally, uses ints, the calculations must not exceed the -range of an int. (But then again, you can use the integer overflow to further +Since the program, naturally, uses `int`s, the calculations must not exceed the +range of an `int`. (But then again, you can use the integer overflow to further obfuscate your BF programs in creative ways!) You are limited to 3125 input integers and 3125 instructions. If you exceed one of these limits, the behaviour is undefined. + ### Obfuscations Some of the superficial obfuscations are pretty obvious: I'm using `#define`s to make everything look nice and lineal, and the program is merely a recursive -`main` function with only a single `return` statement which uses nested ternary +`main()` function with only a single `return` statement which uses nested ternary operators to make even the pre-processed code unreadable. However, the more subtle obfuscations relate to the way the program works. diff --git a/2005/timwi/try.sh b/2005/timwi/try.sh new file mode 100755 index 000000000..424826695 --- /dev/null +++ b/2005/timwi/try.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2005/timwi +# +# This only does one thing and that is from the judges. This is because +# brainfuck has too much potential to knacker the brain. +# + +# 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 + +echo "$ (echo \"20 : ,-->+.>+.<<[>[>>+>+<<<-]>[>>+>+<<<-]>"; \ + echo "[<+>-]>[<<<+>>>-]>[-]<<<<.<-]\") | ./timwi" 1>&2 + +(echo "20 : ,-->+.>+.<<[>[>>+>+<<<-]>[>>+>+<<<-]>"; echo "[<+>-]>[<<<+>>>-]>[-]<<<<.<-]") | ./timwi +echo 1>&2 +echo "Now please go take better care of your brain. You only get one." 1>&2 diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 69e81b935..1b78a8d02 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3023,6 +3023,12 @@ how https is set up, in which case just enjoy it for what it was. But there might be some command line that will let it work that way. +## [2005/timwi](2005/timwi/timwi.c) ([README.md](2005/timwi/README.md])) + +Cody added [try.sh](2005/timwi/try.sh). It only has one command as he doesn't +want to knacker his brain any more than it might or might not already be. + + ## [2005/toledo](2005/toledo/toledo.c) ([README.md](2005/toledo/README.md)) Cody fixed this to compile with some versions of clang which have an additional