
Show HN: Grow an ASCII Bonsai Tree - andai
https://andai.tv/grow/
======
andai
Hi HN! I made a little ASCII Bonsai tree that grows in the browser.

I was inspired by this bash script:

[https://p.teknik.io/Raw/EWWzQ](https://p.teknik.io/Raw/EWWzQ)

    
    
                  &&
                 &&&&&
               &&&\/& &&&
              &&|,/  |/& &&
               &&/   /  /_&  &&
                 \  {  |_____/_&
                 {  / /          &&&
                 .`. \{___\________\/_\}
                  \} \}\{       \
                  }\{\{         \____&
                 \{\}\{           `&&&
                 {{}             &&
           , -=-~{ .-^- _
                 `}
                  {

~~~
krthr
Beautiful! Any plan to make more versions?

~~~
andai
Thank you! :) I'm thinking about making it grow more slowly. Right now there's
no representation of the tree apart from what you see, just particles that
draw it as they go along.

Would be fun to come up with a ASCII rendering system... maybe it could sway
gently in the breeze?

------
mikorym
Do these use Lindenmayer systems? [1]

[1]
[https://en.wikipedia.org/wiki/L-system](https://en.wikipedia.org/wiki/L-system)

~~~
andai
Not yet :) It's just a recursive drawing function. I'm thinking of making the
tree actually "exist" though, so it can grow more slowly over time. Thanks for
the link!

~~~
mikorym
If you are thinking about using L-Systems, I would say for your purposes the
L-System should be nondeterministic. One way of doing that would be to
introduce a slight and deliberate error into the substitution steps.

------
michaelanckaert
On Firefox mobile the page spawns about 10 print options dialogs.

Works perfectly on Safari mobile. Nice work!

~~~
cerberusss
I can confirm this. Firefox on iPad, latest version of both.

~~~
andai
Ahh, I named a function print(). I had no idea this was built in! Thank you.

Edit: Fixed! Also, looks much better on phones now.

------
Minor49er
It would be cool if you could trim them like a real Bonsai tree and maybe have
them grow more slowly. Store the state in localstorage and the user could come
back again and again to grow their potted ASCII art

~~~
andai
Yes, I've been thinking about this! It might work as a New Tab page.

------
techbio
Nice piece of digital artwork, and inspiring.

I would like to see all the possible eventual shapes of all those trees
beginning from the current state, given branch pruning choices.

------
jeffhuys
Very cute. I like it! Simple and to the point.

It told me to push CMD+U for the source. On safari, though, it's CMD+Option+U.
Not that it matters much :) Good work!

~~~
andai
Fixed, thanks!

------
Awelton
I was led to believe growing a bonsai tree involved a lot more trimming. Maybe
I'm a natural.

~~~
andai
"Purposes of bonsai are primarily contemplation for the viewer, and the
pleasant exercise of effort and ingenuity for the grower."

Still figuring out the second part!

------
tantalor
Gardening could be a cool genre of VR games.

\- Bonsai

\- Arboriculture: big bonsai

\- Topiary

\- Hedge mazes

\- Felling trees

\- Chopping wood

~~~
andai
That's a great idea! Gardening is so relaxing...

