Tuesday, October 8, 2013

Noob Tutorials #2 Ruby Code chapter 5

in the last three chapters we went through the l-4 we learned how to put strings/words on the terminal and how to do math! in this chapter we learn how to store thing for the FUTURE  so to do this all you need to do is

var1 = 2
var2 = 5

puts var1 + var2

it will say 7 it basically var puts the stuff after the = it in to storage with in that tab.We also learned how to get input form YOU all you need is to do is.Lets say i want your name is what we can say is

puts 'hello there, and what\'s your name?'
name = gets.chomp
puts 'your name is ' + name + '? what a lovely name!'
puts 'pleased to meet you, ' + name + '. :)'

the  name = gets.chomp you don't need name you can use hello, yes or, save anything you want as long as you have the = gets.chomp. so that is the big things that i learned over this chapter.

No comments:

Post a Comment