diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-02-10 01:14:12 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-02-10 01:14:12 +0530 |
| commit | 9cf999f802b30a50453af430b3764ebc2282376b (patch) | |
| tree | 2c8e3937864dcc55ff4b4c3333ac710022adbada | |
| parent | e03cb0a4fa8cd563b6906fc9b89a1d73aee2d755 (diff) | |
| download | uiua-creative-coding-9cf999f802b30a50453af430b3764ebc2282376b.tar.gz uiua-creative-coding-9cf999f802b30a50453af430b3764ebc2282376b.zip | |
Add dragon curve
| -rw-r--r-- | 2-dragon/main.ua | 18 | ||||
| -rw-r--r-- | 2-dragon/output.png | bin | 0 -> 1388 bytes | |||
| -rw-r--r-- | README.md | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/2-dragon/main.ua b/2-dragon/main.ua new file mode 100644 index 0000000..86ece69 --- /dev/null +++ b/2-dragon/main.ua @@ -0,0 +1,18 @@ +W ← 200 +H ← 200 +S ← 4 +I ← 2 + +P ← ℂ: + +PStart ← [(P (-(÷2 S) ÷2 W) (÷2 H)) (P (+(÷2 S) ÷2 W) (÷2 H))] + +RotP ← +× ⊙⤚- P ∿+η ⊙∿. +Dragon ← ⍥(⊂ RotP η ⊣. ⇌.)I PStart +IsOnLine ← <0.01 ⌵- /+ ⊙(⌵-⊃⊢⊣)◡(⌵-) ⊟ +IsOnDragon ← ⊙◌ ≥1 /+ ≡(IsOnLine⊃⊢⊣) ⧈∘ 2 Dragon + +ToPix ← ⨬(0_0_0)(255_255_255) IsOnDragon + +Img ← ∵ToPix (⍉ ⊞P ⇡W⇡H) +&fwa "./2-dragon/output.png" img "png" Img diff --git a/2-dragon/output.png b/2-dragon/output.png Binary files differnew file mode 100644 index 0000000..6c02658 --- /dev/null +++ b/2-dragon/output.png @@ -1,3 +1,4 @@ # Playing with [uiua](https://www.uiua.org/) + |
