T3RRYT3RR0R

Golfed multicolor shaded 3d cube

May 7th, 2021 (edited)
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.81 KB | None | 0 0
  1. :# golfed script for outputting a shaded multi color cube
  2. :# call or start from the command line with arg 1 as an integer ie: Call programname 10
  3. :# https://codegolf.stackexchange.com/a/224741/92319
  4. echo off&Cls&Set $=Set &CHCP 65001 > nul&Setlocal EnableDelayedExpansion
  5. If "%~1"=="" (Echo(%~n0 Integer&Exit /B)
  6. %$%/A x=%1,h=x*2,z=0
  7. %$%F=For /L %%a in (1 1 &%$%P=^<nul set/p &%$%C= If %%y LEQ %1
  8. (%f:a=y%!h!)Do (%$%/a w=x-z
  9. %F%!w!)Do %P%=7
  10. %F%!z!)Do%C%(%P%=[38;2;0;120;%%a0m_^|)Else %P%=[38;2;120;0;%%a0m\\
  11. %F%%1)Do%C%(%P%"=[38;2;120;0;%%a0m▲▼")Else %P%!!%%a0m_\
  12. %C:EQ=SS%(%$%/A z+=1)Else%C:If=If not%%$%/A z-=1)&Echo() >"%TEMP%\outfile.dat"
  13. :# pipes typed file to findstr to correctly display UTF 8 characters
  14. TYPE "%TEMP%\outfile.dat" | findstr /V /C:"0x00"
  15. Del "%TEMP%\outfile.dat"
Add Comment
Please, Sign In to add comment