Revisit 1990 entries
Although I previously got them to all compile they did not all work. Now they do except that jaw does not work properly in macOS (I have noticed something odd in linux too but it appears to work mostly if not entirely). Yusuke Endoh pointed out for 1990/theorem that atof() nowadays needs include stdlib.h so this was added to the file. As well I added the inclusion of string.h for strcmp(). I also fixed some segfaults in this entry (even though the judges pointed out that for NULL pointer one needs the four '0 0 0 0' it still segfaulted under those conditions) so that everything should work now under both linux and macOS. There were iirc two parts to this: one the NULL pointer is no longer dereferenced but also the type being passed to strcmp() was a int * and not a char *. This prevented 1990/theorem/sorter from working at all (segfault) and as I recall it there was another segfault I encountered as well. For 1990/jaw Yusuke Endoh provided a ruby implementation of btoa as it's not always available in modern systems. Thank you Yusuke! In 1990/jaw shark.sh had to be modified as well. This had to do with '.' not being in the default PATH. As well I had previously made a mistake about btoa versus atob as both were referenced in 1990/jaw/README.md. I believe I have this correct now. Many if not all the README files were modified with various changes including formatting (like turning them into markdown) and section titles amongst other things. I seem to recall I'm missing something here but I can't recall what I recall :-) so this will have to suffice this time round (maybe it was the btoa/atob issue that I just remembered and added above but I'm not sure).
This commit is contained in:
1 parent
e5ef2978f6
commit
0ae55de0b8
17 files changed
+420
-347
No files matched your search
+35
-35
@@ -18,56 +18,56 @@
|
||||
|
||||
### To run
|
||||
|
||||
echo 4 | baruch
|
||||
echo 7 | baruch
|
||||
echo 4 | ./baruch
|
||||
echo 7 | ./baruch
|
||||
|
||||
## Judges' comments
|
||||
|
||||
This program reads an integer between 4 and 99 from the stdin.
|
||||
This program reads an integer between 4 and 99 from the stdin.
|
||||
|
||||
NOTE: The original program did not have a newline at the end of
|
||||
the file. We added a final newline to the file to make
|
||||
unpacking easy.
|
||||
NOTE: The original program did not have a newline at the end of the file. We
|
||||
added a final newline to the file to make unpacking easy.
|
||||
|
||||
## Author's comments
|
||||
## Authors' comments
|
||||
|
||||
The goal of this work was to write a program that solves the
|
||||
classic n-queen problem, with a board size of up to 99x99, while
|
||||
keeping the program as short as possible.
|
||||
The goal of this work was to write a program that solves the
|
||||
classic n-queen problem, with a board size of up to 99x99, while
|
||||
keeping the program as short as possible.
|
||||
|
||||
The program finds all possibilities to place N chess queens on
|
||||
a NxN chess board so that no queen is in range of any other queen
|
||||
(not in the same column row or diagonal). For each solution the
|
||||
chess board and the place of the queens is printed to stdout.
|
||||
The program finds all possibilities to place N chess queens on
|
||||
a NxN chess board so that no queen is in range of any other queen
|
||||
(not in the same column row or diagonal). For each solution the
|
||||
chess board and the place of the queens is printed to stdout.
|
||||
|
||||
|
||||
This program is about as simple and as readable as possible.
|
||||
To make things even more simple we used a very limited subset of C:
|
||||
This program is about as simple and as readable as possible.
|
||||
To make things even more simple we used a very limited subset of C:
|
||||
|
||||
No pre-processor statements
|
||||
Only one, harmless, 'for' statement
|
||||
No ifs
|
||||
No breaks
|
||||
No cases
|
||||
No functions
|
||||
No gotos
|
||||
No structures
|
||||
No pre-processor statements
|
||||
Only one, harmless, 'for' statement
|
||||
No ifs
|
||||
No breaks
|
||||
No cases
|
||||
No functions
|
||||
No gotos
|
||||
No structures
|
||||
|
||||
In short, it contains no C language that might confuse the
|
||||
innocent reader. :-)
|
||||
In short, it contains no C language that might confuse the
|
||||
innocent reader. :-)
|
||||
|
||||
|
||||
This program demonstrates the claim that in C, any program
|
||||
can be written using a single 'for' statement, as long as it is
|
||||
long enough..
|
||||
This program demonstrates the claim that in C, any program
|
||||
can be written using a single 'for' statement, as long as it is
|
||||
long enough..
|
||||
|
||||
The authors further note:
|
||||
The authors' further note:
|
||||
|
||||
For PC users:
|
||||
In order to compile the program under Turbo-C or MSC, 'int '
|
||||
should be inserted at the beginning of the program.
|
||||
For better looking results it is recommended to replace the " #Q"
|
||||
string with " \261\2".
|
||||
For PC users:
|
||||
|
||||
In order to compile the program under Turbo-C or MSC, 'int '
|
||||
should be inserted at the beginning of the program.
|
||||
For better looking results it is recommended to replace the " #Q"
|
||||
string with " \261\2".
|
||||
|
||||
Copyright (c) 1990, Landon Curt Noll & Larry Bassel.
|
||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||
|
||||
Reference in new issue
Block a user