Sha256: 03d142feae9f91bb2ebd2a5e6992e3e5af6cd752b95b53b2e318eb41b306c9b0

Contents?: true

Size: 380 Bytes

Versions: 7

Compression:

Stored size: 380 Bytes

Contents

#!/usr/bin/env ruby

require File.join(File.dirname(__FILE__), 'turing')
include Turing

filename, *tapes = ARGV
machine_type =
  case ext = File.extname(filename)
  when '.stm'
    SingleTapeMachine
  when '.mtm'
    MultiTapeMachine
  else
    raise "unknown turing machine suffix: #{ext}, use .stm or .mtm"
  end
tm = machine_type.new(File.read(filename))
print tm.to_graphviz

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dslkit-0.2.13 examples/turing-graph.rb
dslkit-0.2.12 examples/turing-graph.rb
dslkit-0.2.11 examples/turing-graph.rb
dslkit-0.2.10 examples/turing-graph.rb
dslkit-0.2.9 examples/turing-graph.rb
dslkit-0.2.8 examples/turing-graph.rb
dslkit-0.2.7 examples/turing-graph.rb