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'
+
require 'java'
-
import 'org.tal.rubychip.RubyCircuit'
+
import 'org.tal.rubychip.RubyCircuit'
-
  class Tutor01 < RubyCircuit
+
class Tutor01 < RubyCircuit
-
  def init
+
  def init
-
    info "Running default script. To program the chip enter /rubyc"
+
    info "Running default script. To program the chip enter /rubyc"
-
    true
+
    true
-
  end
+
  end
-
  def input(idx, state)
+
  def input(idx, state)
-
    debug idx.to_s() + ": " + state.to_s()
+
    debug idx.to_s() + ": " + state.to_s()
-
    if idx < outputs.length
+
    if idx < outputs.length
-
      send idx, state
+
      send idx, state
-
    end
+
    end
-
  end
+
  end
-
end
+
end
-
Tutor01.new()
+
Tutor01.new()

Please note that all contributions to Redstonechips may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Redstonechips:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)
Personal tools