Editing Rubyc Default Script
From Redstonechips
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Current revision | Your text | ||
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' | |
- | + | 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() |