I discovered that this weird printing of 9 as a — only occurs in Firefox. When I ran the same code in Safari it worked fine. For what it’s worth, here is the code taken from the Introduction to Ruby course:
require ‘prime’ # This is a module. We’ll cover these soon!
return “n must be an integer.” unless n.is_a? Integer
return “n must be greater than 0.” unless n > 0
When I copied and pasted what the terminal spat out this this email, the “—" changed back to a “9”!
I attach a screenshot showing the weird result in Safari, followed by the cut and paste of the same numbers where the — changed back to a 9.
As I have a workaround (use Safari), I’m not worried about it, but if you’re into solving mysteries, this is one for you.
PS I just ran the code “Print 9” and the terminal gave me — in Firefox
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]