🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.apple2.gno
2 messages
2 total messages Started by Soenke Behrens Fri, 18 Dec 1992 16:56
Dummlall
#410
Author: Soenke Behrens
Date: Fri, 18 Dec 1992 16:56
51 lines
2609 bytes
Yup,

this is a maze program. Quite short, actually. Found it on the net and think
it to be neat, so here you are.

'a' means turn left, 'd' turn right, 's' step forward. You may specify more
than one command per step.
Ah yes: Very important: Name this file buzzard.c, cmpl it, and keep both the
source and the executable together.

Soenke

======== schnipp ============ schnapp =============

#include <stdio.h>
#define X(s) (!(s&3)-((s&3)==2))
#define W while
char Z[82][82],A,B,f,g=26;z(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<p>> 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]:"buzzard.c","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&&   !   m       (       d   , 0 )||abs(y)>p)break;for
(i  =-p;i<p;++i)D(g+i*2,"--");D(0,"\-");break;}if(d==5)continue;
p=P(d+1);q=P(d);if
(abs(y)		>q)continue;if 
(abs(y)		<p)D(g-s*(2*p+1),"|");else if(m(d,s)){if
(abs(y)		<=p)for(i=(s==1?-q:p);i!=(s==1?-p:q);
(abs(y)		),++i)D(g+2*i+(s==-1),"--");}else if
(abs(y)		==p)D(g-s*(2*p+1),"|");else D(g-
(abs(y)		*s*2),(s==1)^(y>0)?"\\":"/");}d-=s;}puts(
"");h=0;}}f+=(b=='d')-(b=='a');f&=3;if(b=='s'){if(!m(1,0))continue;
A+=X(f);B+=X(f-1);}}W((b=getchar())!=-1&&m(0,0)==1);return 0;}

-- 
===========================================================================
More than silver, more than gold, I need   !    behrenss@informatik.
electricity. I need it for my dreams.      !    tu-muenchen.de
(RACTER)                                   !  FIDO: 2:246/13 Soenke Behrens
Re: Dummlall
#425
Author: Brian Tao
Date: Sun, 20 Dec 1992 18:24
13 lines
995 bytes
In article <behrenss.724697782@hphalle6> behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens) writes:
>Yup,
>
>this is a maze program. Quite short, actually. Found it on the net and think
>it to be neat, so here you are.

    Cool, reminds me of those one and two-liner Applesoft BASIC programs that
used to appear in Nibble (RIP)...
-- 
-- Real name: Brian Tao (Dept. of Exobiology, University of Toronto)
-- Preferred: 90taobri@chasm.scar.utoronto.ca (checked daily)
-- Alternate: taob@r-node.pci.on.ca (no mail over 15K, please!)
--                                   """""""""""""""""""""""""
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads