This challenge was originally sandboxed by Magic Octopus Urn; I adopted and posted it with his permission.
This is the cops' thread. The robbers' thread is here.
The challenge
- Step One: Write a piece of code (function or full program) which checks for primality.
- Step Two: Remove pieces of your code by replacing characters with the symbol
█
. - Step Three: Post the redacted code on the cops thread.
- Step Four: Wait for your code to be cracked and try to crack other's code.
For example, the Groovy code {it.isPrime()}
could become {██.is█████()}
.
(This one would be stupidly easy to crack; also, I know, .isPrime()
is not a Groovy method.)
Scoring
You must include your program's score in its submission. The score is defined as the ratio of redacted characters to characters. So if your program had 20 characters and 5 were redacted, your score would be 0.25. The Groovy code above would have a score of 0.5.
Rules
- Your program only needs to handle positive integers. It should output a truthy value if the number is prime and a falsy value otherwise. Please specify in your answer what it outputs.
- Your code may not contain any comments or unnecessary whitespace.
- No hashing or cryptographic obfuscation.
- Your code may be no more than 50% redacted (at least 1/2 the characters must be shown). This means that the highest possible score is 0.5.
- If your answer is not cracked within a week you may mark it safe and edit in the intended crack.
Winning
The winner will be the lowest-scoring uncracked answer within two weeks of posting. In the case of a tie, whichever has the most votes will win. This thread is always open to more submissions, but the winner chosen after two weeks will be permanent.
n >= 1
or all integers?) \$\endgroup\$