From: Allen Wyma Date: 2011-08-12T21:41:50+09:00 Subject: Re: I/O learning resource --0016364eef1eabe9c204aa4e3c8f Content-Type: text/plain; charset=ISO-8859-1 I apologize about that. Wrote from my phone. Auto caps is on. On Aug 12, 2011 8:36 PM, "Josh Cheek" wrote: > On Fri, Aug 12, 2011 at 7:20 AM, Allen Wyma wrote: > >> Excuse me. I'm guessing you're coming from a zero programming experience. >> Gets waits for keyboard input and puts displays a string (text) to the >> screen. Would you like an example? >> >> Name = gets() >> Puts = Name >> >> Anything junky about that? >> > > > Variables that begin with capital letters are constants in Ruby. Probably > `Name` shouldn't be a constant. Methods aren't constants, so their names are > all lowercase, so `Puts` should actually be `puts`. A slight > reinterpretation of this program: > > name = gets > puts "Hello, #{name}" > > > > If it makes you feel more comfortable being explicit, this translates > (approximately) to: > > name = $stdin.gets() > $stdout.puts("Hello, #{name}") --0016364eef1eabe9c204aa4e3c8f--