Don’t quite enjoy this exercise. The sentence in exercise is horrible, due to sorted and unsorted, the first and last word still ends up in the same order. To top that confusion, the ending function makes it resets? So the result we see is All wait all who all wait all who.
To make it clear, instead of using words, try A B C D E F G.
1. Take the remaining lines of the What You Should See output and figure out what they are doing. Make sure you understand how you are running your functions in the ex25 module.
Done, to see my comments, please check out my GitHub (ex25a.rb).
2. The Ex25 module doesn’t have to be in a file name ex25.rb. Try putting it in a new file with a random name, then import that file and see how you still have Ex25 available even though the file you made does not have ex25 in it.
I renamed it, I’ve also tried renaming the module itself, it causes an error. Apparently, the name of the functions have to be the same as the module name. So Module Ex25, all your function will have to start with Ex25.
3. Try breaking your file and see what it looks like in irb when you use it. You will have to quit irb with quit() to be able to reload it.
Just typing quit is fine.