Rubyc Default Script

From Redstonechips

Revision as of 22:18, 13 January 2012 by Mstram (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

'Tutor01' in this case was the name of the script entered on the second line of the sign attached to the rubyc chip (rubyc is the chip type entered on the first line of the sign

require 'java' import 'org.tal.rubychip.RubyCircuit'

class Tutor01 < RubyCircuit

 def init
   info "Running default script. To program the chip enter /rubyc"
   true
 end
 def input(idx, state)
   debug idx.to_s() + ": " + state.to_s()
   if idx < outputs.length
     send idx, state
   end
 end

end

Tutor01.new()

Personal tools