Luhn: Fix instructions

I was looking at Discord help and realized that a recent PR I authored instructs the reader to check if credit card numbers are valid. However, the tests check a variety of numbers, not just credit card numbers. I’m not sure how I missed that, but in any case, this appears to be my fault. Apologies.

Here’s the proposed fix. Change L3 from

Determine whether a credit card number is valid according to the [Luhn formula][luhn].

to

Determine whether a number is valid according to the [Luhn formula][luhn].

I also took the opportunity to make a minor revision to the instructions for clarity and consistency.

So the discord help thread about the luhn exercise is here (OP claims that instructions are misleading. Maybe they are not clear enough, but they don’t look misleading to me)

I updated the instructions in order to address that issue too. Let me know what you think.

I’ve updated the story as well. According to Wikipedia, the luhn formula:

was designed to protect against accidental errors, not malicious attacks

1 Like

Question: Since the exercise tests more than just credit card numbers, would it make sense to use a different type of number in the second example — perhaps one with an odd number of digits — to avoid having an example that largely repeats the same procedure as the first?

3 Likes

I’ve changed the second example to use an invalid Canadian SIN (9 digits)

1 Like
2 Likes