Rubyc Default Script
From Redstonechips
(Difference between revisions)
(Created page with ''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…') |
|||
Line 1: | Line 1: | ||
'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 | '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' | + | require 'java' |
- | import 'org.tal.rubychip.RubyCircuit' | + | import 'org.tal.rubychip.RubyCircuit' |
- | class Tutor01 < 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 | + | end |
- | Tutor01.new() | + | Tutor01.new() |
Current revision as of 22:26, 13 January 2012
'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()