Permalink
Browse files

ruby - day 1

  • Loading branch information...
1 parent 90c5931 commit 88778a4be4898817f7a292f856b2f45e79d8e33e @andrewsmedina committed Nov 29, 2011
Showing with 26 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. BIN ruby/day-1/.hello_world.rb.swp
  3. +22 −0 ruby/day-1/bonus.rb
  4. +3 −0 ruby/day-1/hello_world.rb
View
@@ -0,0 +1 @@
+*.swp
Binary file not shown.
View
@@ -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
@@ -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.