4 ms·
Show HN: Grow an ASCII Bonsai Tree
- andai 7y agoHi 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 7y agoBeautiful! Any plan to make more versions?
- andai 7y agoThank 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?
- jeffhuys 7y agoVery 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 7y agoFixed, thanks!
- Minor49er 7y agoIt 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 7y agoYes, I've been thinking about this! It might work as a New Tab page.
- tantalor 7y agoGardening could be a cool genre of VR games. - Bonsai - Arboriculture: big bonsai - Topiary - Hedge mazes - Felling trees - Chopping wood
- andai 7y agoThat's a great idea! Gardening is so relaxing...
- mikorym 7y agoDo these use Lindenmayer systems? [1] [1] https://en.wikipedia.org/wiki/L-system https://en.wikipedia.org/wiki/L-system
- andai 7y agoNot 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 7y agoIf 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 7y agoOn Firefox mobile the page spawns about 10 print options dialogs. Works perfectly on Safari mobile. Nice work!
- cerberusss 7y agoI can confirm this. Firefox on iPad, latest version of both.
- andai 7y agoAhh, I named a function print(). I had no idea this was built in! Thank you. Edit: Fixed! Also, looks much better on phones now.
- techbio 7y agoNice 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.
- Awelton 7y agoI was led to believe growing a bonsai tree involved a lot more trimming. Maybe I'm a natural.
- andai 7y ago"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!