Merge pull request #94 from xexyl/1996-dalbec

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-03-20 19:41:48 -07:00
commit 93401d60cf
2 files changed
+16 -4

No files matched your search

+15 -3
View File
@@ -11,7 +11,19 @@
make all
NOTE: This entry uses non-standard args to main() that do not work with modern compilers.
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) proposed a fix for this
to compile with clang and Landon implemented it after some discussion. The
reason Cody did not do it is because he thought it was the wrong output but as
it happens the try section below was worded a bit confusingly. He looked at
[Yusuke Endoh's](/winners.html#Yusuke_Endoh) analysis found
[here](https://mame-github-io.translate.goog/ioccc-ja-spoilers/1996/dalbec.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
but he missed that Yusuke added a '...' after the result which made him think
the fix was wrong. Cody also made the recommended change of the author to make
it so that each number is printed on a line by itself rather than having a long
string of numbers on the same line. Thank you Cody for your assistance and
thanks to Yusuke for confirming the output is correct!
## To run:
@@ -20,9 +32,9 @@ NOTE: This entry uses non-standard args to main() that do not work with modern c
## Try:
./dalbec 3
./dalbec 3 | head -n 29
Why does it output 121?
Why does the output end with 121?
## Judges' comments:
+1 -1
View File
@@ -9,7 +9,7 @@ int cain(int I, char **O, int O0, int OO, int l)
!(OO-l+!I||I)?l-1:cain(I-!I-!!I,O,OO,OO,l))
:(O0+OO)%l
:cain(I-I/I-I/I,O,O0,OO+OO/OO,
cain(0,O,O0,OO,I-I-I)+I+1?1:printf("%d ",I-I-I)+fflush(stdout))
cain(0,O,O0,OO,I-I-I)+I+1?1:printf("%d\n",I-I-I)+fflush(stdout))
:cain(I-I-I-I-I,O,I+I-I+I,I,0)
:cain(~!!I-!!I,O,atoi(1[O]),1,atoi(0[O]));
}