U E D R , A S I H C RSS

데블스캠프2011/넷째날/루비/서민관 (rev. 1.1)

데블스캠프2011/넷째날/루비/서민관

class ToyProgram
	@inputNum
	attr_writer:inputNum
	attr_reader:inputNum
	@randNum
	attr_writer:randNum
	attr_reader:randNum
	
	def run()
		self.randNum = rand * 10
		self.inputNum = gets.to_i

		if self.inputNum > self.randNum then
			puts "You win"
		else
			puts "You lose"
		end
	end
end

a = ToyProgram.new()
a.run()
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:12
Processing time 0.0196 sec