Created
October 15, 2020 15:21
-
-
Save chrisclc/475204c83989005842a291b6381b4b04 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
# Each player starts with the same basic stats. | |
player = { strength: 10, dexterity: 10, charisma: 10, stamina: 10 } | |
# Then the player picks a character class and gets an upgrade accordingly. | |
character_classes = { | |
warrior: { strength: 20 }, | |
thief: { dexterity: 20 }, | |
scout: { stamina: 20 }, | |
mage: { charisma: 20 } | |
} | |
puts 'Please type your class (warrior, thief, scout, mage):' | |
input = gets.chomp.downcase.to_sym | |
player.merge!(character_classes[input]) | |
puts 'Your character stats:' | |
puts player |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment