Another sample exercise from chapter 4 from 'Learn to Program':
Sublime Text 2:
puts 'Yo, what up dawg?...hey what\'s yo favorite number?'
number = gets.chomp.to_i
mynumber = number + 1
puts 'What are you kidding me? '+number.to_s+' ???? .........'+mynumber.to_s+ ' really is a much better number!'
...And from terminal.
Last login: Wed Oct 31 00:09:07 on ttys000
Joshuas-MacBook-Pro:~ joshuakemp$ ruby bigger.rb
Yo, what up dawg?...hey what's yo favorite number?
39
What are you kidding me? 39 ???? .........40 really is a much better number!
Joshuas-MacBook-Pro:~ joshuakemp$
Goodnight = Josh tired
puts 'See you tomorrow'
Wednesday, October 31, 2012
Oct. 30th after midnight...
Follow Me
POPULAR POSTS
-
UPDATE September 2016: We are now inundated with bootcamps and it's getting harder to land a junior developer position. I created a co...
-
Yes, obviously Free Code Camp is popular. It's supposed to make things easier for you to learn how to code. My problem is the length of...
-
I have always promised honesty and transparency with this blog. Last time I gave a review about Free Code Camp, I wasn't super supporti...
-
You need a Regular Expression to validate a phone number or a user's email address, so what do you do? Go onto StackOverflow and copy so...
-
What up peeps ! I feel like every day gets better and better, I just gotta' say life is good, No brag, just fact :-) I thought I woul...