-
-
Save rking/e930611d0e59758e8417 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Char | |
def initialize | |
@str = 1 | |
@dex = 1 | |
@int = 1 | |
end | |
def warrior | |
@str += 2 | |
@dex += 1 | |
end | |
def thief | |
@dex += 2 | |
@int += 1 | |
end | |
end | |
player = Char.new | |
p player.thief # ⇒ 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment