Chess_game: Missing space in string slicing example

In the Endless and Beginless ranges section, the "Hello World"[..5] is shown to evaluate to "Hello". However, it should evaluate to "Hello " to include the space at the end since the range [0..5] is inclusive.

You are correct.

"Hello World"[0..5] # => "Hello "

Would you care to submit a patch? Which way would you suggest correcting it? Using an exclusive range, changing the number 5 or changing the string?

=== Testing 'concepts/ranges/about.md'...
1.  FAIL | Default Test
           Got:      "Hello "
           Expected: "Hello"                    
             from concepts/ranges/about.md:73   
1 comparisons, 1 doctests, 1 failures, 0 errors

Thank you for replying @kotp.

I think we should stick with inclusive since the examples above this one are also inclusive.

I lean towards changing the string. I think the empty space at the end may make readers pause and consider how the string was computed. However, I’m open to changing the number 5 if you think that’s a better way to correct this.

I’ll submit a patch once we decide the best option.

Sounds good. Go ahead and create the PR, I will see it, but you can link it here as well, so others can follow along if they like. (And link back on github, so we have two way linking.)

Thank you @kotp

I made a PR. Unfortunately, I can’t link it here since my post has been marked as spam. I don’t know why.

@iHiD for help. New forum users get flagged as spam when they link too much.

Pull request: Add space in chess-game's README by sid-707 · Pull Request #1601 · exercism/ruby · GitHub