This commit is contained in:
David Tschumperle 2023-10-02 14:42:06 +02:00
parent 5ddd050793
commit d1dadafce0
1 changed files with 6 additions and 6 deletions

View File

@ -37463,7 +37463,7 @@ x_mandelbrot : skip ${1=0},${2=0.317},${3=0.03} check_display $0
# Start event loop.
do
siz:=min({*,w,h}) # Desired window dimension.
$siz,$siz mandelbrot. {0,^},256,$1,{if($1,$2,0)},{if($1,$3,0)} map. [1] # Render fractal.
$siz,$siz mandelbrot. {0,^},256,$1,{[$1?$2:0,$1?$3:0]} map. [1] # Render fractal.
if $1 w. $siz,$siz,0,"[G"{`39`}"MIC] Julia Set c=("{0,@0-1}")-("{0,@2-3}"), c0=($2,$3)" # Display on window.
else w. $siz,$siz,0,"[G"{`39`}"MIC] Mandelbrot Set c=("{0,@0-1}")-("{0,@2-3}")" fi
w,h:=w,h round. select. 2,0,0,0,1 # Get the user selection.
@ -37684,12 +37684,12 @@ x_metaballs3d : check_display $0
0 t. ${s$mode},5,5,23,0.5,255,255,255 r. {w+5},100%,1,3,0 b. 0.7 n. 0,255
+dilate. 3 +j[0] ..,5,3,0,0,1,.,255 mv. 1 rm[2,-2,-1]
fi
+j3d[1] ..,50%,50%,0,1,{if(!$mode,3,$mode)},0,0,300,0,0,-500,0.1,1.5
+j3d[1] ..,50%,50%,0,1,{!$mode?3:$mode},0,0,300,0,0,-500,0.1,1.5
fps=${-fps} if $fps>0 to. $fps" fps",5,{h-22},16,2,0.2 fi
w.
if {*,CTRLLEFT}" && "{*,D} w[] {2*w},{2*h} elif {*,CTRLLEFT}" && "{*,C} w[] {w},{h} fi
rm[-3--1] wait 20
if {*,b}" || "{*,SPACE} mode:=($mode+if({*,b}&2,-1,1))%6 wait -1 rm[1] i[1] 0 fi
if {*,b}" || "{*,SPACE} mode:=($mode+({*,b}&2?-1:1))%6 wait -1 rm[1] i[1] 0 fi
while {*}" && "!{*,ESC}" && "!{*,Q}
rm w 0 }
@ -37724,7 +37724,7 @@ x_minesweeper : check "${1=20}>=8 && $1<=30 && ${2=$1}>=8 && $2<=30" check_displ
+t. "1",10,5,13,1,0,196,0 +t.. "2",9,5,13,1,0,128,0 +t... "3",9,5,13,1,0,0,255
+t[-4] "4",9,5,13,1,255,0,0 +t[-5] "5",9,5,13,1,200,0,0 +t[-6] "6",9,5,13,1,150,0,0
+t[-7] "7",9,5,13,1,128,0,0 +t[-8] "8",9,5,13,1,64,0,0
+f. 'if(x<=1||y<=1||x>=w-2||y>=h-2,if(x<y,128,255),160+2*(y+x))'
+f. "x<=1 || y<=1 || x>=w-2 || y>=h-2?(x<y?128:255):160+2*(y+x)"
+polygon. 4,13,15,11,15,6,18,17,18,1,0 line. 12,15,12,6,1,255,0,0 polygon. 3,12,6,6,9,12,12,1,220,0,0
rv[-2,-1]
. 100%,100%,1,3 line. 6,14,10,18,1,0,200,0 line. 10,18,16,6,1,0,200,0 dilate. 2
@ -37766,7 +37766,7 @@ x_minesweeper : check "${1=20}>=8 && $1<=30 && ${2=$1}>=8 && $2<=30" check_displ
r. {canvas,w},100%,1,3,0,0,0.5,0.5
negate. j[canvas] .,0,3 rm.
wait 50
x:=int(({*,x}-24)/24)} y={int(({*,y}-24)/24) b={*,b}
x,y:=int(([{*,x,y}]-24)/24) b={*,b}
w[canvas] {w},{h},0,"[G"{`39`}"MIC] Minesweeper"
while {*}" && "!{*,ESC}" && "!{*,Q}" && "!$b
fi
@ -37781,7 +37781,7 @@ x_minesweeper : check "${1=20}>=8 && $1<=30 && ${2=$1}>=8 && $2<=30" check_displ
else =[board] $val,$x,$y # Close to one or several mines
fi
elif n={board,i($x,$y)};$b&2" && "n>=10" && "n<=11
=[board] {if({board,i($x,$y)}==11,10,11)},$x,$y # Flag or unflag a square.
=[board] {board,i($x,$y)==11?10:11},$x,$y # Flag or unflag a square.
elif $b&4 f[board] 10 # Reset minefield.
fi
fi