Skip to content

Commit

Permalink
ruby - day 1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsmedina committed Nov 29, 2011
1 parent 90c5931 commit 88778a4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.swp
Binary file removed ruby/day-1/.hello_world.rb.swp
Binary file not shown.
22 changes: 22 additions & 0 deletions ruby/day-1/bonus.rb
@@ -0,0 +1,22 @@
secret_number = rand(1000)

quit = false

while !quit
puts "what is the number?"
number = gets.to_i

if number == secret_number
puts "congratulations!"
quit = true
end

if number < secret_number
puts "try a greater number"
end

if number > secret_number
puts "try a less number"
end

end
3 changes: 3 additions & 0 deletions ruby/day-1/hello_world.rb
@@ -1 +1,4 @@
puts "Hello, world."
puts "Hello, Ruby".index "Ruby"
10.times{ puts "andrews medina" }
(1..10).each{ |number| puts "This is sentence number #{number}" }

0 comments on commit 88778a4

Please sign in to comment.