From d0b357e4c55c21a49266daed24163e34609e541b Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 30 Apr 2023 08:45:29 -0700 Subject: [PATCH] Format fix 2006/hamre/README.md + update bugs.md There are a few 'issues' that are INABIAF so these were noted in the README.md and the bugs.md. You might find some punning there. --- 2006/hamre/README.md | 34 +++++++++++++++++++++++----------- bugs.md | 12 ++++++++++++ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/2006/hamre/README.md b/2006/hamre/README.md index 5978c5ee7..b108814ec 100644 --- a/2006/hamre/README.md +++ b/2006/hamre/README.md @@ -1,7 +1,7 @@ # Most Irrational - Steinar Hamre - Norway +Steinar Hamre +Norway ## To build: @@ -21,28 +21,40 @@ make ./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2' ``` +### INABIAF - it's not a bug it's a feature! :-) + +This program will very likely crash or do something completely irrational :-) if you +don't supply it with an argument. + +As well supplying more arguments will possibly limit the number of nested +operators supported. + +Don't try dividing by 0 (zero). + ## Judges' remarks: An irrationally coded source presents rational things! -A rational person might want to attempt the irrational task +A rational person might want to attempt the +[irrational](https://rationalwiki.org/wiki/Rationality) task of supporting a new operator by way of an existing macro in the source. And can you determine which macro this is and understand the purpose of its arguments? ## Author's remarks: -This is a calculator for rational numbers. Believe it or not, that is -a useful tool to have around, and I haven't found a useful version, -much less an obfuscated one. +This is a calculator for [rational +numbers](https://en.wikipedia.org/wiki/Rational_number). Believe it or not, that +is a useful tool to have around, and I haven't found a useful version, much less +an obfuscated one. -It is rather feature complete as rational calculators go. The +It is rather feature complete as [rational calculators go. The supported operators are: `+`, `-` (binary and unary), `*`, `/` and `()`. Run it by supplying an expression as the first argument, and the normalized result will be written to stdout. ```sh -$ ./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2' +./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2' 2/3 ``` @@ -50,7 +62,7 @@ If you do not supply an argument, the calculator will crash. Other arguments are ignored. Supplying more arguments may further limit the number of nested operators supported. -Remember that 1/0 is not a rational number. You will not get any +Remember that `1/0` is not a rational number. You will not get any answer if you divide by zero. By default, only 31 nested levels of operators are supported. @@ -62,9 +74,9 @@ comes to understanding the source. The preprocessed source becomes rather verbose. IOCCC entries are often loaded with all kinds of hard-coded numbers. I -have restricted myself to mostly use sensible numbers (<= 7) as +have restricted myself to mostly use sensible numbers (`<= 7`) as smaller numbers are much easier to remember. Also the macros really -help hiding most of the uses of these numbers away. All macros and +help hide most of the uses of these numbers away. All macros and variables are easy-to-remember single character abbreviations, from some language, meaningful to the purpose(s) of the macro, I hope. diff --git a/bugs.md b/bugs.md index 12dc6db02..6055e401e 100644 --- a/bugs.md +++ b/bugs.md @@ -1760,6 +1760,18 @@ to including the [IOCCC website](https://www.ioccc.org) itself. # 2006 + +## [2006/hamre](2006/hamre/hamre.c) ([README.md](2006/hamre/README.md)) +## STATUS: INABIAF - please **DO NOT** fix + +This program will very likely crash or do something completely irrational :-) if +you don't supply it with an argument. + +As well supplying more arguments will possibly limit the number of nested +operators supported. + +Don't try dividing by 0 (zero). + # 2007 # 2008 # 2009