linux starting

M

mailer mailer

[Note: parts of this message were removed to make it a legal post.]

I'm starting to program in linux more often now and I'm starting on linux
(Ubuntu). I'm using Kdevelop and I cannot get the program to run and take a
gets statement meaning I cannot get user input. any advice would be very
helpful
 
P

princeofnigeria

[Note: parts of this message were removed to make it a legal post.]

Please post your source code and I wil take a stab at why you cant get it to
run. I develop in kdevelop also.
 
M

Marc Heiler

I'm using Kdevelop and I cannot get the program to run and
take a gets statement meaning I cannot get user input.

You could try it simpler, just any editor that does not annoy you,
i.e. nano or bluefish. Save your .rb file, inside it something like:


puts 'Enter input now please:'
user_input = gets.chomp

case user_input
when 'q'
puts 'bye!'
exit
when 'hi'
puts 'Hi there, lets code more'
else
puts 'Input '+user_input+' was unknown to me.'
end


And if you saved it like named "foobar.rb", do
ruby foobar.rb

It should wait for your user input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top