Refactoring Pokemon type weekness
问题 I made pokemon weekness finder by ruby. It takes a lot of words. Could you suggest bit nice and sophisticated to write this code? The menu is as follows. puts "Which type of Pokemon do you want to know weaknesses? Menu 1 Normal 2 Fire 3 Water 4 Electric 5 Grass 6 Ice 7 Fighting 8 Poison 9 Ground 10 Flying 11 Psychic 12 Bug 13 Rock 14 Ghost 15 Dragon 16 Dark 17 Steel 18 Fairy I then obtain the user's response and print the weakness for their selection. type = gets.to_i case type when 1 #Normal