You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
394 B
15 lines
394 B
5 years ago
|
# Print the string "Hello World"
|
||
|
puts 'Hello World'
|
||
|
|
||
|
# For the string "Hello, Ruby" find the index of "Ruby"
|
||
|
ruby_index = 'Hello, Ruby'.index 'Ruby'
|
||
|
puts "Index of 'Ruby': #{ruby_index}"
|
||
|
|
||
|
# Print your name 10 times
|
||
|
10.times { puts 'Jason' }
|
||
|
|
||
|
# Print the string "This is sentence number X"
|
||
|
(1..10).each { |i| puts "This is sentence number #{i}" }
|
||
|
|
||
|
# Run a ruby program from a file: ruby day1.rb
|