Run your Ruby file by typing ruby
and then the name of the file you want to run in the Terminal.
If we want to run string_multiplication.rb
, we can write the command:
ruby string_multiplication.rb
To re-run this command, you can use the UP and DOWN arrow keys to look at the history of commands you've run in a Terminal.
Should output:
"HoHoHo"
using String multiplication.
(Don't just print the String literal "HoHoHo"
)
Should output:
"HELLO friends AnD FaMiLy"
using a combination of the upcase
, downcase
, and swapcase
methods.
Shoud output:
"Hello!"
using the given starting variable.
Should output:
"put spaces in between these words"
using the given starting variable.
Should output exactly
"remove the outside spaces"
using the given starting variable.
Write a program that gets a name (e.g. "alice") from the user (the first bit of provided code does this for you!), capitalizes it, and then says "Hello, Alice!"
Should work similarly to the following:
"What's your name?"
jelani
"Hello, Jelani!"
Click here to see names of each test
string_multiplication.rb should output 'HoHoHo' using String multiplication
string_strip.rb should output 'remove outside spaces'
string_case.rb should output 'HELLO friends AnD FaMiLy'
string_gsub.rb should output 'put spaces in between these words'
string_chomp.rb should remove ending '$'
string_gets.rb should output 'Hello, name!'