I'm New

D

David Stanislaus

First of all, let me just express my happiness at finally finding a
forum for Ruby, with a considerable base of users, (20 mins on a search
engine) Lol


Yeah I'm new
new to everything, I just decided to get into programming searched
programming found ruby and started following a guide.

I've had no programming experience before so if you guys know of
anything to help me out I might take a look at it.



and also I've got this little program problem:

puts 'Speak up Sonny I can\'t hear you.'
talk = gets.chomp
if talk == talk.capitalize or talk.downcase
then puts 'What? Sonny speak louder! Like THIS.'
if talk == talk.upcase
then puts 'no not since'
end
end

When you run it, and say something in Caps it returns both if puts
things so I don't know how to fix it.
thanks.
 
D

David Stanislaus

When I ran:

puts 'Speak up Sonny I can\'t hear you.'
talk = gets.chomp
if talk == talk.capitalize or talk == talk.downcase
then puts 'What? Sonny speak louder! Like THIS.'
if talk == talk.upcase
then puts 'no not since'
end
end

and used Caps it just ended the program... sorry if this is too trivial,
if it is maybe you guys could recommend a place where I wont be a
bother,

either way thanks.
 
V

Victor Reyes

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

When I ran:

puts 'Speak up Sonny I can\'t hear you.'
talk = gets.chomp
if talk == talk.capitalize or talk == talk.downcase
then puts 'What? Sonny speak louder! Like THIS.'
if talk == talk.upcase
then puts 'no not since'
end
end

and used Caps it just ended the program... sorry if this is too trivial,
if it is maybe you guys could recommend a place where I wont be a
bother,

either way thanks.
David,

Although I am not sure what is it that you are trying to do, the following
is one way to re-write your code and it does not abend!

*puts "Speak up Sonny I can\'t hear you"
talk = gets.chomp

if talk == talk.capitalize or talk == talk.downcase
puts "What? Sonny speak louder! Like THIS."
else
if talk == talk.upcase
puts "no not since"
end
end*

But why don't you tell us what you are trying to do and the forum might be
able to recommend something better.

One last thing, beginner or not you don't bother anyone. I am also still a
beginner. Granted, you'll find people that do not want to deal with people
like you or I, but then you find another dozen that really will help us.

Victor
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top