lindenmayer 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/lsystem.rb +20 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e76700ad3abdfd7ffedb930f0a7b29439afed77f
4
+ data.tar.gz: 582de0cc9201696a9500ce2b9ebaad5c3a1d1fe3
5
+ SHA512:
6
+ metadata.gz: b8ee05e65bdb4d118843300e9d8eb2e277799a452ce595763327ff0a6a85788b2db3281f39fd24a1fe0a22ea122c49b7952381e0b1c9b47c5c50cc93d480fcb1
7
+ data.tar.gz: b83065f74aaf153363e0b92e3d0e1f26f36471f197b4c51a2082686e5157e42d72fceb672e6d14ebeb750d45a59aac501c84f63f39e10691e46a075883ebb613
data/lib/lsystem.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'pry'
2
+
3
+ module Lindenmayer
4
+ # Lindenmayer System
5
+ class LSystem
6
+ def initialize(axiom, productions)
7
+ @axiom = axiom
8
+ @productions = productions
9
+ end
10
+
11
+ def iterate(count = 1)
12
+ count.times do
13
+ @axiom = @axiom.split('').map do |c|
14
+ @productions[c] || c
15
+ end.join
16
+ end
17
+ @axiom
18
+ end
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lindenmayer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Zach Dicklin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-05-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: L-System implementation
14
+ email: zdicklin@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/lsystem.rb
20
+ homepage:
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.12
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Lindenmayer System
44
+ test_files: []