From 32a6d4b626cc82803b8b0972f9bcb89a112cc7e8 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 6 Nov 2023 04:49:24 -0800 Subject: [PATCH] Actually add 1991/buzzard/buzzard.alt.c The alt version can be more at home for those familiar with vi(m) (it certainly is for me): instead of 'f' for forwards, 'l' for left and 'r' for right it is now 'k', 'h' and 'l' respectively. The program does not allow one to go backwards so this was not touched but if it did it would have been 'j': because we vi(m) users are strange :-) --- 1991/buzzard/.gitignore | 1 + 1991/buzzard/buzzard.alt.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 1991/buzzard/buzzard.alt.c diff --git a/1991/buzzard/.gitignore b/1991/buzzard/.gitignore index 6e681b16b..fc88541db 100644 --- a/1991/buzzard/.gitignore +++ b/1991/buzzard/.gitignore @@ -1,3 +1,4 @@ buzzard +buzzard.alt buzzard.orig prog.orig diff --git a/1991/buzzard/buzzard.alt.c b/1991/buzzard/buzzard.alt.c new file mode 100644 index 000000000..ae4af0a1a --- /dev/null +++ b/1991/buzzard/buzzard.alt.c @@ -0,0 +1,31 @@ +#include +#define X(s) (!(s&3)-((s&3)==2)) +#define W while +char Z[82][82],A,B,f,g=26;z(q)char**q;{return atoi(q);}m(d,l){return +Z[ B + X ( f + +3) * d+l *X(f+ 2 )][ A+X ( f ) * d + +l* X ( f + 3 ) ] ;}int +h= 0;D(p,s)char*s; {W(h>>3

> 3 ) {putchar('\t' +); h = ( h +8 +)&~7 ;}W(h < p ){putchar(' ');++h; }(void)printf( +"%s" , s ) ;h+=strlen(s);}main(x,a)char **a; { +# define P(x) (x?(5-(x))*(6-(x ))/2:11) +int b; { char b[256],i, j=0; FILE*F;F=fopen(x-1?a[1]:__FILE__,"r");W( +fgets( b ,256 ,F)){for(i=0;b[ i];++ i) +Z[j][i ] =( b [ i ] ==' '?1:2*(b[i]==(x>2?*a[2]:'\\')));++j;}fclose +(F);}A =4 ; B = 3 ; f = 1;x >3? A=z(a[3]),B=z(a[4]):0;b='\n';do{if(b=='\n' +){int y , s , d , p , q ,i;for +(y=-11; y<= 11;++ y){ for(s = 1 ,d=0;s+3;s-=2){for +(;d!=2 + 3 * s ; d+=s){ +if(m(d,0) !=1 ){p=P (d) ;if (abs( y ) + p)break;for +(i =-p;iq)continue;if +(abs(y) 0)?"\\":"/");}d-=s;}puts( +"");h=0;}}f+=(b=='l')-(b=='h');f&=3;if(b=='k'){if(!m(1,0))continue; +A+=X(f);B+=X(f-1);}}W((b=getchar())!=-1&&m(0,0)==1);return 0;}