Update description for Luhn algorithm

The use of _ was ambiguous to me. Attempting to make this clearer.
Thoughts?

To be honest, o find the proposed change harder to understand.

Same here. I’m not opposed to improving the text, but I don’t think the PR does that.

What about adding β€œarrows” instead in markdown?

4_3_3_9_0_4_6_6_
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ 

or

4_3_3_9_0_4_6_6_
^ ^ ^ ^ ^ ^ ^ ^ 
3 Likes

I like those suggestions!

         4539 3195 0343 6467
doubled: ↑ ↑  ↑ ↑  ↑ ↑  ↑ ↑ 

Is clearer imo than the _.

3 Likes

branch updated:

diff --git a/exercises/luhn/description.md b/exercises/luhn/description.md
index 73e6b39..d1a8720 100644
--- a/exercises/luhn/description.md
+++ b/exercises/luhn/description.md
@@ -22,7 +22,8 @@ The first step of the Luhn algorithm is to double every second digit, starting f
 We will be doubling
 
 ```text
-4_3_ 3_9_ 0_4_ 6_6_
+4539 3195 0343 6467
+↑ ↑  ↑ ↑  ↑ ↑  ↑ ↑  (doubling)

That seems more clear to me. Would any other maintainers like to chime in prior to opening the PR and moving to Github?

+↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ (double these)

yeah that is even better than β€œdoubling”

It might be good to show another example where the first on the left is also not doubled. I think the reading is clear enough, but when an apparently good diagram is shown, having the other state makes that easier to see as well.

update the branch with:
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ (double these)

in the above part there are not yet doubled this is why I chose doubling vs doubled. β€œdouble these” does the trick though.

I get that.

What I am saying is that seeing:

4539 3195 0343 6467
↑ ↑  ↑ ↑  ↑ ↑  ↑ ↑  (double these)

And seeing

539 3195 0343 6467
 ↑  ↑ ↑  ↑ ↑  ↑ ↑  (double these)

Gives one the confirmation that we are not doubling from the first index on the left. It confirms it visually.

3 Likes

I think that can be another improvement if still not clear as another PR. For me what mostly threw me off was the use of _ which the current iteration addresses.

I think this makes sense to do at the same time! May as well make it very clear it’s from the right as that trips people up pretty often.

1 Like

Yes, it should be the same pull request, the same commit, likely.

Would you say that the issue is now discussed and the auto-closed PR can be reopened for these changes?

1 Like

Sounds reasonable to me. It seems like there’s pretty much a consensus that we should change this and generally what we want to see.

With the discussion going well, @masters3d, and looking like we are on the same page, would you care to create a new Pull Request and reference it here (and here to there as well) since it appears we will have trouble re-opening that exercism/problem-specifications#2465 for whatever reason.

New PR [Luhn algorithm] Replace _ with arrows by masters3d Β· Pull Request #2466 Β· exercism/problem-specifications Β· GitHub

After this one is merged, I can take a look at additional changes if required.

1 Like