- @echo off & setlocal enableDelayedExpansion
-
- REM 方向运算
- set "D0=x+=BL" & set "D1=x+=BL,y+=BL" & set "D2=y+=BL" & set "D3=x-=BL,y+=BL"
- set "D4=x-=BL" & set "D5=x-=BL,y-=BL" & set "D6=y-=BL" & set "D7=x+=BL,y-=BL"
-
- set /a "margin=10, BL=6, xs=196, ys=100, hei=488, wid=776"
-
- set "C=0"
- echo;C=!C!
-
- set /a "iterations=12, imax=(1<<iterations)-1, y=ys, x=xs"
-
- for /L %%i in (1 1 !iterations!) do (
-
- for %%a in ( A:0 B:1 C:2 D:3 E:4 F:5 G:6 H:7
- ) do for /f "tokens=1,2 delims=:" %%b in ("%%a") do set "C=!C:%%c=%%b!"
-
- for %%a in ( A:17 B:20 C:31 D:42 E:53 F:64 G:75 H:06
- ) do for /f "tokens=1,2 delims=:" %%b in ("%%a") do set "C=!C:%%b=%%c!"
-
- echo;C=!C!
- )
-
- <nul >Lévy_C_curve.htm (
- echo;^<svg height="!hei!" width="!wid!"^>
- set /p "=<polyline points=""
- set /p "=!x!,!y! "
- for /L %%i in (0 1 !imax!) do (
- for %%m in ("!C:~%%i,1!") do (
- set /a "!D%%~m!"
- set /p "=!x!,!y! "
- )
- )
- echo;"
- set /p "=style="fill:none;stroke:red;stroke-width:1"/>"
- echo;Sorry, your browser does not support inline SVG.
- echo;^</svg^>
- )
-
- start "" Lévy_C_curve.htm
-
- title any key to exit...
- >nul pause
-
- exit /b
复制代码
|