32
1
In this cops-and-robbers challenge cops will think of a positive integer. They will then write a program or function that outputs one value when provided the number as input and another value for all other positive integer inputs. Cops will then reveal the program in an answer keeping the number a secret. Robbers can crack an answer by finding the number.
Here's the catch: this is not code-golf, instead your score will be the secret number with a lower score being better. Obviously you cannot reveal your score while robbers are still trying to find it. An answer that has not been cracked one week after its posting may have its score revealed and be marked safe. Safe answers cannot be cracked.
It probably goes without saying but you should be able to score your answer. That is you should know exactly what value is accepted by your decision machine. Simply knowing that there is one is not enough.
Use of Cryptographic functions
Unlike most cops and robbers challenge which ask you not to use cryptographic functions, this challenge not only entirely allows them but encourages them. You are free to create answers in any way as long as you are trying to win. That being said, answers using other methods are also welcome here. The goal of the challenge is to win, and as long as you don't cheat nothing is off the table.
1If you allow crytographic functions, I would recommend putting a time limit on programs. – Okx – 2017-08-28T17:15:49.160
@Okx Why? Sleeps and other slowdowns can be removed when brute forcing. – Post Rock Garf Hunter – 2017-08-28T17:17:06.363
12I downvoted this challenge because, in most languages, it can be simply cracked using a mapping algorithm or a simple loop. I consider that a bit too easy for a [tag:cops-and-robbers] challenge. – Mr. Xcoder – 2017-08-28T18:02:47.660
2I feel like there are going to be a lot of cops who know one (probably the smallest) accepted value but don't know if there are more right answers or what they are. – histocrat – 2017-08-28T18:03:21.060
12@Mr.Xcoder You are free to downvote however I will point out that that is kind of the point of the challenge and not in my opinion a flaw. The challenge is mostly fun for cops who have to make it as hard to brute force as possible by slowing down computation. More creative answers will should make brute forcing more and more difficult allowing them to use smaller and smaller numbers. – Post Rock Garf Hunter – 2017-08-28T18:05:50.660
@WheatWizard Now that I see your point, I undownvoted. – Mr. Xcoder – 2017-08-28T18:07:09.847
Must the program terminate without erroring for all positive integers? – Stephen – 2017-08-28T18:46:22.300
@Stephen Yes it must. – Post Rock Garf Hunter – 2017-08-28T18:47:24.443
@WheatWizard Do you have to find the decimal representation of the given number in order to crack it? – flawr – 2017-08-28T18:48:35.440
@flawr I'm going to say yes, you need to find the decimal representation of the given number. – Post Rock Garf Hunter – 2017-08-28T18:50:34.313
1@WheatWizard I assume it would not be winning, but it would not be possible to crack e.g. a program that just compares the input to
A(9,9)
whereA
is the Ackerman function. – flawr – 2017-08-28T19:00:47.8901@flawr Yes I got that idea from your comment, however if we start allowing people to crack with descriptions of numbers it becomes hard to discern what is a crack and what is not. Using the Ackerman function however might fall under not being able to score your own answer, as if I give you a large number of similar size you would have trouble determining which is bigger. – Post Rock Garf Hunter – 2017-08-28T19:03:36.143
@WheatWizard Ah right, that is actually a clever requirement in your challenge (that I totally missed :) – flawr – 2017-08-28T20:15:26.217
Looking at the answers below, this challenge would really benefit from a time limit imposed on both correct and incorrect inputs (even if it's 30 minutes or so). Many answers don't even allow testing the found number against the given code – michi7x7 – 2017-08-29T07:55:42.243
I agree with @michi7x7, it should be possible to test the answers with both correct and incorrect inputs and a time limit could ensure that. The limit can be very large – even like 24 hours could be fine, as that would prevent brute forcing, but allow testing of couple of inputs. – fergusq – 2017-08-29T15:49:09.417
So we have two safe answers with a score of 1! This proves what I knew before--this challenge is pretty bad. – Joshua – 2017-09-05T14:26:10.403
@Joshua I don't think this "proves the challenge is bad". You may have the opinion that it is bad but I feel it perfectly fine that some users have attained the perfect score. Would you call a test bad if some students in the class attain a 100%? The test may be bad for different reasons but people doing well does not prove anything about the quality of the test. – Post Rock Garf Hunter – 2017-09-05T14:45:32.140
Could you please rule if this, this, and this answer are valid? I've voiced my concerns in the comments.
– Dennis – 2017-09-06T15:54:23.720@Dennis I am going to say no, they are not valid. Answers should only accept one value. – Post Rock Garf Hunter – 2017-09-06T16:50:11.867
They might accept only one value. The thing is that we don't know. – Dennis – 2017-09-06T17:54:50.320
@Dennis Ok I don't know. Maybe this challenge should just be closed as unclear anyway. Everyone except me seems to think its not fun and I don't really have a opinion on this issue. It might be best to let it die. – Post Rock Garf Hunter – 2017-09-06T18:36:06.770
1@tfbninja I don't do javascrpit either – Post Rock Garf Hunter – 2017-12-13T18:51:24.013