From 02b9106b7d438bb39da9ceec0729692d58fb0042 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 2 Dec 2023 14:52:36 -0800 Subject: [PATCH 1/3] Remove duplicate text in thanks file --- thanks-for-fixes.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index a1666e3d6..c37824551 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3574,15 +3574,6 @@ program rather than the file specified. It does not try and detect if the file exists or can be read as that will be handled by the shell/program. -## [2013/endoh4](2013/endoh4/endoh4.c) ([README.md](2013/endoh4/README.md)) - -[Cody](#cody) added the [run.sh](2013/endoh4/run.sh) script which temporarily turns off -the cursor as suggested by the author, with the addition that if no file is -specified it will feed the source code [endoh4.c](2013/endoh4/endoh4.c) to the -program rather than the file specified. It does not try and detect if the file -exists or can be read as that will be handled by the shell/program. - - ## [2013/hou](2013/hou/hou.c) ([README.md](2013/hou/README.md)) [Cody](#cody) fixed the Makefile so that this would work properly. Before this the use of From 7301eeb3fa6f9586f8909a85588b6de85beea9e5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 2 Dec 2023 14:54:21 -0800 Subject: [PATCH 2/3] Add 2013/robison/try.sh The README.md was already fine: just the update to try.sh instead of the long commands to run was changed. --- 2013/robison/README.md | 6 ++++-- 2013/robison/try.sh | 25 +++++++++++++++++++++++++ thanks-for-fixes.md | 5 +++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100755 2013/robison/try.sh diff --git a/2013/robison/README.md b/2013/robison/README.md index d6f9e653e..927e7f4dd 100644 --- a/2013/robison/README.md +++ b/2013/robison/README.md @@ -9,14 +9,16 @@ make ```sh ./robison +# enter an expression + +echo expression | ./robison ``` ### Try: ```sh -echo '1*2*3*4*5*6*7*8*9%1000' | ./robison -echo '100000000000000000000*(20*(1+(99477941840441*50)))/31664812345028528' | ./robison +./try.sh ``` diff --git a/2013/robison/try.sh b/2013/robison/try.sh new file mode 100755 index 000000000..3d24df037 --- /dev/null +++ b/2013/robison/try.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2013/robison +# + +# 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 + +read -r -n 1 -p "Press any key to run: echo '1*2*3*4*5*6*7*8*9%1000' | ./robison: " +echo 1>&2 +echo '1*2*3*4*5*6*7*8*9%1000' | ./robison +echo 1>&2 + +read -r -n 1 -p "Press any key to run: echo '100000000000000000000*(20*(1+(99477941840441*50)))/31664812345028528' | ./robison: " +echo 1>&2 +echo '100000000000000000000*(20*(1+(99477941840441*50)))/31664812345028528' | ./robison diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index c37824551..7a63329ce 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -3628,6 +3628,11 @@ Firefox both had the problem. implicitly (Linux doesn't seem to but macOS does). +## [2013/robison](2013/robison/robison.c) ([README.md](2013/robison/README.md)) + +[Cody](#cody) added the [try.sh](2013/robison/try.sh) script. + + # 2014 From f7c5f0cbc239a78debdce1fd8440238f3a02817c Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 3 Dec 2023 02:18:52 -0800 Subject: [PATCH 3/3] Make 2013/mills fix formatting match original Use -Dl=10 in Makefile so that the line ending is the same and the number of characters is also the same. Also l looks like 1 so it's better in that way too. --- 2013/mills/Makefile | 2 +- 2013/mills/mills.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/2013/mills/Makefile b/2013/mills/Makefile index 792692d90..2b4834d8a 100644 --- a/2013/mills/Makefile +++ b/2013/mills/Makefile @@ -58,7 +58,7 @@ ARCH= # Defines that are needed to compile # CDEFINE= -DLT=0,-9,70,130,50,30,-60,40,30 -DNL=9 -DEY=0,-22,37 \ - -Dwin_port="sin_addr.s_addr=htonl(2130706433),R.sin_port" + -Dwin_port="sin_addr.s_addr=htonl(2130706433),R.sin_port" -Dl=10 # Include files that are needed to compile # diff --git a/2013/mills/mills.c b/2013/mills/mills.c index 6af77ff2a..a354d140f 100644 --- a/2013/mills/mills.c +++ b/2013/mills/mills.c @@ -25,7 +25,7 @@ r(e-p-8); while(p!=e){ c^=*p++; for(j=0; 8>j; j++)c=c/2^c%2*3988292384; } r(~c); (); } void q(int c){ w(c); m+=c; m%=c=65521; n+=m; n%=c; } void T(F c){ c=.5+255 *c; q(0>c?0:c>255?255:c); } struct sockaddr_in R; int main(){ time_t i; struct tm*b; R.win_port=8224; s=socket(R.sin_family=AF_INET,SOCK_STREAM,0); bind(s, - (void*)&R, sizeof R); listen(s,10); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j; + (void*)&R, sizeof R); listen(s,l); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j; read(k,p,1); if(*p=='\n') { if(3>j)break; j=0; } } m=1; u("\n\032\n\rGNP" "\211\n\r\n\r1 :hserfeR\n\rKO 002 0.1/PTTH"); Z("RDHI"); r(800); r(600); w (8); r(33554433); J(); Z(0); w(120); w(1); J(); i=time(0); b=localtime(&