lindenmayer_systems 0.0.4 copy "lindenmayer_systems: ^0.0.4" to clipboard
lindenmayer_systems: ^0.0.4 copied to clipboard

A Dart library to handle generative grammars known as L-Systems (Lindenmayer Systems).

example/example.dart

import 'package:lindenmayer_systems/src/lindenmayer_systems/dol_system/dol_system.dart';
import 'package:lindenmayer_systems/src/production_rules/production_rule.dart';

void main() {
  /// [DolSystem] Examples

  final testDolSystem = DolSystem(
    alphabet: ['A', 'B'],
    axiom: 'AB',
    productionRuleSet: {
      ProductionRule(predecessor: 'A', successor: 'AB'),
      ProductionRule(predecessor: 'B', successor: 'BA'),
    },
  );

  // Expected result is ABBA
  print(testDolSystem.generate(1));

  testDolSystem.generateAsStream(2)
    ..listen(
      // Should print (ABBA, 1) and ('ABBABAAB', 2)
      print,
    );
}
3
likes
160
points
51
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart library to handle generative grammars known as L-Systems (Lindenmayer Systems).

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

More

Packages that depend on lindenmayer_systems