Files
Cody Boone Ferguson ad703d3188 Improve and add 2012/endoh1 try scripts
The new try.sh and try.bw.sh scripts run the program on one file (passed
to the script) in colour and without colour respectively. One file
because one has to terminate the program.

The new try.alt.bw.sh is like try.alt.sh but uses the black and white
(original submitted entry) version.

The scripts for the alt code allow one to set the different variables
that can be redefined. The use is the same variable names as in the
Makefile. For instance:

   TIMER=5 SLEEP=5000 GRAVITY=I VISCOSITY=4 PRESSURE=1 ./try.alt.sh
   TIMER=5 SLEEP=5000 GRAVITY=I VISCOSITY=4 PRESSURE=1 ./try.bw.alt.sh

for the gravity 'I' and:

   TIMER=5 SLEEP=5000 GRAVITY=N VISCOSITY=4 PRESSURE=1 ./try.alt.sh
   TIMER=5 SLEEP=5000 GRAVITY=N VISCOSITY=4 PRESSURE=1 ./try.bw.alt.sh

where 'N' is some number. Obviously the other values can have different
values than given above. Some of these values are protected against in
code (to an extent - if the user wants to set them to strings that's on
them) but not all are and the scripts do not try and check for the user
either.

The endoh1.alt.c file was changed in that one can now define SLEEP (S in
the code) to 0 like the original, should they want to see the original
but with other values specified. That will make it flash much more
quickly which can be a problem of course but that's up to each user.
2024-01-25 09:30:33 -08:00

46 lines
2.3 KiB
C

# include<stdio.h>// .IOCCC Fluid- #
# include <unistd.h> //2012 _Sim!_ #
# include<complex.h> //|||| ,____. IOCCC- #
# ifndef S
# define S 12321
# elif S < 0
# undef S
# define S 12321
# endif
# ifndef G
# define G 1
# endif
# ifndef P
# define P 4
# endif
# ifndef V
# define V 8
# endif
# ifndef A
# define A 10
# elif A < 0 || A > 60
# undef A
# define A 10
# endif
# define h for( x=011; 2012/* #
# */-1>x ++;)b[ x]//-' winner #
# define f(p,e) for(/* #
# */p=a; e,p<r; p+=5)// #
# define z(e,i) f(p,p/* #
## */[i]=e)f(q,w=cabs (d=*p- *q)/2- 1)if(0 <(x=1- w))p[i]+=w*/// ##
double complex a [ 97687] ,*p,*q ,*r=a, w=0,d; int x,y;char b/* ##
## */[6856]="\x1b[2J" "\x1b" "[1;1H ", *o= b, *t; int main (){/** ##
## */alarm(A);for( ;0<(x= getc ( stdin) );)w=x >10?32< x?4[/* ##
## */*r++ =w,r]= w+1,*r =r[5]= x==35, r+=9:0 ,w-I/* ##
## */:(x= w+2);; for(;; puts(o ),o=b+ 4){z(p [1]*/* ##
## */9,2) w;z(G, 3)(d*( 3-p[2] -q[2]) *P+p[4 ]*V-/* ##
## */q[4] *V)/p[ 2];h=0 ;f(p,( t=b+10 +(x=*p *I)+/* ##
## */80*( y=*p/2 ),*p+=p [4]+=p [3]/10 *!p[1]) )x=0/* ##
## */ <=x &&x<79 &&0<=y&&y<23?1[1 [*t|=8 ,t]|=4,t+=80]=1/* ##
## */, *t |=2:0; h=" '`-.|//,\\" "|\\_" "\\/\x23\n"[x/** ##
## */%80- 9?x[b] :16];;usleep( S ) ;}return 0;}/* ##
#### ####
###############################################################################
**###########################################################################*/