Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set ^"LF=^
- ^" Above empty line is required - do not remove
- set ^"\n=^^^%LF%%LF%^%LF%%LF%^^"
- REM Old method
- REM usage: call :plot x y @
- REM ------------------------------------------------------------------------------------------------------------------------------
- :plot x y
- setlocal
- set "c=%~3"
- set /a "_y=%~2", "_x=%~1", "_x2=%~1 + 1"
- (endlocal
- set "_[%_y%]=!_[%_y%]:~0,%_x%!%c:~0,1%!_[%_y%]:~%_x2%!"
- )
- goto :eof
- REM ------------------------------------------------------------------------------------------------------------------------------
- REM New method approx. 60% faster
- REM usage: %plot% x y @
- REM ------------------------------------------------------------------------------------------------------------------------------
- set plot=for %%# in (1 2) do if %%#==2 ( for /f "tokens=1-3" %%1 in ("^!args^!") do (%\n%
- set /a "_y=%%2", "_x=%%1", "_x2=%%1 + 1"%\n%
- for /f "tokens=1-4" %%a in ("_y ^!_y^! ^!_x^! ^!_x2^!") do set "_[^!%%a^!]=^!_[%%b]:~0,%%c^!%%3^!_[%%b]:~%%d^!"%\n%
- )) else set args=
- REM ------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement