Skip to content

Instantly share code, notes, and snippets.

View mame-n's full-sized avatar

Shouichi Nakauchi mame-n

View GitHub Profile
require 'minecraft-pi-ruby'
require './num_block'
require './timer'
class Timer_ctrl
def initialize
@num_mcpi = NumericalMCPI.new
@timer = Timer.new(1) do
Thread.new() do
class Timer
public
def initialize(interval, &callback_block)
@loop_enable = false
@interval = interval
@callback_block = callback_block
end
def start()
@loop_enable = true
loop_start()
module TNum
Tnull = [
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
@mame-n
mame-n / ProblemC.rb
Created November 19, 2012 17:19
ProblemC
Max = 10**6 # 1000000
res = []
res_odd = []
res[1] = 1
res_odd[1] = 1
t = 2
tetrahedron = t * (t+1) * (t+2) / 6
@mame-n
mame-n / 01.rb
Created October 23, 2012 04:08
ACM Problem A
class ProblemA
def initialize
@input = [[[1,nil]],
[[5,nil],
[0,0], [0,1], [0,2], [0,3]],
[[12,nil],
[0,0], [1,0], [2,0], [3,1], [4,1], [5,1], [6,2], [7,2], [8,2], [9,3], [10,3]],
[[10, nil],
[0,2], [1,2], [2,2], [3,2], [2,1], [5,1], [6,1], [7,1], [8,1]]
]