Skip to content

Instantly share code, notes, and snippets.

@jasondew
Last active April 8, 2018 02:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jasondew/5050066 to your computer and use it in GitHub Desktop.
Save jasondew/5050066 to your computer and use it in GitHub Desktop.
Luhn Checksum project
Luhn Checksum
http://en.wikipedia.org/wiki/Luhn_algorithm
Implement a Ruby program that outputs the validity of a number by applying the Luhn Checksum.
Input:
The program should accept a single number to validate.
Output:
The program should output the input along with the validity of the number.
Examples:
With an input of 79927398713 the output would be:
79927398713 is valid.
With an input of 79927398710 the output would be:
79927398710 is not valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment