Skip to content

Instantly share code, notes, and snippets.

@jessieay
Created June 16, 2012 04:59
Show Gist options
  • Save jessieay/2939980 to your computer and use it in GitHub Desktop.
Save jessieay/2939980 to your computer and use it in GitHub Desktop.
RPN w one test passting
class RPNCalculator
attr_accessor :calculator, :result
def initialize
@calculator = []
@result = 0
end
def push(arg)
@calculator << arg
end
def plus
@calculator.each do |i|
@result += i
end
end
def value
@result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment