Nathansswell

Matrix 3

Nov 3rd, 2014
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.75 KB | None | 0 0
  1. @echo off
  2. rem --- Initialize.
  3. setlocal EnableDelayedExpansion
  4. color 0A
  5. set /A "MaxX = 100"
  6. set /A "MaxY = 50"
  7. set /A "lines=MaxY+2","cols=MaxX+1"
  8. mode con lines=%lines% cols=%cols%
  9. set "CharSetWithSpaces=                                      01010101010101010101010101010101"
  10. :PERPETUAL_LOOP
  11.    rem --- Build the top row.
  12.     set /A "TopRow = (TopRow + 1) %% (MaxY + 1)"
  13.     set "Row_%TopRow%="
  14.     for /L %%X in (1,1,%MaxX%) do (
  15.         set /A "i = !RANDOM! %% 70"
  16.         call set "Row_%%TopRow%%=!Row_%TopRow%!%%CharSetWithSpaces:~!i!,1%%"
  17.     )
  18.    rem --- Display Screen.
  19.     set /A "Top2 = TopRow + 1"
  20.     cls
  21.     for /L %%Y in (%TopRow%,-1,0) do echo(!Row_%%Y!
  22.     for /L %%Y in (%MaxY%,-1,%Top2%) do echo(!Row_%%Y!
  23. goto :PERPETUAL_LOOP
Advertisement
Add Comment
Please, Sign In to add comment