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