- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
@echo off
setlocal EnableDelayedExpansion
setlocal EnableExtensions
set /a _2=20
set /a _1=600
set /a _0=800
call :mandelbrot _3 0 _0 _1 _2
echo | set /p ^=!_3!
goto :EOF
:mandelbrot
set width_%~2=!%~3!
set height_%~2=!%~4!
set max_%~2=!%~5!
set /a row_%~2=0
:WHILE_6
if !row_%~2! LSS !height_%~2! (
set /a col=0
:WHILE_5
if !col! LSS !width_%~2! (
set /a c_re=^(^(^(!col! - ^(!width_%~2! / 2^)^) * 4^) / !width_%~2!^)
set /a c_im=^(^(^(!row_%~2! - ^(!height_%~2! / 2^)^) * 4^) / !width_%~2!^)
set /a x=0
set /a y=0
set /a iteration=0
set /a _9_%~2=0
if !iteration! LSS !max_%~2! (
set /a _8_%~2=1
) else (
set /a _8_%~2=0
)
set /a _18_%~2=^(1 + %~2^)
call :or _19_%~2 !_18_%~2! _8_%~2 _9_%~2
set _10_%~2=!_19_%~2!
set /a _4_%~2=2
set _3_%~2=!y!
set /a _20_%~2=^(1 + %~2^)
call :pow _21_%~2 !_20_%~2! _3_%~2 _4_%~2
set _5_%~2=!_21_%~2!
set /a _1_%~2=2
set _0_%~2=!x!
set /a _22_%~2=^(1 + %~2^)
call :pow _23_%~2 !_22_%~2! _0_%~2 _1_%~2
set _2_%~2=!_23_%~2!
set /a _24_%~2=^(1 + %~2^)
call :plus _25_%~2 !_24_%~2! _2_%~2 _5_%~2
set _6_%~2=!_25_%~2!
if !_6_%~2! LEQ 4 (
set /a _7_%~2=1
) else (
set /a _7_%~2=0
)
set /a _26_%~2=^(1 + %~2^)
call :and _27_%~2 !_26_%~2! _7_%~2 _10_%~2
set _11_%~2=!_27_%~2!
:WHILE_4
if !_11_%~2! EQU 1 (
set /a x_new=^(^(^(!x! * !x!^) - ^(!y! * !y!^)^) + !c_re!^)
set /a y=^(^(^(2 * !x!^) * !y!^) + !c_im!^)
set x=!x_new!
set /a iteration=^(!iteration! + 1^)
goto WHILE_4
)
if !iteration! LSS !max_%~2! (
set _14_%~2=!white!
set _13_%~2=!row_%~2!
set _12_%~2=!col!
set /a _30_%~2=^(1 + %~2^)
call :putpixel _31_%~2 !_30_%~2! _12_%~2 _13_%~2 _14_%~2
echo | set /p ^=!_31_%~2!
) else (
set _17_%~2=!black!
set _16_%~2=!row_%~2!
set _15_%~2=!col!
set /a _28_%~2=^(1 + %~2^)
call :putpixel _29_%~2 !_28_%~2! _15_%~2 _16_%~2 _17_%~2
echo | set /p ^=!_29_%~2!
)
set /a col=^(!col! + 1^)
goto WHILE_5
)
set /a row_%~2=^(!row_%~2! + 1^)
goto WHILE_6
)
goto :EOF
:and
set a_%~2=!%~3!
set b_%~2=!%~4!
rem emulation of &&
if !a_%~2! EQU 1 (
if !b_%~2! EQU 1 (
set %~1=1
goto :EOF
)
)
set %~1=0
goto :EOF
asm0dey 22.02.2015 12:37 # 0
Остаток
LispGovno 22.02.2015 12:57 # +1
bormand 22.02.2015 13:17 # +3
absolut 22.02.2015 20:33 # +3
Elvenfighter 23.02.2015 01:24 # +5
bormand 23.02.2015 07:17 # 0
kegdan 23.02.2015 08:20 # 0