Advertisement
T3RRYT3RR0R

Best batch Game of Life

Jun 5th, 2020
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.23 KB | None | 0 0
  1. @echo off & TITLE Game of Life. Verifying Resources... & SETLOCAL EnableDelayedExpansion
  2. ::: - Game of life and cmdgfx.exe by Mikael Sollenborn https://www.dostips.com/forum/viewtopic.php?f=3&t=9630
  3. :Game
  4. (For /F "Delims=" %%E in ('Where /R "%USERPROFILE%" cmdgfx.exe') Do CD "%%~dpE") > Nul 2> Nul || (Echo cmdgfx.exe is not installed in your user profile. Install to continue && start /wait "" "https://drive.google.com/uc?export=download&id=1DrXmoaRXhbC99Y9gWwD6n4RD-NUEWD1d" && Goto :Game)
  5. (For /F "Delims=" %%P in ('Where /R "%USERPROFILE%" BG.exe') Do %%P Cursor 0 && %%P font 2)  > Nul 2> Nul || (Echo Game of Life can be enhanced with BG.exe & %__AppDir__%\Timeout.exe 3 & CLS)
  6. cmdwiz.exe SetWindowTransparency 25 > Nul  2>Nul
  7. set /a w=160, h=80, density=35, col1=!Random! %% 5 + 1, Col2=!Random! %% 3 + 6, col=!Col1!!Col2!
  8. mode %w%,%h%
  9. if not defined _ set _=. & call %0 | cmdgfx.exe "fbox 0 0 fe & block 0 0,0,%w%,%h% 0,0 -1 0 0 - random()*100/(101-%density%)" S -n
  10. For /L %%. in () Do (Set /A Tk+=1, Col2=!Random! %% 3 + 6, col=!Col1!!Col2! & Title Game Of Life Gen: !Tk!& echo "cmdgfx: block 0 0,0,%w%,%h% 0,0 -1 0 0 - store(gtr(col(x-1,y-1),0)+gtr(col(x,y-1),0)+gtr(col(x+1,y-1),0)+gtr(col(x-1,y),0)+gtr(col(x+1,y),0)+gtr(col(x-1,y+1),0)+gtr(col(x,y+1),0)+gtr(col(x+1,y+1),0),0)+((1-(lss(s0,2)+gtr(s0,3)))*gtr(col(x,y),0)+eq(col(x,y)*10+s0,3))*!col!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement