User:Dhzb/e.bf

From Esolang
Jump to navigation Jump to search
:    Langton's Ant    :
uses socket plugin with image drawing server

Fill everything with white
++.--..-...+

++++[->++++<]>[-<++++++++>]<[->+>+<<]-
>>>+[
Get pixel
.<<.>.>>>,
If white then clockwise
>>+<<[>+<+>>-<<]
If black then counter-clockwise
>>[-<->]<<[+]
<<
>>>
Mod 4
[->+
[->+>+<<]>>
>+<----[[+]>-<]>[-<<[-]>>]<<[-<+>]<
<]>[-<+>]<
>
+.-<<<<<<.>.>>>>>,
If white then set to black
>+<[+>-<]
If black then set to white
>[-<->]<
>.<<<<<<<.>.>>>>>.[+]
<
Compute delta vector
0 : 01 00
1 : 00 01
2 : FF 00
3 : 00 FF
[->+>+<<]>>[-<<+>>]<
[->+>>+>>+>>+<<<<<<<]

+>[<->[-]]<[->+<]>>
+>-[<->[-]]<[->+<]>>
+>--[<->[-]]<[->+<]>>
+>---[<->[-]]<[->+<]>>
<<<<<<<
[->>>>>>> ++>+< <<<<<<<]>>
[->>>>> +>++< <<<<<]>>
[->>> >+< <<<]>>
[-> + <]>
[-<<<<<<<<+>>>>>>>>]>
[-<<<<<<<<+>>>>>>>>]<<<<<<<<<
[-<<<<<<+>>>>>>]<<<<<<->>>>>>>
[-<<<<<<+>>>>>>]<<<<<<->>>>>><<
<<<
]