Skip to content

Instantly share code, notes, and snippets.

View Sixeight's full-sized avatar
🏠
Working from home

Tomohiro Nishimura Sixeight

🏠
Working from home
View GitHub Profile
class Hundred
def initialize(difficulty)
@difficulty = difficulty
@correct = 0
@error = 0
end
def question
case @difficulty
when 1
puts "hello, goodbye!"
require 'test/unit'
require 'stack'
class TestStack < Test::Unit::TestCase
def setup
@stack = Stack.new
end
def test_empty?
assert(@stack.empty?)
class EmptyStackError < StandardError; end
class Stack
def initialize
@stack = []
@size = 0
end
def empty?
require 'test/unit'
require 'rpn'
class TestRPN < Test::Unit::TestCase
def setup
@rpn = RPN.new
end
def test_1_plus_1
assert_equal(2, @rpn.calc('1 1 +'))
require 'stack'
class RPN
def initialize
@stack = Stack.new
end
def calc(expr)
expr.split.each do |e|
if %w[ + - * / ].include? e
" for .vimperatorrc
" 個人的に追加するコマンド達
javascript <<EOM
(function () {
[
['gmail', 'http://mail.google.com/', 'open Gmail'],
['gnews', 'http://news.google.co.jp/', 'open Google News'],
['gusnews', 'http://news.google.co.jp/news?ned=us', 'open Google News (U.S)'],
['gmap', 'http://maps.google.co.jp/', 'open Google Maps'],
['greader', 'http://www.google.com/reader/', 'open Google Reader'],
require 'mini/test'
Mini::Test.autorun
class StackOverflow < StandardError; end
class EmptyStackError < StandardError; end
class Stack
def initialize(max = 1.0/0.0)
@stack = []
require 'mini/spec'
Mini::Test.autorun
class EmptyStackError < StandardError; end
class Stack
def initialize
@stack = []
end
" vimperator plugin *MODOKI*
"
" USAGA:
" :gosh S式
(function() {
liberator.commands.addUserCommand(['gosh'], 'Evalute gauche code',
function(arg, special) {
// Set your gosh path!