LSystemBot's Most Popular Figures

in procjam •  6 years ago 

@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

DateRule + Twitter linkImageRetweetsLikes
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
720
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
1116
Mon Aug 13 09:15:02 +0000 2018{"start":"EF","rules":{"W":"-","E":"[F]+++-FEE"},"a":256,"iter":7}
https://t.co/ILVBSsq3CE
820
Fri Jul 20 07:15:02 +0000 2018{"start":"CF","rules":{"F":"FF+","C":"F[+]"},"a":36,"iter":7}
https://t.co/FWx7nNtEhv
1119
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
1122
Sun Sep 02 09:15:03 +0000 2018{"start":"FF","rules":{"F":"[]OFOF","O":"[-F]-"},"a":36,"iter":7}
https://t.co/4HeS3i3Anr
1023
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
1223
Sat Aug 04 04:15:16 +0000 2018{"start":"FM","rules":{"F":"--F[M]F-+","M":"-"},"a":222,"iter":16}
https://t.co/dxxYVy89vZ
1126
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
1945
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
1960

Historical Popularity



full size

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order: