NOTE: this is just one way to fix the problem described below but it can be modified - perhaps greatly changed - or rejected and done differently. That being said it does isolate the entries that can be modified except for the one by Simon Cooper as I had intended to do all entries before a commit but I am too tired to continue and there are more important things to be done for the IOCCC (hopefully later today). I don't mind but I wanted to save Landon some of the work as I started the problem even though all with good intention after Landon noted he wanted to thank those in the README.md files. First I would like to also apologise to any previous winners if there was upset or concern; this was all done with the best intentions and I know that it was a fine line but the judges' goal is to make it so previous entries do work in modern systems so that everyone can enjoy them. Still I am sorry if I caused any offence or anything else! I actually agree with the situation and I had been wondering about how to go about it too. Now for the rationale behind this update. A couple previous winners have voiced concern about the way the thank you notes are displayed in the README.md files I have started the work to save Landon some of the trouble as although it was with good intentions (and based on the note that Landon wanted to thank those who fixed an entry) I started the problem so it seems only right that I help rectify it. I also agree with the problem and had thought of it before, even thinking that in some entries it needs not have any reference to anyone but the winner! This commit has removed the thank you notes from several entries and added a THANKS.md file. The THANKS.md file has the rest of the entries that were fixed as well which should if nothing else help isolate the entries that need to be modified. Some entries actually referred to me but were not a thank you note due to a fix; some were from winners themselves for instance. Note that I did not update the bugs.md file or any other file that might refer to these things in the README.md files. The bugs.md for instance refers to adding credits to those who fix problems or provide missing links or files to the respective README.md files and this will have to change once the way this is done is finalised. But hopefully this is a help to Landon so that he may also focus on the important jprint tool in the mkiocccentry repo.
2.1 KiB
Best minimal use of C
Arch D. Robison
University of Illinois
1304 W. Springfield Ave.
Urbana, IL
61801
US
To build:
make all
To run:
./robison
# enter valid expressions
Try:
./robison
11x10
echo 1x10x111 | ./robison
echo 1+1+10 | ./robison
echo 100 - 1 | ./robison
echo -100 x 100 + 1 | ./robison
echo 100 / 100 | ./robison # <-- what happens here ?
NOTE: this entry will crash with numbers with non binary digits.
Judges' remarks:
Sites with punch card facilities will be happy to note that the source deck can be re-collated with an ASCII sort.
Note that this program uses only a small subset of the constructs that the C language supports.
NOTE: this entry will likely dump core with invalid input.
Author's remarks:
This program is a handy picoAPL interpreter written in C--. It outputs the evaluation of an APL expression from standard input. Functions are limited to dyadic +,-,x, and unary -; numerals must be binary. Parentheses may be used for grouping. For example:
101x111-100
prints:
1111
That is 5x(7-4) is 15. (APL groups from right to left.)
Extending it to the full APL language should be trivial.
The C-- language improves the C language by removing superfluous and confusing features: arithmetic, logical operations, shifts, relationals, address-of, and flow control. In fact, the only expressions retained are function calls, indirection, array assignments, the ',' operator, and sizeof. Despite these restrictions, the C-- program does arithmetic on arbitrarily large binary numbers.
To obtain a C-- reference, simply rip out the irrelevant pages from your K&R C manual. To obtain a C-- compiler, simply rip out the irrelevant bytes from your cc compiler.
Copyright and CC BY-SA 4.0 License:
This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see: https://creativecommons.org/licenses/by-sa/4.0/