Sunday, November 24, 2013

Day 49

It is weird to think that we only have 3 weeks left until we are done here. I still need to start my project--that I have yet to think of.... I would like to make an iOS app, but I don't have a Mac (yet) nor do I know Objective-C (yet). <- See how I set that up? Emphasis on yet.

I spent a little time today going over past PHP stuff and doing some more Ruby. I just did the third assignment, which took quite a while and two people to figure out (http://rayfarias.com)... The assignment was too simple and we were over thinking it. Also, I am still a little new to the syntax for Ruby. Those are my excuses.

Here is the code for what we were trying to figure out.

    a = {:first_name => "Kyle", :last_name => "Anderson"}
    b = {:first_name => "John", :last_name => "Rogers"}
    c = {:first_name => "Kory", :last_name => "Tony"}
    d = {:first_name => "Mike", :last_name => "Smith"}
    e = {:first_name => "Kirby", :last_name => "Puckett"}
    names = [a, b, c, d, e]
    name_string = names.count

    puts "You got " + name_string.to_s + " names in the 'names' string"
    names.each do |name|
puts "The name is #{name[:first_name]}, #{name[:last_name]}"
    end

This just went through and printed every first and last name out on the same line. Kind of like this (pretend the comma is not there),

Or, exactly like this, because this is the answer....






- Kyle

2 comments: