Re: simple ruby shell menu

Refactoring of: simple ruby shell menu

Language: Ruby

#!/usr/bin/ruby

input = ""
until input == 'exit'
	puts "
Menu
(1) Say Hello
(2) Credits
(3 or quit) Exit
"
	input = gets.chomp
	case input
		when '1' then
			puts "Hello, world!"
			exit
		when '2' then
			puts "Written by: symbiotic"
			exit
		when '3' then
			input = 'exit'
		else
			puts "Input invalid"
	end
end
Reveal More
Added over 2 years ago by Sapphire_normal symbiotic_guru