Add second arg to main in 1995/cdua
.. in both versions.
This commit is contained in:
1 parent
eed35127cc
commit
aabb60668a
3 files changed
+17
-10
No files matched your search
@@ -8,13 +8,13 @@ char*u0="<RET> to begin... ",*u1="Already been here!",*u2="Found a wall! \
|
|||||||
",*u3="Walking... ",*u4="Finished. ",*u5="Going back..\
|
",*u3="Walking... ",*u4="Finished. ",*u5="Going back..\
|
||||||
. ",*o="\033[23;1HDone!!\n",*x="\033[2J",*y="\033[1;1H",*z="\033[%d;%\
|
. ",*o="\033[23;1HDone!!\n",*x="\033[2J",*y="\033[1;1H",*z="\033[%d;%\
|
||||||
dH%c",*w="\033[1;1H%s",*v="\033[%d;%dH%c\033[%d;%dH%c\033[%d;%dH%c",b[1841
|
dH%c",*w="\033[1;1H%s",*v="\033[%d;%dH%c\033[%d;%dH%c\033[%d;%dH%c",b[1841
|
||||||
];int c,d,e,f,g;typedef int(*h)();h i,k,l,m,n;rand(
|
];int c,d,e,f,g;typedef int(*h)();h i,k,l,m;int(*n)(int,char**);rand(
|
||||||
),time(),getchar();int main(int a){k=rand,l=time,m=getchar,
|
),time(),getchar();int main(int a,char**j){k=rand,l=time,m=getchar,
|
||||||
n=main;if(!c)for(srand(l(0)),g=a=1000,--d;++d<1840;b[c=d]=" #\n"[d%80==79?2:d/80
|
n=main;if(!c)for(srand(l(0)),g=a=1000,--d;++d<1840;b[c=d]=" #\n"[d%80==79?2:d/80
|
||||||
&&d%80&&d/80-22&&d%80-78]);if(!(c-1839))++c,printf("%s%s%s",x,y,b);k:if(!(c-1840)
|
&&d%80&&d/80-22&&d%80-78]);if(!(c-1839))++c,printf("%s%s%s",x,y,b);k:if(!(c-1840)
|
||||||
&&(b[a+2]+b[a-2]+b[a+160]+b[a-160]-4*' ')){while(b[a+(f=(e=k()%4)?e-1?e-2?-1
|
&&(b[a+2]+b[a-2]+b[a+160]+b[a-160]-4*' ')){while(b[a+(f=(e=k()%4)?e-1?e-2?-1
|
||||||
:1:-80:80)*2]!='#');b[a]=b[a+f]=b[f+a+f]=' ';printf(v,a/80+1,1+a%80,' ',(a+f)/80+
|
:1:-80:80)*2]!='#');b[a]=b[a+f]=b[f+a+f]=' ';printf(v,a/80+1,1+a%80,' ',(a+f)/80+
|
||||||
1,1+(a+f)%80,' ',(f+a+f)/80+1,1+(f+a+f)%80,' ');n(f+a+f);goto k;}else if(!(g
|
1,1+(a+f)%80,' ',(f+a+f)/80+1,1+(f+a+f)%80,' ');n(f+a+f,0);goto k;}else if(!(g
|
||||||
-a))c=1,a=162,printf(w,u0),m();if(c-1){}else r b[a]!=' '?(usleep(Z),printf(w,b[a]=='.'?u1:u2),0)
|
-a))c=1,a=162,printf(w,u0),m();if(c-1){}else r b[a]!=' '?(usleep(Z),printf(w,b[a]=='.'?u1:u2),0)
|
||||||
:(b[a]='.',printf(w,u3),printf(z,a/80+1,1+a%80,'.'),a==1676?(printf(w,u4),printf(o),1):n(a+1)||n
|
:(b[a]='.',printf(w,u3),printf(z,a/80+1,1+a%80,'.'),a==1676?(printf(w,u4),printf(o),1):n(a+1,0)||n
|
||||||
(a+80)||n(a-80)||n(a-1)?1:(b[a]=' ',printf(w,u5),printf(z,a/80+1,1+a%80,' '),0));r 0;}
|
(a+80,0)||n(a-80,0)||n(a-1,0)?1:(b[a]=' ',printf(w,u5),printf(z,a/80+1,1+a%80,' '),0));r 0;}
|
||||||
+5
-5
@@ -4,13 +4,13 @@ char*u0="<RET> to begin... ",*u1="Already been here!",*u2="Found a wall! \
|
|||||||
",*u3="Walking... ",*u4="Finished. ",*u5="Going back..\
|
",*u3="Walking... ",*u4="Finished. ",*u5="Going back..\
|
||||||
. ",*o="\033[23;1HDone!!\n",*x="\033[2J",*y="\033[1;1H",*z="\033[%d;%\
|
. ",*o="\033[23;1HDone!!\n",*x="\033[2J",*y="\033[1;1H",*z="\033[%d;%\
|
||||||
dH%c",*w="\033[1;1H%s",*v="\033[%d;%dH%c\033[%d;%dH%c\033[%d;%dH%c",b[1841
|
dH%c",*w="\033[1;1H%s",*v="\033[%d;%dH%c\033[%d;%dH%c\033[%d;%dH%c",b[1841
|
||||||
];int c,d,e,f,g;typedef int(*h)();h i,k,l,m,n;rand(
|
];int c,d,e,f,g;typedef int(*h)();h i,k,l,m;int(*n)(int,char**);rand(
|
||||||
),time(),getchar();int main(int a){k=rand,l=time,m=getchar,
|
),time(),getchar();int main(int a,char**j){k=rand,l=time,m=getchar,
|
||||||
n=main;if(!c)for(srand(l(0)),g=a=1000,--d;++d<1840;b[c=d]=" #\n"[d%80==79?2:d/80
|
n=main;if(!c)for(srand(l(0)),g=a=1000,--d;++d<1840;b[c=d]=" #\n"[d%80==79?2:d/80
|
||||||
&&d%80&&d/80-22&&d%80-78]);if(!(c-1839))++c,printf("%s%s%s",x,y,b);k:if(!(c-1840)
|
&&d%80&&d/80-22&&d%80-78]);if(!(c-1839))++c,printf("%s%s%s",x,y,b);k:if(!(c-1840)
|
||||||
&&(b[a+2]+b[a-2]+b[a+160]+b[a-160]-4*' ')){while(b[a+(f=(e=k()%4)?e-1?e-2?-1
|
&&(b[a+2]+b[a-2]+b[a+160]+b[a-160]-4*' ')){while(b[a+(f=(e=k()%4)?e-1?e-2?-1
|
||||||
:1:-80:80)*2]!='#');b[a]=b[a+f]=b[f+a+f]=' ';printf(v,a/80+1,1+a%80,' ',(a+f)/80+
|
:1:-80:80)*2]!='#');b[a]=b[a+f]=b[f+a+f]=' ';printf(v,a/80+1,1+a%80,' ',(a+f)/80+
|
||||||
1,1+(a+f)%80,' ',(f+a+f)/80+1,1+(f+a+f)%80,' ');n(f+a+f);goto k;}else if(!(g
|
1,1+(a+f)%80,' ',(f+a+f)/80+1,1+(f+a+f)%80,' ');n(f+a+f,0);goto k;}else if(!(g
|
||||||
-a))c=1,a=162,printf(w,u0),m();if(c-1){}else r b[a]!=' '?(printf(w,b[a]=='.'?u1:u2),0)
|
-a))c=1,a=162,printf(w,u0),m();if(c-1){}else r b[a]!=' '?(printf(w,b[a]=='.'?u1:u2),0)
|
||||||
:(b[a]='.',printf(w,u3),printf(z,a/80+1,1+a%80,'.'),a==1676?(printf(w,u4),printf(o),1):n(a+1)||n
|
:(b[a]='.',printf(w,u3),printf(z,a/80+1,1+a%80,'.'),a==1676?(printf(w,u4),printf(o),1):n(a+1,0)||n
|
||||||
(a+80)||n(a-80)||n(a-1)?1:(b[a]=' ',printf(w,u5),printf(z,a/80+1,1+a%80,' '),0));r 0;}
|
(a+80,0)||n(a-80,0)||n(a-1,0)?1:(b[a]=' ',printf(w,u5),printf(z,a/80+1,1+a%80,' '),0));r 0;}
|
||||||
@@ -1808,6 +1808,13 @@ particular to make it easier to see the program do what it does in systems that
|
|||||||
are too fast ... if there is such a thing anyway :-) ). See the README.md for
|
are too fast ... if there is such a thing anyway :-) ). See the README.md for
|
||||||
details on this.
|
details on this.
|
||||||
|
|
||||||
|
Out of an abundance of caution with clang, Cody also added a second arg to
|
||||||
|
`main()` as some versions of clang whine about the number of args on top of the
|
||||||
|
type of args. In particular some versions supposedly only allow 0, 2 or 3 args.
|
||||||
|
It actually appears to allow 1 but if you specify 4 it says 0, 2 or 3 and it is
|
||||||
|
an error but it's entirely possible that they will eventually make the defect
|
||||||
|
function as the error message claims.
|
||||||
|
|
||||||
|
|
||||||
## [1995/dodsond1](1995/dodsond1/dodsond1.c) ([README.md](1995/dodsond1/README.md]))
|
## [1995/dodsond1](1995/dodsond1/dodsond1.c) ([README.md](1995/dodsond1/README.md]))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user