Brownian tree: Difference between revisions
Content added Content deleted
(Added Uiua solution) |
m (→{{header|Uiua}}: improved algorithm) |
||
Line 5,428: | Line 5,428: | ||
<syntaxhighlight lang="Uiua"> |
<syntaxhighlight lang="Uiua"> |
||
S ← 80 |
S ← 80 |
||
⚫ | |||
⍜⊡(+1)↯2⌊÷2S ↯ S_S 0 |
|||
RandInt ← ⌊×⚂ |
RandInt ← ⌊×⚂ |
||
RandPoint ← ([⍥(RandInt S)2]) # [[Here] [Last pos]] |
RandPoint ← ([⍥(RandInt S)2]) # [[Here] [Last pos]] |
||
⚫ | |||
↯ S_S 0 |
|||
Mid ← ↯2⌊÷2S |
|||
⍜⊡(+1) Mid |
|||
# Update the pair to be a new adjacent [[Here] [Last]] |
# Update the pair to be a new adjacent [[Here] [Last]] |
||
Move ← ⊟∵(-1+⌊RandInt 3).⊢ |
Move ← ⊟∵(-1+⌊RandInt 3).⊢ |
||
Line 5,450: | Line 5,449: | ||
# &fwa "BrownianTree.png" |
# &fwa "BrownianTree.png" |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Visual Basic .NET}}== |
=={{header|Visual Basic .NET}}== |