@LSystemBot is a Twitter bot that generates random L-Systems and plots the result. (Somebody at #roguelikecel told me about this bot, but unfortunately I forget who!)
An L-System is a grammar that specifies an initial symbol, and rules for expanding symbols into larger strings. These strings can be interpreted in many different ways, but in this context they're instructions for drawing lines. The symbols which LSystemBot uses are:
var translations = {
'F': () => { point.x += Math.cos(a)*dist; point.y += Math.sin(a)*dist; pathStr += ` L ${point.x} ${point.y}`; },
'+': () => { a -= angle; },
'-': () => { a += angle; },
'[': () => { stack.push({point: {x: point.x, y: point.y}, a: a}); },
']': () => { ({point: point, a: a} = stack.pop()); pathStr += ` M ${point.x} ${point.y}`; }
}
(Quoted from the code, which can be found at https://github.com/Objelisks/lsystembot)
The angle is part of the rule that's randomly generated; it's the a
in the object below. "F" draws a line of a fixed length along the current angle and moves to the end of the line. "+" and "-" rotate the current angle. "[" saves the current location on a stack, and "]" pops the last saved location off the stack. All other symbols are "nonterminals" which can be expanded.
L-systems can be used to create fractals and fractal-like objects such as trees, but it looks like most of the popular results are more like spirograph images; I think this may be because the line length is fixed. With a line length that gets shorter at deeper levels of nesting, the images would be more fractal-like.
Top Tweets
Date | Rule + Twitter link | Image | Retweets | Likes |
---|---|---|---|---|
Fri Sep 14 05:15:02 +0000 2018 | {"start":"FJ","rules":{"F":"F---F+-J","J":"++---J"},"a":159,"iter":6} https://t.co/1aSTouXq9G | 7 | 20 | |
Fri Jun 08 22:15:22 +0000 2018 | {"start":"F","rules":{"F":"JBBAA+","J":"[]-","A":"[]-EEF-","B":"JBBJ","E":"[+[J]]A"},"a":36,"iter":16} https://t.co/TXInhHsLQh | 11 | 16 | |
Mon Aug 13 09:15:02 +0000 2018 | {"start":"EF","rules":{"W":"-","E":"[F]+++-FEE"},"a":256,"iter":7} https://t.co/ILVBSsq3CE | 8 | 20 | |
Fri Jul 20 07:15:02 +0000 2018 | {"start":"CF","rules":{"F":"FF+","C":"F[+]"},"a":36,"iter":7} https://t.co/FWx7nNtEhv | 11 | 19 | |
Sun Aug 19 02:15:03 +0000 2018 | {"start":"NWWW","rules":{"F":"[][FA-W]P+","W":"PNFNFF++","A":"FWP","N":"[]FP+"},"a":41,"iter":7} https://t.co/UGrJfZJnQM | 11 | 22 | |
Sun Sep 02 09:15:03 +0000 2018 | {"start":"FF","rules":{"F":"[]OFOF","O":"[-F]-"},"a":36,"iter":7} https://t.co/4HeS3i3Anr | 10 | 23 | |
Thu Aug 23 15:15:02 +0000 2018 | {"start":"FCCF","rules":{"F":"+FF","N":"[-C]","C":"FNN"},"a":36,"iter":6} https://t.co/bBbOElkE98 | 12 | 23 | |
Sat Aug 04 04:15:16 +0000 2018 | {"start":"FM","rules":{"F":"--F[M]F-+","M":"-"},"a":222,"iter":16} https://t.co/dxxYVy89vZ | 11 | 26 | |
Sun Jul 08 19:07:17 +0000 2018 | {"start":"++F[--F]FKFF[KK+[FFMKM]K+F[O]FPF]FPF]+FKMKF[F]JFP]KF]-F[F][+F++F]J++F--F[K+FP]FP]]F","rules":{"K":"----",… https://t.co/6uLMZt4EGG | 19 | 45 | |
Sun Aug 26 15:15:03 +0000 2018 | {"start":"KKKE","rules":{"F":"-FEE","E":"FF","N":"[N]NF-F+F","K":"F"},"a":60,"iter":7} https://t.co/a6sa6bsO7d | 19 | 60 |
Historical Popularity
full size
These are fun to look at... I like the last triangle looking one the best. I'm curious to see how they would look with a shorter line as iterations increase.
I suppose one could make the shorter path tweak and start generating them here too....
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This post has been voted on by the SteemSTEM curation team and voting trail in collaboration with @curie.
If you appreciate the work we are doing then consider voting both projects for witness by selecting stem.witness and curie!
For additional information please join us on the SteemSTEM discord and to get to know the rest of the community!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit