Program that will print the following nursery rhyme, but for any number (>0) of monkeys.
Rhyme for 3 monkeys:
Three little monkeys jumping on the bed,
One fell off and bumped his head,
Mama called the doctor and the doctor said,
"No more monkeys jumping on the bed!"Two little monkeys jumping on the bed,
One fell off and bumped his head,
Mama called the doctor and the doctor said,
"No more monkeys jumping on the bed!"One little monkey jumping on the bed,
He fell off and bumped his head,
Mama called the doctor and the doctor said,
"Get those monkeys right to bed!"One little monkey jumping on the bed,
He fell off and bumped his head,
Mama called the doctor and the doctor said,
"Get those monkeys right to bed!"
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To be able to run the program, you need to have installed: ruby-2.4.1
To install it, you can review different options here
Clone the repo in your terminal:
$ git clone https://github.com/nmcolome/little_monkeys.git
Navigate into the project and run the file:
$ cd little_monkeys/lib
$ ruby little_monkeys.rb
The program should prompt you for a number:
Enter the number of monkeys (must be >0): >
And the output should look like this (for an n
= 5
):
Five little monkeys jumping on the bed,
One fell off and bumped his head,
Mama called the doctor and the doctor said,
"No more monkeys jumping on the bed!"
Four little monkeys jumping on the bed,
One fell off and bumped his head,
Mama called the doctor and the doctor said,
"No more monkeys jumping on the bed!"
Three little monkeys jumping on the bed,
One fell off and bumped his head,
Mama called the doctor and the doctor said,
"No more monkeys jumping on the bed!"
Two little monkeys jumping on the bed,
One fell off and bumped his head,
Mama called the doctor and the doctor said,
"No more monkeys jumping on the bed!"
One little monkey jumping on the bed,
He fell off and bumped his head,
Mama called the doctor and the doctor said,
"Get those monkeys right to bed!"
One little monkey jumping on the bed,
He fell off and bumped his head,
Mama called the doctor and the doctor said,
"Get those monkeys right to bed!"
Navigate into the test file: $ cd test
Run the Minitest tests by: $ ruby little_monkeys_test.rb
- Language - ruby-2.4.1
-
Turing School of Software & Design - BackEnd Prework - Turing School of Software & Design
-
Natalia Colomé - nmcolome