Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Sandbox

Cops and Robbers: Luhn algorithm [cancelled]

+0
−0

This is now a cancelled sandbox post. This challenge won't be posted on the main for reasons, but thanks for coming to check this out.

Introduction

The Luhn algorithm is used to verify card numbers. The algorithm in a summary acts like this:

Reverse the digits, make an array:
    6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4
Double the numbers in odd indexes:
    6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4
Sum the digits in each number:
    6, 2, 7, 7, 9, 6, 7, 4, 9, 9, 4
Sum all of the numbers:
    6 + 2 + 7 + 7 + 9 + 6 + 7 + 4 + 9 + 9 + 4 = 70
If the sum modulo 10 is 0, then the number is valid:
    70 % 10 = 0 => valid

A challenge of this exists in CGCC, but here, let's up the game by playing Cops and Robbers!

Challenge

Your task as a cop is to write a program in the language of your choice to apply the Luhn algorithm.

  • Input: Use any form of input for your program, where the supposed variable to be used is either a number or a string.
  • Output: Print out a value or text that shows if the input is verified by the algorithm. Of course, you have to specify what it exactly is. This helps considering this is a code golfing challenge.
  • Use the language of your choice, but make sure that the program abides to having a hidden language used. The more complicated, the better.
  • Given this is a code golfing challenge too, make your program as short as possible to make it harder to guess what was used.

If you're a robber, crack the program and figure out which language suffices the program. If you get to do so, post it in the robber's thread and notify the cop.

7 days and if no one guessed the language used, the cop gains a point. The challenge will run until the end of the year (Dec. 31, 2021 23:59 (all timezones)). Most points wins, and bonus points for shortest program!

Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

I feel like we really only need one guess the language challenge... others don't add that much imo. (1 comment)

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!

Like what we're doing? Support us! Donate