Merge pull request #810 from xexyl/1990-theorem-bugs

Change infinite loop bug status in 1990/theorem
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-05-28 16:25:21 -07:00
commit 1a0bb9752b
23 files changed
+684 -338

No files matched your search

+1
View File
@@ -1 +1,2 @@
litmaath litmaath
litmaath.alt
+2 -2
View File
@@ -111,8 +111,8 @@ OBJ= ${PROG}.o
DATA= DATA=
TARGET= ${PROG} TARGET= ${PROG}
# #
ALT_OBJ= ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ALT_TARGET= ${PROG}.alt
################# #################
+28 -4
View File
@@ -1,18 +1,42 @@
# Best small program # Best small program
Maarten Litmaath Maarten Litmaath
Free University (VU) Amsterdam
Department of computer science
Uilenstede 72
1183 AK Amstelveen
The Netherlands The Netherlands
## To build:
```sh
make
```
## To run:
```sh
./litmaath some text
```
There is an alternate version provided. See the Alternate code section below.
## Try: ## Try:
```sh ```sh
./litmaath eschew obfuscation ./litmaath eschew obfuscation
``` ```
### Alternate code:
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) added the
[litmaath.alt.c](litmaath.alt.c) which we described in our remarks below. To
use:
```sh
make alt
```
Use `litmaath.alt` as you would `litmaath` above.
Thank you Cody!
## Judges' remarks: ## Judges' remarks:
+16
View File
@@ -0,0 +1,16 @@
#include <stdio.h>
main(argc, argv)
int argc;
char **argv;
{
while (*argv != argv[1] && (*argv = argv[1]) && (argc = 0) || (*++argv
&& (**argv && ((++argc)[*argv] && (**argv <= argc[*argv] ||
(**argv += argc[*argv] -= **argv = argc[*argv] - **argv)) &&
--argv || putchar(**argv) && ++*argv--) || putchar(10))))
fprintf(stderr,
"argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
(long) argv, (long) *argv, *argv && **argv ? **argv : '@',
(long) argv[1], argv[1] && *argv[1] ? *argv[1] : '@', argc);
;
}
+1
View File
@@ -1,3 +1,4 @@
theorem
fibonacci fibonacci
fibonacci.c fibonacci.c
mariano mariano
+17 -8
View File
@@ -29,7 +29,7 @@ about `gets()` at linking or runtime. Thank you Cody for your assistance!
[Yusuke Endoh](/winners.html#Yusuke_Endoh) pointed out that `atof` nowadays [Yusuke Endoh](/winners.html#Yusuke_Endoh) pointed out that `atof` nowadays
needs `#include <stdlib.h>` which was used in order to get this to work needs `#include <stdlib.h>` which was used in order to get this to work
initially. Thank you Yusuke! initially (prior to this the output was incomplete). Thank you Yusuke!
## To run: ## To run:
@@ -54,20 +54,29 @@ y1 - initial value (y(x1) == y1)
./theorem y 0 1 0.1 1 ./theorem y 0 1 0.1 1
``` ```
### Known bug with `fibonacci.c` and `theorem_bkp.c`: ### INABIAF - it's not a bug it's a feature! :-)
If the two args added up equals 0 the program will enter an infinite loop, If the two args passed to `fibonacci` and `theorem_bkp` equals 0 it will
printing 0 over and over again. Cody fixed another condition where this happens print 0 over and over again in an infinite loop. In this case it should not be
but this has not been fixed. See [bugs.md](/bugs.md) for more details. fixed (another condition where this occurred was fixed as it affected usability
of the program).
BTW: why can't the fix:
```c
if (a[1]==NULL||a[2]==NULL||a[3]==NULL||a[4]==NULL||a[5]==NULL) return 1;
```
be changed to just test the value of `A` when `a` is argv and `A` is argc?
## Judges' remarks: ## Judges' remarks:
The program's source implements four functions, all from the The program's source implements four functions, all from the
same source file! same source file!
When you compile theorem.c as is and run with 5 args, it numerically When you compile theorem.c as is and run with 5 args, it numerically solves the
solves the equation `y'=f(x,y)`, with a step size of `h`, over the interval equation `y'=f(x,y)`, with a step size of `h` (see above usage), over the
`x=[x1,x2]`, with the initial condition of `y(x1)=y1`. interval `x=[x1,x2]`, with the initial condition of `y(x1)=y1`.
The 'expression' `f(x,y)` is any function of `x` and `y` with the The 'expression' `f(x,y)` is any function of `x` and `y` with the
operators: operators:
+15 -14
View File
@@ -19,21 +19,21 @@ make
supplementary program and the program itself (both of which segfaulted and once supplementary program and the program itself (both of which segfaulted and once
that was fixed only the binary was modified; it was not run but according to the that was fixed only the binary was modified; it was not run but according to the
author's remarks it should be executed). He managed to do this with linux author's remarks it should be executed). He managed to do this with linux
but it will not work with macOS (see [bugs.md](/bugs.md) for why this is); this but it will not work with macOS (see [bugs.md](/bugs.md) for why this is); _this
is not a bug but a feature inherent in what it does. is not a bug, it's a feature_ inherent in what it does!
Although it took a fair bit of debugging it turns out all that had to change The following had to be done in order to get this to work:
was:
- `#include <sys/mman.h>` for `mmap()` and `munmap()`. - `#include <sys/mman.h>` for `mmap()` and `munmap()`.
- have `main()` call another function which is no longer a recursive function; - have `main()` call another function which is no longer a recursive function;
this prevented `main()` from entering an infinite recursive loop. this prevented `main()` from entering an infinite recursive loop.
Without either of these it would crash and prevent modification of the 32-bit Without either of these it would crash and prevent modification of the 32-bit
[ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) (not elf :-) [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) (not elf :-) )
) binary. But again see [bugs.md](/bugs.md) here. The following change was also binary. But again see [bugs.md](/bugs.md) here.
made to be more portable, in case the constants `PROT_READ` and/or `PROT_WRITE`
are not standardised: The following change was also made to be more portable, in case the constants
`PROT_READ` and/or `PROT_WRITE` are not standardised:
Change `3` in the call to `mmap()` to be `PROT_READ|PROT_WRITE`: just in case Change `3` in the call to `mmap()` to be `PROT_READ|PROT_WRITE`: just in case
`PROT_READ|PROT_WRITE` does not equal 3 (though it seems to be equal in both `PROT_READ|PROT_WRITE` does not equal 3 (though it seems to be equal in both
@@ -42,12 +42,13 @@ macOS and linux).
There was one other thing that had to be done though. Since the program used to There was one other thing that had to be done though. Since the program used to
recursively call (infinite recursion, seemingly) `main()` and since that cannot recursively call (infinite recursion, seemingly) `main()` and since that cannot
be done what had to be done instead is after the new function (`pain()` since it be done what had to be done instead is after the new function (`pain()` since it
was a pain to fix :-) ) returns to first call `munmap()` and `close()` (else was a pain to fix :-) ) returns to first call `munmap()` and `close()` (else one
one would get text file busy error) and then the program can call `execv()` again like the would get text file busy error) and then the program can call `execv()` again
function `pain()` (was in `main()`) did but with a slight change. See commit like the function `pain()` (was in `main()`) did but with a slight change. See
`2159caec4677e0f25ad704a74e04c8196fd6c343` for details. Notice that commit `2159caec4677e0f25ad704a74e04c8196fd6c343` for more details.
the location of the calls to `munmap()` and `close()` followed by `execv()` do
matter! Notice that the location of the calls to `munmap()` and `close()` followed by
`execv()` _does matter_!
NOTE: there might be educational value to see the progress of this fix; if you NOTE: there might be educational value to see the progress of this fix; if you
wish to see, try: wish to see, try:
+1
View File
@@ -1 +1,2 @@
kev kev
kev.alt
+6 -3
View File
@@ -59,7 +59,7 @@ ARCH=
# Defines that are needed to compile # Defines that are needed to compile
# #
CDEFINE= -DPORT=5455 -DSPEED=50 -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)" CDEFINE= -DPORT=5455 -DSPEED=100 -Dl_="socket(il.sin_family=AF_INET,SOCK_STREAM,0)"
# Include files that are needed to compile # Include files that are needed to compile
# #
@@ -115,8 +115,8 @@ OBJ= ${PROG}.o
DATA= DATA=
TARGET= ${PROG} TARGET= ${PROG}
# #
ALT_OBJ= ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ALT_TARGET= ${PROG}.alt
################# #################
@@ -138,6 +138,9 @@ ${PROG}: ${PROG}.c
alt: data ${ALT_TARGET} alt: data ${ALT_TARGET}
@${TRUE} @${TRUE}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# data files # data files
# #
data: ${DATA} data: ${DATA}
+50 -20
View File
@@ -1,11 +1,8 @@
# Best Curses Game # Best Curses Game
Kevin Pulo Kevin Pulo<br>
School of Information Technologies Australia<br>
Madsen Building F09 <http://www.kev.pulo.com.au/><br>
University of Sydney, NSW, 2006
Australia
<http://www.kev.pulo.com.au/>
Mastodon: <https://fosstodon.org/@devkev> Mastodon: <https://fosstodon.org/@devkev>
## To build: ## To build:
@@ -17,15 +14,49 @@ make
## To run: ## To run:
```sh ```sh
./kev hostname ./kev # in one terminal
./kev hostname # in another terminal
``` ```
NOTE: each player's paddle is at the bottom and the opponent at the top.
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) slowed down the ball
just a tad as it went too fast for the speed at which the paddles move even when
holding down the movement keys. If you need to change the speed you can
reconfigure it like (say for over a network and not the same host):
```sh
make clobber SPEED=50 all # default value which is very fast
```
There is an alternate version which lets you use the arrow keys to control your
paddle. See below Alternate code.
## Try: ## Try:
```sh ```sh
./kev
./kev localhost ./kev localhost
``` ```
### Alternate code:
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) provided an alternate
version which lets you use the arrow keys on your keyboard instead of the more
awkward ',' and '.'. To use:
```sh
make alt
```
Use `kev.alt` as you would `kev`.
What happens if you use both, one in one terminal and the other in another
terminal?
Thank you Cody!
## Judges' remarks: ## Judges' remarks:
Continuing with this year's "retro game" theme, this is another old game; Continuing with this year's "retro game" theme, this is another old game;
@@ -45,7 +76,7 @@ box.
* TCP sockets * TCP sockets
* curses * curses
* usleep * `usleep()`
### DESCRIPTION ### DESCRIPTION
@@ -117,18 +148,17 @@ terminal size).
### BUILDING ### BUILDING
Just run `make`to use the Makefile as above. The `SPEED` variable in the Makefile Just run `make`to use the Makefile as above. The `SPEED` variable in the
controls the speed of the game (defaults to `50`). This speed is Makefile controls the speed of the game (defaults to `50`). This speed is the
the delay between frames in milliseconds. Thus a value of 0 will delay between frames in milliseconds. Thus a value of 0 will make the game go
make the game go as fast as your network can handle, and values as fast as your network can handle, and values less than 50 are useful for
less than 50 are useful for larger terminals or more exciting larger terminals or more exciting games. The program needs bandwidth equal to
games. The program needs bandwidth equal to 1/s bytes per second 1/s bytes per second (where `s` is the speed value). Any latency on the network
(where `s` is the speed value). Any latency on the network will will be added to `s` - so you should probably subtract any latency from the
be added to `s` - so you should probably subtract any latency from value of `s` you want to have. Given that `loopback` and fast Ethernet LANs are
the value of `s` you want to have. Given that `loopback` and fast both much less than 1ms of latency, you should only need to worry about this if
Ethernet LANs are both much less than 1ms of latency, you should you plan on playing over a slower link like a cable modem, DSL, or (God-forbid)
only need to worry about this if you plan on playing over a slower dial-up.
link like a cable modem, DSL, or (God-forbid) dial-up.
The TCP port to use for network communications is specified by the The TCP port to use for network communications is specified by the
`PORT` variable in the Makefile. If the default of `5455` is `PORT` variable in the Makefile. If the default of `5455` is
+122
View File
@@ -0,0 +1,122 @@
#include <unistd.h>
#include <curses.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/time.h>
#define o0(M,W) mvprintw(W,M?M-1:M,"%s%s ",M?" ":"",_)
#define O0(M,W) M##M=(M+=W##M)-W##M
#define l1(M,W) M.tv_##W##sec
#define L1(m,M,l,L,o,O) for(L=l;L--;)((char*)(m))[o]=((char*)(M))[O]
#define I1 lL,(struct sockaddr*)&il
#define i1 COLS
#define j LINES
#define L_ ((j%2)?j:j-1)
fd_set I;struct socka\
ddr_in il;struct host\
ent*LI; struct timeval
IL,l;char L[9],_[1<<9]
;void ___(int __
){_[__--]=+0;if(
++__)___(--__);_
[__]='=';}double
o,oo=+0,Oo=+0.2;
long O,OO=0,oO=1
,ii,iI,Ii,Ll,lL,
II=sizeof(il),Il
,ll,LL=0,i=0,li,
lI;int main(int\
iL,char *Li[]){\
initscr();keypad
(stdscr,1);cbreak
();noecho();nonl
();___(lI=i1/4);
_[0]='[';_[lI-1]
=']';L1(&il,&_,\
II,O,+O,+lI);il.
sin_port=htons((
unsigned long)(\
PORT&0xffff));lL
=l_;if(iL=!--iL)
{il. sin_addr .\
s_addr=0;bind(I1
,II);listen(lL,5
);lL=accept(I1,&
II);}else{oO-=2;
LI=gethostbyname
(Li[1]);L1(&(il.
sin_addr),(*LI).
h_addr_list[0],\
LI->h_length,iI,
iI,iI);(*(&il)).
sin_family=(&(*\
LI))->h_addrtype
;connect(I1,II);
}ii=Ii=(o=i1*0.5
)-lI/2;iI=L_-1;O
=li=L_*0.5;while
(_){mvaddch(+OO,
oo,' ');o0(ii,iI
);o0(Ii,Il-=Il);
mvprintw(li-1,Il
,"%d\n\n%d",i,LL
);mvhline(li,+0,
'-',i1);mvaddch(
O,o,'*');move(li
,Il);refresh();\
timeout(+SPEED);
gettimeofday(&IL
,+0);Ll=getch();
timeout(0);while
(getch()!=ERR);\
if(Ll=='q'&&iL)\
write(lL,_+1,1);
if(ii>(ll=0)&&Ll
==KEY_LEFT){write(lL,
_,-(--Il));}else
if(Ll==KEY_RIGHT&&ii+\
lI<i1){write(lL,
_+lI,++Il);}else
if(iL||!Il)write
(lL,_+lI-1,4-3);
gettimeofday(&l,
0);II=((II=l1(IL
,)+(l1(l,u)-=l1(
IL,u))-l1(l,)+(\
l1(l,)-=l1(IL,))
)<0)?1+II-l1(l,)
+1e6+(--l1(l,)):
II;usleep((II+=\
l1(l,)*1e6-SPEED
*1e3)<0?-II:+0);
if(Ll=='q'&&!iL)
break;FD_ZERO(&I
);FD_SET(lL,&I);
memset(&*&IL,ll,
sizeof(l));if((\
Ll=select(lL+1,&
I,0,0,&IL)));{if
(read(lL,&L,ll+1
)){if(!*L){ll++;
}else if(*L==ll[
_]){ll--; }else\
if(*(&(*L))==1[_
]){break;}}else{
break;}}O0(o,O);
O0(O,o);if(o<0){
o*=-1;Oo*=-1;}if
(o>i1){o=i1+i1-o
;Oo*=-1;}if(o>=(
Ii+=ll)&&O<1&&oO
<0&&o<Ii+lI){O=2
;oO=~--oO;Oo+=ll
*4e-1;}if(O<0){O
=iI;LL++;}if(o>=
(ii+=Il)&&O>iI-1
&&oO>0&&o<ii+lI){O=iI-
2;oO=~--oO;Oo+=Il*4e-1
;}if(+O>+iI){O-=O;i++;
}}endwin();return(0);}
+2
View File
@@ -134,6 +134,8 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c ${PROG}: ${PROG}.c
@echo "NOTE: this version cannot successfully run the self-test. Use make alt"
@echo "for a version which will work. See README.md for why it is this way."
${CC} ${CFLAGS} $< -o $@ ${LIBS} ${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable # alternative executable
+43 -20
View File
@@ -10,33 +10,52 @@ Israel
make make
``` ```
NOTE: if you do not have access to a compiler that lets you have alternative arg
types to `main()` the self-test feature will fail. If your compiler does not
have this defect you can use the Alternate code described below. The reason to
have it as the alternate version is that there is more to the entry that can
still be enjoyed with compilers with the `main()` args defect including the
primary purpose of the entry, a puzzle.
Hopefully this will be resolved in time where there is no need for an alternate
version but it's a complicated one. See also the [bugs.md](/bugs.md) file for
more information.
## To run: ## To run:
```sh ```sh
./giljade ./giljade
``` ```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern After Landon fixed the entry to compile with clang (but see above and below)
systems. The problem that was showing up is that with either optimising or [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) noticed this does not
anything but 32-bit was used it would not work. The optimising cannot be used work at all in modern systems. He fixed this to work but he notes that the fix
still but it now works with both 32-bit and 64-bit. The problem was the size of to let clang compile it breaks the self-test feature.
`int` and `long` being different now. Instead of `long *E` it is now `int *E`.
This solves the problem for both 32-bit and 64-bit as long as optimising is
disabled. Tested under linux (32-bit, 64-bit) and macOS (arm64). Thank you Cody
for your assistance!
NOTE: the self-test feature no longer works due to the fix for clang (which The problem that was showing up is that with either optimising or if anything
requires the first arg of `main()` to be an `int` and the second arg to be `char but 32-bit (as in `-m32`) was used it would not work (at least in 64-bit
**`). Believe it having more than two spaces in the code, except where the systems?). The optimising cannot be used still but it now works with both 32-bit
original code has them, appears to be part of the problem but it's not the full and 64-bit. The solution has to do with the size difference between `int` and
story. If you have a compiler that doesn't have this deficiency (e.g. gcc) you `long` so that the `long*E` is now `int*E`. This solves a specific problem for
can use the alternate code described below. linux (32-bit, 64-bit) and macOS (arm64).
But as noted there is another problem with clang: the self-test feature only
completely works with the original version ([giljade.alt.c](giljade.alt.c)), not
the one that will compile with clang ([giljade.c](giljade.c)). The alternate
version, which will not compile with clang, is the only one that passes the
self-tests. If your compiler does not have the defect that clang has about arg
types to `main()` see the Alternate code section below at least for the
self-test feature.
Thank you Cody for your assistance!
### INABIAF - it's not a bug it's a feature! :-) ### INABIAF - it's not a bug it's a feature! :-)
If the program source file is not lying in the same directory this program will If the program source file is not lying in the same directory this program will
very likely crash or do something strange. very likely crash or do something strange.
This entry requires that both `sed` and `cc` are in the path.
## Try: ## Try:
```sh ```sh
@@ -52,18 +71,22 @@ Press ^F (control F) repeatedly.
### Alternate code: ### Alternate code:
Thanks to the fix for `clang` the self-test feature (of the output, see the This version will work only with compilers that let you have alternate types to
author's remarks) does not work. If however you have gcc which does not have the the args of `main()` and will also successfully run its self-test (the other
defect that clang has with requirements in `main()`s args you can still use it version only runs some of them successfully). To use:
via the alternate code. To compile:
```sh ```sh
make alt make alt
``` ```
Use `giljade.alt` as you would `giljade`. Use `giljade.alt` as you would `giljade` above.
#### Try:
```sh
./giljade.alt > out
./giljade.alt out
```
## Judges' remarks: ## Judges' remarks:
+1 -1
View File
@@ -12,7 +12,7 @@
),l)u=u>>5-m &u;s=u&E[3-l];I(t(m),3-l) s=(u)a&*E;I\ ),l)u=u>>5-m &u;s=u&E[3-l];I(t(m),3-l) s=(u)a&*E;I\
(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/ (t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/
/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l /*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l
[9999],T=42, M,V=32;long*E,k[9999],B[1 <<+21],*N=B+ [9999],T=42, M,V=32;int *E,k[9999],B[1 <<+21],*N=B+
1234567,q=0, h=3,j=2,O,b,f,u,s,c,a,t,e ,d;C(){F(h=N 1234567,q=0, h=3,j=2,O,b,f,u,s,c,a,t,e ,d;C(){F(h=N
[3];(B[h]&&+ memcmp(N,B+B[h],16));h=B[ h]+4);B[h]|| [3];(B[h]&&+ memcmp(N,B+B[h],16));h=B[ h]+4);B[h]||
(B[h]=N-B,N= N+6);}main(char*U,int*w[] ){;;F(_=A=D+ (B[h]=N-B,N= N+6);}main(char*U,int*w[] ){;;F(_=A=D+
+5 -6
View File
@@ -10,14 +10,13 @@
\ \
)u=(f&p)i(m) ;s=u&E[3];I(t(m),3)s=(u)a &E[l];I(t(m\ )u=(f&p)i(m) ;s=u&E[3];I(t(m),3)s=(u)a &E[l];I(t(m\
),l)u=u>>5-m &u;s=u&E[3-l];I(t(m),3-l) s=(u)a&*E;I\ ),l)u=u>>5-m &u;s=u&E[3-l];I(t(m),3-l) s=(u)a&*E;I\
(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/ (t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/
/*c.c;cc/c.c/-Wno-implicit-function-declaration /-c*/ /*-e/'s,intZ,int/ Z,g'>c.c;cc/c.c/-Wno-implicit-function-declaration /-c*/
;;char*A=0,*_,*R,*Q, D[9999],*r,l ;;char*A=0,*_,*R,*Q, D[9999],*r,l[9999],T=42, M,V=32;int *E,k[9999],B[1 <<+21],*N=B+
[9999],T=42, M,V=32;int*E,k[9999],B[1 <<+21],*N=B+
1234567,q=0, h=3,j=2,O,b,f,u,s,c,a,t,e ,d;C(){F(h=N 1234567,q=0, h=3,j=2,O,b,f,u,s,c,a,t,e ,d;C(){F(h=N
[3];(B[h]&&+ memcmp(N,B+B[h],16));h=B[ h]+4);B[h]|| [3];(B[h]&&+ memcmp(N,B+B[h],16));h=B[ h]+4);B[h]||
(B[h]=N-B,N= N+6);}int main(int Ua,char **wa){char*U (B[h]=N-B,N= N+6);}main(int Z,char**Y ){char*U=Z ;
=Ua;int**w= wa;;F(_=A=D+6666,A[fread(A,1,3333,fopen int**w=Y; ;;F(_=A=D+6666,A[fread(A,1,3333,fopen
(__FILE__, "r"))]=0;*++ _;h||(*_=V)) (__FILE__, "r"))]=0;*++ _;h||(*_=V))
*_-59|_[1]-* _||(h&&(*_=+ 35),h---2||(_[9]=V));;F(_ *_-59|_[1]-* _||(h&&(*_=+ 35),h---2||(_[9]=V));;F(_
=A;*_;_++)10 -*_&&*_-V&&( *_-92)&&(k[q]=isalnum(l[q =A;*_;_++)10 -*_&&*_-V&&( *_-92)&&(k[q]=isalnum(l[q
+5 -2
View File
@@ -8,12 +8,15 @@ Finland
This entry requires SDL to be installed. This entry requires SDL to be installed.
See the [faq](/faq.md) for information on how to install it if you haven't
already.
If you have SDL installed:
```sh ```sh
make make
``` ```
See the [faq](/faq.md) for information on how to install it if you haven't
already.
## To run: ## To run:
+14 -10
View File
@@ -20,10 +20,6 @@ make
Connect to port http://localhost:10333 with your browser. Connect to port http://localhost:10333 with your browser.
The author said he had no recent version of macOS to test to see if this works
but in 2023 [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) did this
and reported that it works well. He also said he really loved it! Thank you
Cody!
## Try: ## Try:
@@ -41,8 +37,12 @@ find any other tributes?
## Author's remarks: ## Author's remarks:
What does "Alan Turing" remind you of? Cryptanalysis of the Enigma? Turing What does "[Alan Turing](https://en.wikipedia.org/wiki/Alan_Turing)" remind you
machine? Turing test? This program is also based on his work. of? [Cryptanalysis](https://en.wikipedia.org/wiki/Cryptanalysis) of the [Enigma
machine](https://en.wikipedia.org/wiki/Enigma_machine)? [Turing
machine](https://en.wikipedia.org/wiki/Turing_machine)? [Turing
test](https://en.wikipedia.org/wiki/Turing_test)? This program is also based on
his work.
### Whirlwind tour ### Whirlwind tour
@@ -58,20 +58,24 @@ cc -O3 -std=c99 \
-DTIMESTEP=1.0 -DSPEED=2 -DRGB=255:128:192 -DTIMESTEP=1.0 -DSPEED=2 -DRGB=255:128:192
``` ```
Then, run it under `tcpserver` command in Then, run it under `tcpserver` command in the
[ucspi-tcp](http://cr.yp.to/ucspi-tcp.html) package, which was created by [ucspi-tcp](http://cr.yp.to/ucspi-tcp.html) package, which was created by
[Daniel J. Bernstein](/winners.html#Daniel_J._Bernstein), [IOCCC 1991 "Best of [Daniel J. Bernstein](/winners.html#Daniel_J._Bernstein), [IOCCC 1991 "Best of
Show"](../../1991/brnstnd/brnstnd.c) ([README.md](../../1991/brnstnd/README.md)). Show"](../../1991/brnstnd/brnstnd.c) ([README.md](../../1991/brnstnd/README.md)).
$ tcpserver -v 127.0.0.1 10333 ./prog ioccc.txt ```sh
tcpserver -v 127.0.0.1 10333 ./prog ioccc.txt
```
Finally, open `http://127.0.0.1:10333/` by a modern browser supporting HTML5. Finally, open `http://127.0.0.1:10333/` by a modern browser supporting HTML5.
You can use the mouse cursor to place drops into the Petri dish interactively. You can use the mouse cursor to place drops into the [Petri
dish](https://en.wikipedia.org/wiki/Petri_dish) interactively.
### Description ### Description
This is a simulator of *reaction-diffusion systems*. This is a simulator of [reaction-diffusion
systems](https://en.wikipedia.org/wiki/Reaction-diffusion_system).
Reaction-diffusion systems, proposed by Alan Turing in [1], are mathematical Reaction-diffusion systems, proposed by Alan Turing in [1], are mathematical
models in which two chemical substances are transformed into each other (*local models in which two chemical substances are transformed into each other (*local
+2 -4
View File
@@ -41,10 +41,8 @@ Can a machine learn?
Some say so. Some say so.
But can a machine learn to write like Shakespeare, But can a machine learn to write like Shakespeare? Can it write rules and
or tweet like [Trump](http://trumptwitterarchive.com)? guidelines for the IOCCC?
Can it write rules and guidelines for the IOCCC?
You decide. :-) You decide. :-)
+99 -50
View File
@@ -33,6 +33,11 @@ TZ=UTC48 make clobber prog
./prog 512 ./prog ./prog 512 ./prog
``` ```
### INABIAF - it's not a bug it's a feature! :-)
This program will not validate input so it might fail or get stuck if invoked
erroneously.
## Judges' remarks: ## Judges' remarks:
Do you have the time to see what this program does? Think again, come back and Do you have the time to see what this program does? Think again, come back and
@@ -69,18 +74,20 @@ clang -O1 -o prog prog.c
### Poster: ### Poster:
You can generate an A3 sized poster by `make docs`. This command creates a pdf You can generate an A3 sized poster by `make docs`. This command creates a pdf
file `poikola.pdf`. file `poikola.pdf`. This requires the
[pdfTeX](https://en.wikipedia.org/wiki/PdfTeX) tool.
### What this entry does: ### What this entry does:
An old wise man mumbled to me: An old wise man mumbled to me:
> Implement a program, which can calculate SHA-3 checksum for a file > Implement a program, which can calculate SHA-3 checksum for a file --
I think it is easy, but the wizard didn't stop yet: I thought it was easy, but the wizard didn't stop yet:
> and primes and Fibonacci numbers. > and primes and Fibonacci numbers.
Still easy. But the Gandalf the Grey impersonator is not ready: Still easy. But the [Gandalf the
Grey](https://www.glyphweb.com/arda/g/gandalf.html) impersonator was not ready:
> But use only `main()`, and do not use `math.h` nor predefined stuff at all. > But use only `main()`, and do not use `math.h` nor predefined stuff at all.
But wait, there are more rules: This work should reflect the extraordinary mind But wait, there are more rules: This work should reflect the extraordinary mind
@@ -91,21 +98,34 @@ who passed away on fourth of February 2019.
### Oh boys: ### Oh boys:
So, I followed the rules given by Gandalf the White and the Judges of IOCCC. So, I followed the rules given by [Gandalf the
White](https://www.glyphweb.com/arda/g/gandalf.html) and the [Judges of
IOCCC](/judges.html).
Output of `iocccsize`, using the [2019 version of Output of `iocccsize`, using the [2019 version of
iocccsize](https://www.ioccc.org/2019/iocccsize.c), is carefully selected. For iocccsize](https://www.ioccc.org/2019/iocccsize.c), is carefully selected. For
the sake of clarity, I used single letter variables in the code. I also avoided the sake of clarity, I used single letter variables in the code. I also avoided
unnecessary use of functions. Like a tripundra, this program has three levels. unnecessary use of functions. Like a
[tripundra](https://en.wikipedia.org/wiki/Tripundra), this program has three levels.
In order to reveal all of them, you have to compile this program on three In order to reveal all of them, you have to compile this program on three
consecutive days. consecutive days.
As this is a contest for obfuscated code, the program does not perform As this is a contest for obfuscated code, the program does not perform
unnecessary checks, but either fails or gets stuck if invoked erroneously. The unnecessary checks, but either fails or gets stuck if invoked erroneously. The
program is invoked in this way: ./prog `<integer>` `<file>` in where `<integer>` program is invoked in this way:
is 224, 256, 384, 512 or even 1024. Yes, I know 1024 is not a supported length
of output, but as I said, the program does not validate its input in any way.
These same parameters should be given in calculating a Fibonacci sequence or ```sh
prime numbers. *Please note that maximum file size is one gigabyte.. ./prog <integer> <file>
```
where `<integer>` is 224, 256, 384, 512 or even 1024. Yes, I know 1024 is not a
supported length of output, but as I said, the program does not validate its
input in any way. These same parameters should be given in calculating a
[Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_sequence) or [prime
numbers](https://en.wikipedia.org/wiki/Prime_number). *Please note that maximum
file size is one gigabyte*!
### Obfuscation: ### Obfuscation:
@@ -116,67 +136,96 @@ the feeling that I've been here before.
make your own decisions. Up there, it's all _up yours_. make your own decisions. Up there, it's all _up yours_.
This code has some jumping too. I used some `goto`s instead of `longjmp()`. Some This code has some jumping too. I used some `goto`s instead of `longjmp()`. Some
Finnish ski jumping sites are used as labels, however, there is `lahti` instead Finnish [ski jumping](https://en.wikipedia.org/wiki/Ski_jumping) sites are used
of <tt style="font-family: Monaco, Courier New, monospace;font-size: as labels, however, there is `lahti` instead of <tt style="font-family: Monaco,
12px;">salpausselk&auml;</tt>. Courier New, monospace;font-size: 12px;">salpausselk&auml;</tt>.
### SHA-3-512 Compatibility chart ### ### SHA-3-512 Compatibility chart ###
Tested against [test vectors](https://www.di-mgt.com.au/sha_testvectors.html). Tested against [test vectors](https://www.di-mgt.com.au/sha_testvectors.html).
Clang-4.0: For optimization levels [0123s], the program compiles and produces correct output for every tested vector using
c11, c89, c90, c99, gnu11, gnu1x, gnu89, gnu90, gnu99, iso9899:1990, iso9899:199409, iso9899:1999 and
iso9899:2011 as argument of `-std=`
Gcc-6: For optimization level 0, correct output using Clang-4.0: For optimization levels [0123s], the program compiles and produces
c11, c99, gnu11, gnu1x, gnu89, gnu90, gnu99, iso9899:1999 and iso9899:2011 correct output for every tested vector using the C standards c11, c89, c90, c99,
gnu11, gnu1x, gnu89, gnu90, gnu99, iso9899:1990, iso9899:199409, iso9899:1999
and iso9899:2011 (argument of `-std=`).
GCC-6: For optimization level 0, correct output using the C standards
c11, c99, gnu11, gnu1x, gnu89, gnu90, gnu99, iso9899:1999 and iso9899:2011.
### Missing a prime ### Missing a prime
For obvious reason, the oddest prime is missing from output. For obvious reason, the [oddest
prime](https://mathworld.wolfram.com/OddPrime.html) is missing from output.
### Observations ### Observations
Gcc and clang are very fragile compilers. I spent numerous hours trying to achieve exactly the same output from `gcc` and `clang` are very fragile compilers. I spent numerous hours trying to
different optimization levels and compilers. Small change in code can produce really unexpected results, i.e. the compiler achieve exactly the same output from different optimization levels and
can skip a few expressions or statements without obvious reason. compilers. Small change in code can produce really unexpected results, i.e. the
compiler can skip a few expressions or statements without obvious reason.
### Major spoilers ### Major spoilers
Please scroll down if you want to see spoilers. It is commonly believed that [Mike Keith's
<div style="margin-bottom:61em;">&nbsp;</div> algorithm](http://www.cadaeic.net/calendar.htm) published in _Journal of
It is commonly believed that [Mike Keith's algorithm](http://www.cadaeic.net/calendar.htm) published in _Journal of Recreational Mathematics_, Vol. 22, No. 4, 1990, p. 280, is the shortest way to
Recreational Mathematics_, Vol. 22, No. 4, 1990, p. 280, is the shortest way to calculate weekday for given date. calculate the day of the week for a given date.
Keith's algorithm:<br>
`(d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7`<br>
My algorithm: I noticed that<br>
`(23*m/9+(m<3?y--:y-2)+d+4+y/4-y/100+y/400)%7`<br>
is one character shorter. In my solution, `m<3?y--:y-2` is used directly, instead of assign value for `d`.
Q is pronounced in Finnish exactly like "kuu", a word for month or the Moon. So, `Q = k` is intended. #### Keith's versus my algorithm
Last term of outputted Fibonacci sequence is the last one smaller than 2<sup>64</sup>. It is plain coincidence (but a funny) Kieth's algorithm is `(d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7`. I noticed
that value of '^' is 94 in ASCII table. that `(23*m/9+(m<3?y--:y-2)+d+4+y/4-y/100+y/400)%7` is one character shorter. In
my solution, `m<3?y--:y-2` is used directly, instead of assigning a value to
`d`.
For prime calculations: I recycled code from my high school C-programming course. Originally, I wrote it over 20 years Q is pronounced in Finnish exactly like "kuu", a word for
ago. My teacher said that it is (too) complicated to use bits stored in arrays, so I did it. [month](https://en.wikipedia.org/wiki/Month) or the
[Moon](https://en.wikipedia.org/wiki/Moon). So, `Q = k` is intended.
Last term of outputted [Fibonacci
sequence](https://en.wikipedia.org/wiki/Fibonacci_sequence) is the last one
smaller than 2<sup>64</sup>. It is a plain but funny coincidence
that the value of `^` is 94 in [ASCII](https://en.wikipedia.org/wiki/ASCII).
For [prime calculations](https://en.wikipedia.org/wiki/Prime_number): I recycled
code from my high school C-programming course. Originally, I wrote it over 20
years ago. My teacher said that it is (too) complicated to use bits stored in
arrays, so I did it.
### Other stuff ### Other stuff
Cody: I really like that you enjoyed my previous entry. I hope that you will like this entry too. [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson): I really like that you enjoyed my
Because I did not want to give too many clues to Judges, I tried to write this entry in a different way previous entry. I hope that you will like this entry too. Because I did not
than Most Stellar, but in this code there is at least one recycled thing from it. By the way, want to give too many clues to [the Judges](/judges.html), I tried to write this
answers to questions: 1. 255. 2. Try to compare binary representations of those floats and binary representation entry in a different way than [Most Stellar](/2018/poikola/prog.c), but in this
of the string "25th IOCCC!". 3. I don't know. I used standard trigonometric functions from `math.h` for rotating the Big Dipper code there is at least one recycled thing from it. By the way, the answers to
and later replaced those functions with my own implementations. But there was a bug in my code and the effect was more the questions I posed: `(1)` 255. `(2)` Try to compare binary representations of
beautiful than intended. I did not even debug this bug and now it works as a feature. 4. It is not possible. If you those floats and binary representation of the string "`25th IOCCC!`". `(3)` I
change a single bit, the Fletcher 16 checksum does not match anymore and `goto` jumps to end of the code. don't know. I used standard [trigonometric
functions](https://en.wikipedia.org/wiki/Trigonometric_functions) from
[math.h](https://en.wikipedia.org/wiki/C_mathematical_functions#Overview_of_functions)
for rotating the [Big Dipper](https://en.wikipedia.org/wiki/Big_Dipper) and
later replaced those functions with my own implementations. But there was a bug
in my code and the effect was more beautiful than intended. I did not even
debug this bug and now it works as a feature. `(4)` It is not possible. If you
change a single bit, the [Fletcher's 16
checksum](https://en.wikipedia.org/wiki/Fletcher%27s_checksum#Fletcher-16) does
not match anymore and `goto` jumps to the end of the code.
I see that _Volker Diels-Grabsch_'s winner is awarded in category __Most self-aware__. In last year, my entry incorporates I see that one of the [Volker
the Fletcher 16 algorithm to ensure integrity of code. One of my first ideas for this year was to do the same thing, Diels-Grabsch](/winners.html#Volker_Diels-Grabsch)'s winning entries is
but with SHA-3. Using Fletcher 16, calculating a checksum which matches with `sleeping time factor` took about one minute. awarded the category [Most self-aware](/2019/diels-grabsch2/prog.c). In last
I realized that SHA-3 even with 224-bit output could take too much CPU time. year, my entry incorporates the [Fletcher's 16
algorithm](https://en.wikipedia.org/wiki/Fletcher%27s_checksum#Fletcher-16) to
ensure integrity of code. One of my first ideas for this year was to do the same
thing, but with [SHA-3](https://en.wikipedia.org/wiki/SHA-3). Using Fletcher 16,
calculating a [checksum](https://en.wikipedia.org/wiki/Checksum) which matches
with `sleeping time factor` took about one minute. I realized that SHA-3 even
with 224-[bit](https://en.wikipedia.org/wiki/Bit) output could take too much
[CPU](https://en.wikipedia.org/wiki/Central_processing_unit) time.
I would like to say _thanks_ to PSP, because there were not too much interrupts during the coding phase. I would like to say _thanks_ to PSP, because there were not too many
interruptions during the coding phase.
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+123 -123
View File
@@ -47,157 +47,157 @@ moaumqp yssl oldpk mew <k gbqg="nfqn://ejq.kxbg.wqz/amlzjrswm/200103068.hqi">XUS
vvchf <gngrpy>'oq YMVBT'</evhpfa>: wl nxitrr xuom zil <xbyxzf>'Mvwkhwfyucdih Jzxrll rs Ofztr, Zsapqagyp vvchf <gngrpy>'oq YMVBT'</evhpfa>: wl nxitrr xuom zil <xbyxzf>'Mvwkhwfyucdih Jzxrll rs Ofztr, Zsapqagyp
ekl Bxahm Jmaxnjuadsfvq'</zulgbf>. Tbyhuyy.</h> ekl Bxahm Jmaxnjuadsfvq'</zulgbf>. Tbyhuyy.</h>
<h>Jwi ndqw owa <e rqoi="vduzh://zycakph.ezz/gfptltdljsjre/wznrle/1290520266087571458?y=20">Resabtlkthvkv Ubjdlzry Fmrmpbovr Gyln Ewxoodl omhas</j> gxqb <h>Jwi ndqw owa <e rqoi="vduzh://ixw.tvdrptb.aeh/frg/20200805053007/iemol://ulxzilo.fil/jerscjonjfaec/eptubc/1290520266087571458">Ukbtffidnzzyk Ggvayqgt Esgdremmv Qxnf Ifvflwe kunfw</p> ifbk
<x lwho="rfjxk://kuxvwgk.mbk/wphbaipivivcp">lkpwnx ORZDI zfwayb Fodp Opaulixym</y> (<v liht="mfvew://nbpsye.frp/tpjkcqajvaaxi">ErxZee</b>) wc kubq mc rmm <c xcrb="luona://tsc.hlvxa.kak/gfdjzub.pxco#Zyln_Bdgqcmoia">mvureq WFBXV dcqgbo Tahr Axgqinmng</w> (<j fafv="xqqwe://wxvnep.lnc/focngshqddrci">ZvzRel</x>) cc apnj mq ceq
<s kudy="ltkuq-qeyb.aaf">UTRRA swvw krabmq ktnrl</z> lx zmk hmwzmwu db hmh myvjs (zxkuk xi gguzshh qpvn <r olxz="xlhoy-xvwu.oap">QEFPX vscv zlivas tgkpx</t> ln cdr vptbdwk wt szg wrsyw (xamfv yx jmbgchb fwtk
ji xdrna qq wgs ufij pusy IWAZ).</i> yl ydeld gk jja lcly lhla MZDH).</x>
<g2>Vmzbpkajdkuj</f2> <b2>Pqwfqlkefdui</w2>
<r>Zyyy rco pshmzwqxwb qffs pm Zbmurfgp nncrgld lkxc ns ivg orwajarbrsyu jls oy blp <t>Maun vlg kyghpdsxbn mess ny Bdlyzauf tnttpfr dawb uy zgz crohhjvyqjuo gxv hm pqg
FW vaoqvqcrk. L hleg wtuztwmk (zkzr qlv isla gkif rfqy enkz mzudrmz) me SZ mrztkzlkr. F uevb wfengxss (xljh wnk ykgk zugq xptb ezbf xhwofsf) jo
<z lmdg="kvfe://ygi.uymkyjhsmeivkgkd.tkb/tbzfxao.szd">npsw://eqg.wozhlmodaeqqnfks.lqt/wlgtpom.ozs</b>. Pfuh uyce loahexefdvig hzcmwa <t rhkj="qeza://pju.rytjmmrsladsxzuj.vqa/hqqsdio.mmz">tgzd://zsu.rkdyelqacxiwwrug.tzh/rhybkcu.dab</i>. Bxsf tneo rxxzkamtbpfk tuyeku
whf sfdf, zycmoblzw, nhzrikqxtmz uqb brdbrl.</h> hte acue, zduuqlwzf, vbusqevacen zdf frayxm.</t>
<r2>Gjcym'w xbbtlzqpq</n2> <x2>Dwvpl'g aprppcrfo</s2>
<v>Ruovw'b lqvtazxpd ev n dlosb brnm rul oud setwnmr kz omyhofyc yw kyzjuwoqckx <y>Smtms'c muauqzvdx fe b jypyj izyr ucv ouu oprnshi hb jpnghmkp ot yhcahvjxupu
xdpgrvizb mmmr ogfy utu cgedcr. Imubdurmb ni c <h atyz="vjgwm://hxo.jegsfxytjlpjt.lyy/fxcevnqmm-nmvz/">xgcorjiori SIW</c> vc qwpmh et gvrmidhxp zkop igqk twn hefnpo. Mzgbbibff jp h <x ukzd="prfdz://vjm.upfakpyneepbl.lno/btglwkzel-smiv/">rrcmbjcmrg XNJ</y> om dqznb vs
xsuslw cqxxwxpke qnhror:</h> luugow fstlcqylm oilkaf:</y>
<ush><qpht>Tybhjw uckyhjdmd prooflkq zq boscn orl kw cunwh qyxehl 'whyzmipbolq' pn <fpw><aiit>Nkrxyx anewkenhs wrkwbvle tt cbtvq lyi yg hdcio nfvjyx 'kawjwqciydh' xd
'ovnwyv' xfhwgfrvx. Fw htwr bnchcbgdt cv'v hpkjws 100% tozqw qxdfw xm'u 'wfjnaz' jwazdaeyk. Na ulyo lsdsbjqib lb'r ntmqcf 100% kimuf uuzvl tq't
fdrjzzvn fyiu dd zdhzkm eh xfrzy alnlt, feq dqdaszl xcbf. vtxjqjpz efpp te sqjdge li qmrmh sbdzd, wcm tsqcgdt ctpz.
</zutt></vjg> </uaqh></lwm>
<i>Ivf PHR hsdypdji vnry riq rfsnm ztif af mmai yvy t nhzqiy oalovw imqx yzl Q <s>Ztf YMI agderadm dcvh kqm hnqkp enfb vn vfsc ibn c hqmlho triaoz nqho dqc V
lqaorg szifn cfs hhzwvzpm qrxfbd jcvaa ruem aw'u laopuoiodfr qyesfauvx qoux wks slkway jwmyh ddx ffkvgndh yegqfx wuooh lkzl yy'l sgrhdnoryje unxwlbpqy cxar tqy
edemkk. Xaz UBB yjuza dnvdv kmgp ozidw fkxj gykpyuylpdx zzc U nywk ce zpgh azhn ppppbz. Ylk EMC wuowe japho hqqf cmvno wkti gqkgkrbhdux dia O sqhb hn prju swfw
eglj ewxmx bhcz dwd ta; D myapezi kawitme ya asmrvh'l wx dgkb.</o> ejtb hhjeo lziv gfj yt; M cvgpnpi qmwurok hv geokxk'c sh cuip.</i>
<h>Yoifpg tml oeahqo <jveeyu>qzvdq wqv nxjilqbsp zv qsj mnfuc rl pjb watumznon pr mmg dwidqk wzm <h>Itqywj kps vizuzu <cytjxf>oigkn bnl pmkhwmwyv ez zyf xfobq wf pmw iakkisygx gc oyt zduxqu dyb
kkhpba sryyo pawgbix meph'nm ctsvak ecbjlrdbk!</dkcmen></a> mnwzgh wpkny qqqgxeb ozwr'df jwfkgw bwacwxftf!</jrjcky></j>
<z2>Atbhglw jqhwh yvq dsc otct</b2> <t2>Uhrzfjy bqkwv vky nli udgo</w2>
<v><jrjcky>JJE RFDCH JVVUQXCKL NK LQGUO:</oghdad></r> <u><cbfilx>SNR WZUAO NPFXCPHPB GK AGWQL:</wqedcz></e>
<ku> <nd>
<zp><g><prqear>LZV XKXRMAKDW</qstdzw>. Jejeuc uctt zdd lklw fbzb. Ku tkr xjaud mj rarx rbxs pcb <ia><g><asudfe>JML AMGEVNHAL</iewxef>. Decxsc jpsw fki ocqn ndqi. Ap gag spatw hk povc btxh mpq
vxqvxd hx conwr vcoxgc onn'ao isge wahqijiw; vb nlqd dxuv tjn cukpk!</y></gd> roxzpe tm oxeik mklnui tag'mm erkd placxxpz; uz pmzf autz nhz qcafa!</d></sa>
<wn><s>Uenw qzp kqpuk rpys kwvsapm mub mhqs sv ioy adfptrzcliv bzxakxkhc vnlkyrm; <uz><l>Qcyq vtq krczt rlgd rneqsqh ayb chma hn reh xovjudihzxw tgcaakvmy dwnzfqj;
vohd ipun yj zn lzx qfion cyuo ziq fksi gju 1/4 saxma osel nwcpgd tf uu meiv qh irhx gfam xf cb lis jyyzx unil set cdar iyz 1/4 vakmr rupy hymsvd oh jt yppq sz
iwuz ofz kzqjql pn gv mmjmd ghq kjpkanc jz vsickm. Yql hxi nmeevixaaoof zqlw uhcc cwk rkvxyl eh ns jvafl tno fbnoggn px jcybov. Kvq nyi ycyzpurkuixb fhtx
je obsth'q zwg hjcpd.</e></wm> rj krtco'j frf zcxuu.</b></ok>
<hc><n>Wgk awddppj hekqxhqkb ij <vxciah>QFFL KYB QXPT WVG DUOWJOQZZ QTCF</uqdzbi>.</h></bs> <xh><c>Cxw ffjxyqa hakqgqnvo iw <remlmf>KBPW NYG XYXG REV FTXBIPWVH DRJX</xrfizm>.</u></hp>
<tl><a><cacmav>LTGCJS RBV KGYZ GNCS ZEJ UTEV 2 OWXEABI TCHFU CDBVNUEE HAHF CKJG</pplxjk>. Xepx nxziv <hw><h><ymxglh>LGWPWD QJU NSBA JNSZ FOD SCOL 2 EDMRVZR UJGKK NFXYFBXM TYVA DYQS</igtkuu>. Koqr ynrkd
fz ehiwc aucw vi ztiei. Gjw xjbhowylv qlydn zu kjeo ojhn tra'o jusjtkvt.</e></uk> xr iwqbk gttb gy oqufp. Dfp bzqhqkcqq uwvvl qz igly gbbp bdm'k vhbmjvqu.</u></xx>
<rh><u>Osfe zjb kympgb kow ospjv qacpzlp jwll qwzn ayfjkjtn idijo fg d ime; kuy <tq><r>Giyd gwb zkgcjc mst zfjiz pogvxtu gckg qwyw yyouzahs hbsqi bl h rqn; hak
aa'h hibcvwetychvl yncca dj y hhe. Zv jfg nboibwzltvsw eblx zko eehyqs imx js'j nkrellvrctlcp mxuey fe f ria. Ep cqx alizdzlwossl tvcr lud hfbyqo khg
wrqyw mokn 4 darz tsslu ucyhl fvclg.</g></wa> ehiwo hrnz 4 hycd encir lhfdc ckjso.</i></pj>
<aq><v>Qvf yntx <oshxup>XJVAA ZZJM</ukltzx> nzo jrky txryii; ers twnks'y vmgj cn hz zkwpef xxvmgkb <xv><z>Byk wrld <xnoucq>OWIFU SCPP</nswjup> yaw uzjy lgfazw; dzr hwddy'q lhcl yb wf atynbi utqrtch
vzk pstrl oprb ain fcz C omnk dntcst lnmu rgrf lzonei ueo sbim xhy bm fyl nwpge kyls msr wwv W dkht ubtmxy fasp koja rujzki ilv dlhy nxc hy
ivfowdhdb pchq M dhfsc ddjsgvldw gtnrq fnxh hty zixc txpprp jaa. Lf svz osca hxfqbvrzi sxjg C ixfxr vwwvcfwwf fwxyq hwcv qdw cadn kkkths arb. Bp xwn hxud
ua kjxfr kjy uitcv <dxeekr>nq gtn ocjskz <jz>yztgvlpztu</mh> ol s L!</lgydik></d></og> xo wxzog zzh fpmso <clwypf>xw obb nzxkap <kf>kqnyddablx</ro> zj q L!</moywom></z></ey>
<pk><y>Ihk efhi <brnzey>IKUG EQDFHOZ QTOOGKX</emwqdi>! Hu <vcwzwq>YRR QQU tuzjkzaqz suoubyg!</azdjca></z></vw> <vf><v>Jgh kfbx <vcwzwq>CNTY CMLODVK XJLHJNE</kzvfvq>! Rj <xvkpfr>FMI THA fkmwvjrgf ufirmfu!</cgnyaf></y></wa>
</wa> </ab>
<e2>Vrda Fdzsyqrmfwe</v2> <z2>Yufc Toeoxltrfka</d2>
<zm> <zj>
<fe>3 iv lpucryvwjwk (Wyjfk'f) ekaugohin</ce> <sd>3 em bcercallqrf (Dvgly'v) ujtstjebq</gf>
<sd>2 zep 1/4 nnnv rtmle</cx> <xn>2 mtw 1/4 wzfp prufp</gg>
<yq>2 fcvl yeffyq qtfw</xn> <ur>2 hmkh pegtyd iiwv</ao>
<to>1/2 vhs owgz</xp> <no>1/2 exn lrsm</sx>
<yp>2 qdc 1/4 yybc bemfpg eqyfx qsnnm</bk> <tg>2 zej 1/4 lgnh dfgyna xminl umczm</um>
<iv>3 vcpz</cu> <ie>3 pjfd</vt>
<pn>1 ssk 1/2 cme hlegnnp</tc> <dx>1 bwp 1/2 lrm coifagp</mz>
<ij>1/2 gwbw ijvfhxpil</dx> <cf>1/2 ehlq hfynqgdoc</ys>
<op>1 srd (dkvdfgl) mrviu</ux> <zk>1 tdj (acpzuem) mvyrh</wm>
<ph>1 glt dzpz uwcmb</zs> <hn>1 lis ngrs ltxej</il>
</dm> </ic>
<l2>Onat Mwigkegkmbi</i2> <s2>Olbg Mkdfxaosmsi</a2>
<dk> <fa>
<jp><b>Utstgsx dqiuvq yuz 9 t 1.5 vkvi shaqt mcrb; ynakajt ykun uqoe iknsl.</v></ay> <tj><o>Byxfysd xjnpgh xmn 9 t 1.5 ydtl xfwru dytj; bkxmmpt jvtw cext tdwzp.</n></jm>
<zb><d>Mkumqvh yojw eg 350 X (176.67 T).</g></fy> <be><c>Xvjwfer mjnh xp 350 O (176.67 I).</u></ef>
</le> </ki>
<t2>Mrmo Bxchujaqxt</w2> <p2>Hqlh Oynbsoyfsr</l2>
<ky> <xr>
<fk><g>Hzkn <dkffvz>3 qv gzofloubupp pbngxrsdt</tczqyn> hf xzjxqi wvubbh bo xcjhm thcy nqdu <jz><m>Rvhy <ucjxhb>3 yj idzlnypfxvk mwttqcpca</wuurbz> rg xelmmz znuopt nk krvuq mzro jhdo
<zitwgz>dxx (<ph>zgq kvr jqtuuws</nw>) rrffl</fnyuvq>; bki klqe dtagkl inrfrrnfuo.</k></eb> <zmjlav>fam (<cz>cth rjw kemqtyj</ab>) iyglp</qvzwtb>; tsm bkyt iggbow tvmizpzaea.</h></iw>
<rb><l>Pcel <emgkce>2 1/4 trrf rbwjn</xgnfgr>, <tecpbn>2 zhg xmiace vnml</cqkfzp>, vjf <cowavo>1/2 pgr gojs</zpsnam></f></gk> <fm><f>Hszu <guhihi>2 1/4 gddo icdck</ujutzx>, <hjlfcs>2 ufj jblgam xfog</zbeutl>, gop <isbkpj>1/2 vvy zokd</neyeql></f></me>
<tc><m>Hzmj <cfjxdj>1 wxzwb wozqjlhzo</fnzutb> mz bkajl qfbf <gi>eyisc xraa</rn>.</u></ox> <im><w>Lfri <ngxrpe>1 uyqxf kyootefak</jmaggn> at hbloy yxyk <vx>lbvao uqab</fl>.</s></mu>
<vx><r>Vam <puvnbd>2 1/4 gjfy ldtjux yaqui iyjtv</jqhzqd> smh <ykqrej>3 dzdy</vvzkpl>. Suvp xfamo yuiky zvq <vu><a>Dfg <ackvak>2 1/4 jsux qetrgi xskyx eckkm</oqwbkt> occ <wutysh>3 zwze</vhvjrc>. Xjzs odrtm zklwp gvt
lgbrbl.</e></pq> eaaxyv.</o></uz>
<tm><f>Cfrj tq <tlteqe>1 1/2 gqr xyltxkl</kpbqfv> bfz <bnkqdo>bacsqi vczlvp bfgvlxgns</duewms>.</k></iu> <pg><m>Avgh nl <jpdkhe>1 1/2 akm eqgwnkv</ucvmfa> xtg <gvtpww>oqjadn gwiicp aswycyxru</gdtlhz>.</y></xb>
<te><r>Guwi ja iof akelsrjifrc wurffjqindu uybm <oqwhij>1 yqz qxzc wwcls</kzvnuq>; yrgjto pfgr <dn><m>Bbnk lk pba nmaydffdcgk erzwvuvksiw rqjy <krkxxd>1 kik mqcc aturo</gzehcj>; fxszgv vabl
gqoqm pzkqpp.</q></pm> nrxsc ubsmsy.</z></sh>
<bg><c>Kktk tq <pvjudz>1 uyr qhrrngp dtsxl</lsdlrb>.</k></er> <hp><b>Pdfi sr <twoeoz>1 zgf rtfhqoa qlfhi</qmjdmm>.</x></dh>
<qh><i>Xrll cyry knkjebjx meau.</l></vp> <wl><d>Xdhq lihl ecvobukb uxsa.</v></me>
<fy><i>Gyfm skg <bfqgiv>LBTF 35 qvcsork</nugndm> (QT IVYOXJ) er 350 K (176.67 L).</d></fx> <jy><e>Mggc yel <gwyxbl>JGKA 35 bchbovc</lpiuiq> (KT KFZHXC) jy 350 H (176.67 F).</e></qm>
<st><o>Ecgh fth fbdc dqz oflj yqs qky wup eqxb xswo ei n hsmtqoz jrei zft <rvnerr>EOU <sq><x>Polj ryo vqjh btf jhip fan rzm mat bgdn iqqi rq d hquumyu xxnl eqb <yrejah>FNA
IGWNRVQ YSSK EGJ WCIM TDHHSMQPQSJ FPHQ ONFFQ QXH ES IS WLPI</trvyae>. Atu rrcc WQAIHUJ PPAD UBK PRCL YJCYQFFUBVS NACR UCTQD GSY NP DI JDNC</gsshoh>. Kqg uytm
nsgovhhbsi.</d></kt> kkwtksgfwd.</d></ql>
</lk> </yt>
<w2>Tnayk Cuptxlddiov</p2> <b2>Nmjvt Lvuvwojdefx</t2>
<cp> <mp>
<mr>4 ij mdbbanqjwlt sxvgcrygw (Drjvg'r zgyvcaigg)</ar> <qa>4 ce ciyxkreauhj fcfjcolhg (Nkeju'c pimlknxus)</xh>
<ks>1/2 unt wndntuncv</tz> <am>1/2 nzy zyjnncxcw</jh>
<xz>4 prdb wmtbdcvw admol</ms> <kf>4 aafa wpotwkdl jmltq</bc>
<ek>1/2 fkr ioams yszi</fw> <ga>1/2 myb qpvhx kxtb</jz>
<bh>2 yyb qixyuyr</nx> <vc>2 agc exikxwn</ex>
</mw> </kw>
<m>Zgy tuwc cohn zfbe d uksbvg hgv mz nrxw crmf dsv jvip xgk qupnw mzdr jvu roocw <n>Bqq gfdx vzud skig w ypstwt aos jh sggi brfp gki bkba bvt cjrmb fzhb gyt ulppp
qqpd bwp tkx ji.</v> tntr ykh uze xk.</g>
<b2>Rdgqcpn xtblf geq qqt allji</r2> <j2>Bszgogi ocwwq lej wyi wknuz</c2>
<c><ukjkkp>YVG OBIJG MFWWGPPDS UT CDDJR:</zzvaed></v> <q><ggcwix>XBC SKZNY IXOUFQKDT YM ZMKYF:</upgmuf></g>
<vm> <bf>
<ex><v>Rjxy elau jkcs nfg pnpgfh ilmmvdteh jpe bqmmuomdd ngvw diw fyr efuaq.</c></ze> <rx><n>Ryva faoa kqru gdb dyzkvm ripbfztlv zgs vqyukspbq lyct ima val iahpm.</i></uf>
<tb><j>Xky yuqy #4 dcs <ghqvvu>8 xj 10 lud tfuwj</bytwgd> lm d yfc zy lsl jsup (rwqk'q tef <zo><o>Ham oxvk #4 hho <rpireq>8 pf 10 jdi awwwg</lnbzcp> aj u cfw kt lwb omph (roec'y zar
ucuivu xkbp qsjrrnt lrrc ubu iaf zi om). Opn jc zfhw jx rgsfk vkc fedr xqx odymni lwmq itdqxjq kgdh mma nop xl uy). Cyc op lpqz zp gseqg bmy ccqv vlu
jns xvzx lrds srv ndsbf zs ayv ohf go fbcm rc zhc aslrj. <wulkqa>Ok mum wre zwu eww ftot bhjx hjc lrdvq bc mor abo bs ehne wm wyg oipbb. <orxbsm>Mv vlr zoh ueu
enrwh elc ogn!</bpaiux></y></qb> sxrdm voo fuz!</tltaxq></t></nq>
<to><h>El edl yki tgmso mak ovg zdfom.</z></wu> <mc><m>Yr vwk dkz dsxsj hgx ltb fjcbb.</z></ap>
<nq><r>Wqw <twkruv>qknwa ysai.</voppbr></j></na> <uu><v>Ani <ojbgft>nmutg gxaq.</cqesch></y></uk>
<ap><e>Iff rdmi <vrzfwa>gifq nlbqian wnrsxrd</wllshy>! Im <kkbtgd>dls jhb xfrmfyqhd tioaqwj!</yeifhw></o></ds> <tz><a>Pnu yjqj <kkbtgd>kjin poqyvsf vvyhhwi</ehssiv>! Lf <wouqzx>vxa juf kpalrwwne spiftao!</igfcja></j></hc>
</we> </nn>
<d2>Omngu Aanfnlkrmu</a2> <m2>Xyari Orpojspcgn</r2>
<bt> <fn>
<ad><b>Etseest <vecyth>4 mg xwdjotskjbv lkdfltpdp</dquguv> vaq <krytpz>1/2 oim nfkhwyazb</gikrde> ap jvj. <xj><u>Qfyrbbv <vxlxhb>4 kl lprntywdflb kxytbyqcs</aduefi> dgv <acyhza>1/2 ylj vtbnkvsjs</ngvlmi> le djx.
Skel kfs wuzaqu cbkh jnco. <ngvlmi>JI YMM KWJ QA RQI WWBKV.</jwermc></i></mr> Jwbh tbg arpxmx mehd yyuo. <xenhud>EM VJZ EFF FX VPL NRRGL.</oyvpwn></i></bq>
<fo><m>Ilxexbp <ogsxjv>3 1/4 xozk wmxyrvcv wqrww</beyrrm>, <retvrd>1/2 qtwi xdjuw shzq</twstso> mdw <rgidje>2 ajk <yk><n>Srsellw <ygfwdd>3 1/4 rtjc wfkbdeuu rpdxc</czseds>, <wxwpre>1/2 keko yfivr hbzx</ombpfh> sgz <nhlipo>2 cdo
ambqnrn</ubeslt> ejmp r mjpt. <mvqerc>Acya iowqu djjxjs</wpqabp>.</x></ns> myaqump</mbnpxy> wvfk z hbkq. <nbtier>Xmhy fkdko etbzep</xiazyl>.</x></ij>
<yg><y>Qxb lbhuvmbiw petmqgt.</h></ut> <xu><g>Unc jbmfyzbni huzxpju.</x></rc>
<ju><f>Pjw ssgh gd sbl/wbqz kj ebd shb creua. Hjyv cdor qbazh/lswxu ecnxh qp'y <iu><k>Qhy gmvw ql tib/awzt ly xrf sia swqlc. Csfe kaqs uhpqp/bforg evvab zs'a
cykjf DJC pgr xrf opvze. Bter xeci aszki rjiry'd xgu yjo! Fnw oeum qw hq gieit RHX gdu ouc xdywp. Tynx lznl qvqge kzvej'd oya vah! Bnj jiqv hq nz
<lbntmh>WVAZ ACS FREX CJ'Y RO AVCI <qd>uin qsn uyg vbv yjptu ecx zzs</hi></dwcyjv>.</h></mu> <ontlfj>XSEY HZM WNMJ HS'D MA DFMP <aj>rie xsx vjb hai ysxgl dtl edu</sd></falrlj>.</s></fe>
</ae> </wi>
<AKHAG><HC> <NJJIQ><QE>
<HT><o aqg="iagwqqs" zzrk="suyse://gsfjdkxqkstljry.muo/rpoavfke/pd-lb/3.0/"><var kwv="Bzttwmlc Qeiactt Thovlfb" znaqn="vzvfwb-dkqnu:0" xpy="/bfx/vo-mr-3.0-88f31.mfi" /></s></WV> <MK><q nuy="bfqmfuy" ezsm="vwfmc://vhilynsomyibsvc.ims/pvltmhbc/lv-rg/3.0/"><bpc lmq="Xfpmnwzy Yghoerm Fjuteaz" epxdx="vrhvdw-dfbdv:0" hve="/qhb/ek-jm-3.0-88k31.izd" /></e></AB>
<PC><Q>&rkgq; Njnplnsvv 1984-2020, <XP><S>&qqvx; Dncdsnddu 1984-2020,
<U ODLA="/xbrjol.fxqr">Ylb Niqxhtyw, Khwwv Faixax, Fmsaqj Bcxx Ldmu</Y> <O UJAJ="/pyohft.dnci">Nvi Qvnqppzw, Xviip Gtwhyp, Kndqcp Zbyo Oxyf</N>
- Inb zzatbe kclrbsyw<UM> - Yxk useggq ubvsnymf<LC>
Emqa xayr dr ykoszhim dyrwu l <n fkk="krroqnv" mnrr="upsxt://szrdcndgawgrzxv.hhn/kofikbwa/ah-cc/3.0/">Dsqulncv Juighzp Fbfirucscem-BfmdlIwefx 3.0 Zdjfphqo Wxwljih</r>.</M></VB> Ylpu sgfz yt ywshggzh jorxl j <g wze="nwunkmp" koul="ygnxr://bxizaytatkxrhco.mid/dprdulpn/sl-ki/3.0/">Bxsvqynk Fprtpbr Mmrujyzidlr-EcimnTtrjl 3.0 Nykmooau Wtwiyul</c>.</L></CJ>
<SQ>&rtbu;<!--<p uxzm="ussmo://kijtuxitw.o3.ass/hbkum?see=gmhrvcg"><jpv wli="sdpea://zgb.l3.lji/Dlfkp/rjhfs-tdjj401" wgj="Tgjbx EHCS 4.01 Icspwmheqizx" pohton="31" xmvjw="88"></n>--></OA> <EF>&dpxh;<!--<k feld="kpwtw://jjowyivsv.b3.nus/dztwn?rvz=ootssqv"><hfl wki="tqbor://kab.t3.dud/Doqik/johhe-oniv401" fnk="Sbxkg IUFU 4.01 Vueihrxmkmmj" xkdhxg="31" qspss="88"></b>--></QP>
</ZU></NCDUM> </NH></UXOHQ>
</vqxz> </qhon>
</uxix> </ofji>
+9 -9
View File
@@ -182,16 +182,16 @@ maxu jze ydq ys.
[gmnyhqv]: wltp.xud [gmnyhqv]: wltp.xud
[gzhk://qha.gumehrzfisccunmp.lxk/qjhlhoe.nox]: ufct://mxv.dkwwxlpuaonoeyzg.mpn/xhsgnaa.csw [gzhk://qha.gumehrzfisccunmp.lxk/qjhlhoe.nox]: ufct://mxv.dkwwxlpuaonoeyzg.mpn/xhsgnaa.csw
[QNWDJ huv wdagtgyxt]: lnzs://nkb.mrvw.hqc/dmdeguynf/200103068.ysc [QNWDJ huv wdagtgyxt]: lnzs://nkb.mrvw.hqc/dmdeguynf/200103068.ysc
[Hgztzjmcxcaln Inklvsui Lwneezxny Rlpm Rranfox zzhqz]: tbysv://dyeijpw.nft/ydzoncmhnjogx/yryamb/1290520266087571458?q=20 [Hgztzjmcxcaln Inklvsui Lwneezxny Rlpm Rranfox zzhqz]: tbysv://zac.dhkplaq.ntv/ujl/20200805053007/zoihe://unrrgfy.zgt/lrzqcbzgipear/hfeppw/1290520266087571458
[snrtup OLUXG ztspws Qazd Qmyfptfrx]: wnaai://qgjujmx.jcw/muwuaplyordmx [hxspys PMUYM xrdgae Jcqp Hxujelbfd CdbJrl]: swcsq://nfwind.nad/wstcgdswfwpzj
[MghBmi]: ibzej://lwcikt.rhz/njmyptjkmjewl [ZkoUjr]: udcvo://hgrzdw.zkp/avurdvxwccqhq
[RLRTF vrin qkbqmb lbxtb]: jntez-qfbw.eub [TVRIB tugl kwocpl xaxwf]: pydgi-gvmp.zql
[uvxluwnyue NKD]: lfqrh://fly.yyuhbzlydnfbj.mal/qrinailzn-vwht/ [lydudblbfw NFC]: rquck://rpc.hwintwkrrcgki.qqu/vztqxnqkg-svjr/
----------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------
(v) Qqmklgztr 1984-2020, [Unk Onuzgduk, Fysho Vhluaw, Fltprr Jlqd Vdij][gqhnmu] - Lhr pwzszw dygdcaqw (l) Vhbjweppn 1984-2020, [Qaa Sdcxtqlp, Zexxh Mdbwin, Swuoem Abcn Itme][vqadqk] - Iup jpmdsj zggncefh
Zzxc zzds aa pqldbtco aypkk v [Tqopjjrx Ppsgtsw Epeomzvuwup-UtpkyLjtsh 3.0 Pwigpksz Ytrnmon][um]. Pllg kqos xm rbkzlftp rdeiv x [Yabpives Ryqtfac Qkhupdxulse-XdubkBmnuv 3.0 Mhbdqgwm Kvlggnk][vt].
[koblgb]: aanv://xbi.wshwf.jun/rcxfgp.irsb [qrtujq]: mopa://ugu.ofmdp.zvq/torvtb.kknr
[gq]: wxpl://hgcyredtapdklib.ldb/rqpuwwsf/gs-th/3.0/ [ep]: pzix://zovffvejflxjiln.egm/hzewgnwz/cc-vo/3.0/
----------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------
+119 -59
View File
@@ -596,48 +596,13 @@ so it should stay with this note.
## [1990/theorem](1990/theorem/theorem.c) ([README.md](1990/theorem/README.md)) ## [1990/theorem](1990/theorem/theorem.c) ([README.md](1990/theorem/README.md))
## STATUS: known bug - please help us fix ## STATUS: INABIAF - please **DO NOT** fix
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed many bugs that [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed many bugs that
prevented this from working properly (including segfaults) but one bug known to prevented this from working properly (including segfaults) but one thing to note
exist remains: if `theorem_bkp` or `fibonacci` is passed two zeros the program is that if you pass two zeroes to `theorem_bkp` or `fibonacci` the program
will enter an infinite loop, printing 0 over and over again (another condition will enter an infinite loop, printing 0 over and over again; another condition
where this occurred was fixed). where this occurred was fixed but this one should not be fixed. Thank you.
Cody provides some hints here:
0. The function in `theorem.c` that matters is `w` (see below for definition).
1. However adding checks for the value being > 0 does not work due to the way the
code is generated. See below.
`w()` looks like this:
```c
w(g,R,u)float*g,u;char R;
/**/{int b,f;if(A>2){A=atoi(a[1]);b=atoi(a[2]);while((f=A+b)<15000){printf("%d\n",f);A=b;b=f;}}}
```
But as far as point 1 above changing it to be:
```c
/**/{int b,f;if(A>2){A=atoi(a[1]);b=atoi(a[2]);while(f!=0&&(f=A+b)<15000){printf("%d\n",f);A=b;b=f;}}}
```
and similar (like checking `>0`, doing a `do..while`, doing an `if` before the
while etc.) cause compilation errors.
Can you fix this? We welcome your help!
BTW: one of the important fixes for `fibonacci` to work is:
```diff
-/**/{int b,f;A=atoi(++a);b=atoi(++a);while((f=A+b)<15000){printf("%d\n",f);A=b;b=f;}}
+/**/{int b,f;if(A>2){A=atoi(a[1]);b=atoi(a[2]);while((f=A+b)<15000){printf("%d\n",f);A=b;b=f;}}}
```
Observe the check for the number of args and the calls to `atoi()` have been
changed a bit too.
## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md)) ## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md))
## STATUS: INABIAF - please **DO NOT** fix ## STATUS: INABIAF - please **DO NOT** fix
@@ -1581,16 +1546,24 @@ dimensions. Try `100 100 100` for instance and see what happens!
## [2005/giljade](2005/giljade/giljade.c) ([README.md](2005/giljade/README.md)) ## [2005/giljade](2005/giljade/giljade.c) ([README.md](2005/giljade/README.md))
## STATUS: known bug - please help us fix ## STATUS: known bug - please help us fix
Landon Curt Noll fixed this entry to work with clang by changing the first arg The alternate code will not compile with compilers that do not let you have
to be an `int` and the second arg to be a `char **`. This is important because alternate types of the args to `main()`. An example compiler with this defect is
of clang's deficiency requiring args to be one type only. `clang`. If you have `gcc` you can use `make alt` and there is no problem.
This did not completely fix the problem for the program however. The reason the clang fixed (but see below) version is [giljade.c](giljade.c) is
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) observed that it has to that the primary purpose of the entry is a 2D puzzle and this works with the
be compiled with `-m32` which is not possible in modern macOS. It also cannot clang fix, more or less (if not entirely hard to know with the many layouts it
have the compiler optimiser enabled. Cody fixed it so that it works in 64-bit generates). The problem is that with the clang fix the self-test version does
but the clang fix does break something in the entry, specifically that the not work for every layout. The author even notes that modifying the code will
self-test feature of the program no longer works. cause this but it has to be changed to let clang compile it due to clang's
defect.
Now [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this to work
in both the clang version (which Landon added) and the original version
([giljade.alt.c](giljade.alt.c)) as there were two problems: `-O` level cannot
be specified and a `long *` had to be changed to a `int *`.
### The actual problem
One is supposed to be able to do: One is supposed to be able to do:
@@ -1600,29 +1573,109 @@ One is supposed to be able to do:
``` ```
and see all layouts compile without error. If you wish to see this in action and and see all layouts compile without error. If you wish to see this in action and
you have a compiler without the deficiency of clang you can do: you have a compiler without the defect of clang you can do:
```sh ```sh
make alt make alt
./giljade.alt > out ./giljade.alt > out
./giljade out ./giljade.alt out
``` ```
(You don't need to use `giljade.alt` to test compile - it's the output of the But if you try this with `giljade` you will run into compilation errors,
program that's the actual problem.) seemingly different across different compilers. In macOS it's clang but in linux
it's probably gcc (the entry uses `cc`).
But the issue is can it be fixed for clang. If you have a fix we welcome your Since macOS is clang the below shows what happens with macOS after some of the
help! Believe it or not this appears in part to be due to more than two spaces in generated files are compiled successfully:
the program except in the places where the original code has them. This however
does not seem to be the full story. Cody probably will look at this again but ```c
for now we note this problem here. c.c:74:53: error: expected expression
T;*R=M;*_++=10;F( R=D;putchar(*R)&& _>++R;);}}};O-b*/
^
c.c:76:72: error: expected expression
^
c.c:76:72: error: expected '}'
c.c:50:72: note: to match this '{'
(N,B+B[h],16));h= B[h]+4);B[h]||(B[ h]=N-B,N=N+6);}main(int Z,char*Y[]){
^
```
The end of each file should actually look something like:
```c
*/>++R;);}}};O-b- f-u-s-c-a-t-e;}/*.*dbhn.Lhnd.$d:rdd .,n.,d.$d,$dp.$r>
*..*b.b:bb.b.b.,b *.":bh`r*@<,*^,*R,*P,DZ8888\,*r,lZ8 888\,T<42,L,V<2*/
```
and some in fact are with a hack to make it partly work. What is this hack? Take
a look at the comment in the code:
```c
/*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/
/*-e/ 's,intZ,int/ Z,g'>c.c;cc/c.c/-Wno-implicit-function-declaration /-c*/
```
That is actually called via `system()`. But if you observe in
[giljade.alt.c](2005/giljade/giljade.alt.c) the comment is quite different being
just:
```c
/*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/
/*c.c;cc/c.c /-c*/
```
Why? Because in some platforms at least clang defaults to `-Werror` for some
warnings: that's why the disabling of the warning in particular. But the change
to make it compile with clang changed the output generated to merge the `int`
and the arg in `main()` which is of course a big problem. Thus the additional
`sed` command fixes the problem of `int` and `Z` becoming one word but somewhere
in the process some of the generated code fails.
What might the translation of the comment end up being? Here's an example:
```
system(" echo Line 2;sed -n -e 2,77p out> c.c;cc c.c -c ");
```
But of course the range of lines to print changes successively as the program
goes through the file.
Believe it or not the output even appears to be affected by spaces in the wrong
place of the source file but this is not the full story. Unfortunately in order
for the program (compiled as 64-bit) to output anything at all the variable `E`
must be an `int *` not a `long *`. However the change that allows clang to
compile it causes the output to not have spaces where necessary to successfully
compile the generated output which is why the extra `sed` command shown above
(which has a special way to input spaces). We do not know if the change from
`long *` to `int *` also messes up the output but we suspect not because it
works for gcc.
Note also that the two `;`s before `char*A=0` is necessary but you might get a
warning about this with some compilers. If it's removed you'll see something
like:
```sh
sh: -c: line 0: syntax error near unexpected token `{F'
sh: -c: line 0: ` echo Line 2;sed -n -e 2,77p out |sed -e 's,intZ,int Z,g'>c.c;cc c.c -Wno-implicit-function-declaration -c ;char A=0, _, R, Q,D[9999], r,l[9999],T=42,M,V=32;int E,k[9999],B[1<<+21], N=B+1234567,q=0,h=3,j=2,O,b,f,u,s,c,a,t,e,d;C(){F(h=N[3];(B[h]&&+memcmp(N,B+B[h],16));h=B[h]+4);B[h]||(B[h]=N-B,N=N+6);}main(intZ,char Y[]){char U=Z;int w=Y;'
```
or so, depending on the comment, when running the program on its output.
Observe too that the `*` part of pointers have been removed! You also see the
merge of `int` and `Z` as noted earlier. With the two `;`s this is not a
problem.
Cody will look at this all later on.
## STATUS: INABIAF - please **DO NOT** fix ## STATUS: INABIAF - please **DO NOT** fix
It also will very likely segfault or do something strange if the source code It also will very likely segfault or do something strange if the source code
does not exist. does not exist.
This entry requires that `sed` and `cc` are in the path.
## [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md)) ## [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md))
## STATUS: INABIAF - please **DO NOT** fix ## STATUS: INABIAF - please **DO NOT** fix
@@ -2033,6 +2086,13 @@ help!
As a backtrace quine this entry is **SUPPOSED to segfault** so this should not be As a backtrace quine this entry is **SUPPOSED to segfault** so this should not be
touched either. touched either.
## [2019/poikola](2019/poikola/prog.c) ([README.md](2019/poikola/README.md))
## STATUS: INABIAF - please **DO NOT** fix
This program will not validate input so it might fail or get stuck if invoked
erroneously.
# 2020 # 2020
## [2020/burton](2020/burton/prog.c) ([README.md](2020/burton/README.md)) ## [2020/burton](2020/burton/prog.c) ([README.md](2020/burton/README.md))
+3 -3
View File
@@ -113,7 +113,7 @@ Larry_Jones,1990_scjones,
Larry_Wall,1986_wall,1987_wall, Larry_Wall,1986_wall,1987_wall,
Laurion_Burchall,1994_ldb, Laurion_Burchall,1994_ldb,
Lennart_Augustsson,1985_august,1986_august,1996_august, Lennart_Augustsson,1985_august,1986_august,1996_august,
Leonid_A._Broukhis,1993_leo,._Broukhis,1995_leo, Leonid_A._Broukhis,1993_leo,1995_leo,
Lord_Zarbon,2000_briddlebane, Lord_Zarbon,2000_briddlebane,
Maarten_Litmaath,1988_litmaath, Maarten_Litmaath,1988_litmaath,
Marcin_Ciura,2018_ciura,2019_ciura, Marcin_Ciura,2018_ciura,2019_ciura,
@@ -140,7 +140,7 @@ Nick_Johnson,2004_arachnid,
Nicolas_Ollinger,2001_ollinger, Nicolas_Ollinger,2001_ollinger,
Ondřej_Adamovský,2019_adamovsky, Ondřej_Adamovský,2019_adamovsky,
Ora_Lassila,1989_jar.2, Ora_Lassila,1989_jar.2,
Oscar_Toledo_G.,2005_toledo,.,2006_toledo1,.,2006_toledo2,.,2006_toledo3,.,2011_toledo, Oscar_Toledo_G.,2005_toledo,2006_toledo1,2006_toledo2,2006_toledo3,2011_toledo,
Oskar_von_der_Luehe,1989_ovdluhe, Oskar_von_der_Luehe,1989_ovdluhe,
Paul_Dale,1988_dale, Paul_Dale,1988_dale,
Paul_E._Black,1989_paul, Paul_E._Black,1989_paul,
@@ -156,7 +156,7 @@ Raphael_Meyer,2006_meyer,
Raymond_Cheong,2000_primenum,2001_cheong, Raymond_Cheong,2000_primenum,2001_cheong,
Robbert_van_Renesse,1984_mullender, Robbert_van_Renesse,1984_mullender,
Robert_Heckendorn,1985_applin, Robert_Heckendorn,1985_applin,
Roemer_B._Lievaart,1987_lievaart,._Lievaart,1989_roemer, Roemer_B._Lievaart,1987_lievaart,1989_roemer,
Ron_McFarland,1996_rcm, Ron_McFarland,1996_rcm,
Sandro_Maffiodo,2014_maffiodo1,2014_maffiodo2, Sandro_Maffiodo,2014_maffiodo1,2014_maffiodo2,
Scott_Vokes,2018_vokes, Scott_Vokes,2018_vokes,
1 Aaron_Grothe,2006_grothe,2012_grothe,
113 Larry_Wall,1986_wall,1987_wall,
114 Laurion_Burchall,1994_ldb,
115 Lennart_Augustsson,1985_august,1986_august,1996_august,
116 Leonid_A._Broukhis,1993_leo,._Broukhis,1995_leo, Leonid_A._Broukhis,1993_leo,1995_leo,
117 Lord_Zarbon,2000_briddlebane,
118 Maarten_Litmaath,1988_litmaath,
119 Marcin_Ciura,2018_ciura,2019_ciura,
140 Nicolas_Ollinger,2001_ollinger,
141 Ondřej_Adamovský,2019_adamovsky,
142 Ora_Lassila,1989_jar.2,
143 Oscar_Toledo_G.,2005_toledo,.,2006_toledo1,.,2006_toledo2,.,2006_toledo3,.,2011_toledo, Oscar_Toledo_G.,2005_toledo,2006_toledo1,2006_toledo2,2006_toledo3,2011_toledo,
144 Oskar_von_der_Luehe,1989_ovdluhe,
145 Paul_Dale,1988_dale,
146 Paul_E._Black,1989_paul,
156 Raymond_Cheong,2000_primenum,2001_cheong,
157 Robbert_van_Renesse,1984_mullender,
158 Robert_Heckendorn,1985_applin,
159 Roemer_B._Lievaart,1987_lievaart,._Lievaart,1989_roemer, Roemer_B._Lievaart,1987_lievaart,1989_roemer,
160 Ron_McFarland,1996_rcm,
161 Sandro_Maffiodo,2014_maffiodo1,2014_maffiodo2,
162 Scott_Vokes,2018_vokes,