Last active
December 20, 2015 11:49
-
-
Save verdi327/6126721 to your computer and use it in GitHub Desktop.
codenow meetup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#string | |
"any text" | |
"put_anything_you_really_want" | |
'no big deal' | |
#integer | |
5 | |
puts 4 * 3 | |
3 / 3 | |
#arrays | |
[1,2,3] | |
["a", "bee", "honey"] | |
["a", 1] | |
[["a"], ["b"]] | |
my_array = ['a', 'b', 'z'] | |
#Adding Info out of Array | |
my_array[0] #=> "a" | |
my_array[2] #=> "z" | |
#Get Info into an Array | |
my_array[0] = "panda" | |
my_array << "fido" | |
#hashes | |
animals = { "dog" => "fido", "cat" => "garfield", "fish" => "nemo" } | |
#Retrieving Info from hash | |
animals["dog"] #=> "fido" | |
#Add to Hash | |
animals["bird"] = "iago" | |
contacts = {"michael" => "2813308004", "bill" => "34343534343"} | |
contacts["michael"] | |
name = "iago" | |
puts "my name is #{name}" | |
puts "wow #{name} is such a good person" | |
puts "holy smokes, #{name.upcase} programming is amazing" | |
#cards array | |
cards = [["2H,2"], ["2D,2"], ["2S,2"], ["2C,2"], ["3H,3"], ["3D,3"], ["3S,3"], ["3C,3"], ["4H,4"], ["4D,4"], ["4S,4"], ["4C,4"], ["5H,5"], ["5D,5"], ["5S,5"], ["5C,5"], ["6H,6"], ["6D,6"], ["6S,6"], ["6C,6"], ["7H,7"], ["7D,7"], ["7S,7"], ["7C,7"], ["8H,8"], ["8D,8"], ["8S,8"], ["8C,8"], ["9H,9"], ["9D,9"], ["9S,9"], ["9C,9"], ["10H,10"], ["10D,10"], ["10S,10"], ["10C,10"], ["JH,11"], ["JD,11"], ["JS,11"], ["JC,11"], ["QH,12"], ["QD,12"], ["QS,12"], ["QC,12"], ["KH,13"], ["KD,13"], ["KS,13"], ["KC,13"], ["AH,14"], ["AD,14"], ["AS,14"], ["AC,14"]] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment