36
2
Note: This challenge is finished. Submissions are still welcome but can not win.
This is the cops' thread. The robbers' thread goes here.
Write a code that outputs the integer 1
. If you add, remove or substitute a single character (of your choosing), the code should output the integer 2
. Change one more character (the same or another), and the code should output 3
. Continue like this as far as you can, but maximum up to 10. Default output formats such as ans = 1
are accepted. You can ignore output to STDERR (or equivalent).
You must reveal the language, byte count of your initial code, the number of integers it works for, as well as an optional number of characters of the initial code. Note: You don't have to reveal any characters, but remember that revealing characters might make it harder for the robbers as they must use the same character in the same position. You can choose which character you use to denote unrevealed characters (for instance underscore), but make sure to specify this.
Cops can provide the uncracked code after one week and call the submission "SAFE". The winning submission will be the shortest uncracked submission that produces the number 10. If no uncracked submissions are able to print 10, the shortest code that produces 9 will win, and so on. Note that the robbers don't have to make the same changes as you do, and they don't have to reproduce the exact code (unless you reveal all characters). They must only reproduce the output.
Submissions posted later than November 24th are welcome but not eligible for the win (because there will likely be fewer robbers around).
Example post:
The following post is a submission in the language MyLang
, it is 9 bytes long, and it works for numbers 1 - 8.
MyLang, 9 bytes, 8 numbers
This submission works for 1 - 8. Unrevealed characters are indicated with an underscore: _
.
abc____i
Leaderboard
Disclaimer: The leaderboard is not tested and uncracked submissions might not appear in the list.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><style>table th,table td{padding: 5px;}th{text-align: left;}.score{text-align: right;}table a{display: block;}.main{float: left;margin-right: 30px;}.main h3,.main div{margin: 5px;}.message{font-style: italic;}#api_error{color: red;font-weight: bold;margin: 5px;}</style> <script>QUESTION_ID=99546;var safe_list=[];var uncracked_list=[];var n=0;var bycreation=function(x,y){return (x[0][0]<y[0][0])-(x[0][0]>y[0][0]);};var byscore=function(x,y){return (x[0][1]>y[0][1])-(x[0][1]<y[0][1]);};function u(l,o){jQuery(l[1]).empty();l[0].sort(o);for(var i=0;i<l[0].length;i++) l[0][i][1].appendTo(l[1]);if(l[0].length==0) jQuery('<tr><td colspan="3" class="message">none yet.</td></tr>').appendTo(l[1]);}function m(s){if('error_message' in s) jQuery('#api_error').text('API Error: '+s.error_message);}function g(p){jQuery.getJSON('//api.stackexchange.com/2.2/questions/' + QUESTION_ID + '/answers?page=' + p + '&pagesize=100&order=desc&sort=creation&site=codegolf&filter=!.Fjs-H6J36w0DtV5A_ZMzR7bRqt1e', function(s){m(s);s.items.map(function(a){var he = jQuery('<div/>').html(a.body).children().first();he.find('strike').text('');var h = he.text();if (!/cracked/i.test(h) && (typeof a.comments == 'undefined' || a.comments.filter(function(b){var c = jQuery('<div/>').html(b.body);return /^cracked/i.test(c.text()) || c.find('a').filter(function(){return /cracked/i.test(jQuery(this).text())}).length > 0}).length == 0)){var m = /^\s*((?:[^,;(\s]|\s+[^-,;(\s])+).*(0.\d+)/.exec(h);var e = [[n++, m ? m[2]-0 : null], jQuery('<tr/>').append( jQuery('<td/>').append( jQuery('<a/>').text(m ? m[1] : h).attr('href', a.link)), jQuery('<td class="score"/>').text(m ? m[2] : '?'), jQuery('<td/>').append( jQuery('<a/>').text(a.owner.display_name).attr('href', a.owner.link)) )];if(/safe/i.test(h)) safe_list.push(e);else uncracked_list.push(e);}});if (s.items.length == 100) g(p + 1);else{var s=[[uncracked_list, '#uncracked'], [safe_list, '#safe']];for(var i=0;i<2;i++) u(s[i],byscore);jQuery('#uncracked_by_score').bind('click',function(){u(s[0],byscore);return false});jQuery('#uncracked_by_creation').bind('click',function(){u(s[0],bycreation);return false});}}).error(function(e){m(e.responseJSON);});}g(1);</script><link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/Sites/codegolf/all.css?v=7509797c03ea"><div id="api_error"></div><div class="main"><h3>Uncracked submissions</h3><table> <tr> <th>Language</th> <th class="score">Score</th> <th>User</th> </tr> <tbody id="uncracked"></tbody></table><div>Sort by: <a href="#" id="uncracked_by_score">score</a> <a href="#" id="uncracked_by_creation">creation</a></div></div><div class="main"><h3>Safe submissions</h3><table> <tr> <th>Language</th> <th class="score">Score</th> <th>User</th> </tr> <tbody id="safe"></tbody></table></div>
Not sure I understand... given an arbitrary code in CJam that produces
– Luis Mendo – 2016-11-12T12:48:19.7931
, how can I prevent the robbers from adding)
repeatedly to generate the rest of the numbers? The same would be valid for quite a few languages2If that's possible for any program that outputs
1
then it appears CJam is a bad choice of language for this challenge. There's no way to prevent robbers from doing that. – Stewie Griffin – 2016-11-12T12:50:30.290Got it, thanks. As I said, that rules out quite a few golfing languages (an "increment" operator is very common) – Luis Mendo – 2016-11-12T12:52:15.450
3@LuisMendo Well, it will certainly make this more interesting... – LegionMammal978 – 2016-11-12T12:58:13.640
So a robber is allowed to simply add characters to the code (thereby increasing the byte count)? – Daniel – 2016-11-12T13:47:29.983
@Dopapp, yes. The initial code must have the same length though. – Stewie Griffin – 2016-11-12T14:16:07.273
I really want to do something with JSFucky code, but I have neither the time nor the confidence it would even be a good fit for this environment
– CAD97 – 2016-11-13T09:09:43.760"maximum up to 10." Does this mean that the code to output 10 must not be modifiable under the given rules to output 11? Would a possible output of 12 be OK? – Daniel Jour – 2016-11-13T16:22:53.817
1@DanielJour It can be modifiable up to any number, but the maximum number the robbers need to find is
10
. That rule is in place because many submissions can probably be extended to infinity (in theory), so scoring based on the highest achieved number wouldn't make sense. – Stewie Griffin – 2016-11-13T16:25:09.423Snippet added. I haven't tested it properly so there might be uncracked submissions that don't appear in the list. – Stewie Griffin – 2016-11-15T14:10:57.763
Re: snippet testing, consider a submission (e.g.) where someone has posted a crack that is invalid, but hasn't removed their comment. I would consider these uncracked, but they do not appear in the list.
– DLosc – 2016-11-15T20:05:36.5431
You may want to try only disqualifying an entry if the header contains
– ETHproductions – 2016-11-15T20:51:07.927cracked
in some form. This is what the redesign userscript currently does.Does the same character have to be changed? – noɥʇʎԀʎzɐɹƆ – 2016-11-15T23:44:25.983
@CrazyPython, no. From the challenge text: "Change one more character (the same or another),". Note that the changes are incremental. So, to get to
6
you should alter the code you had for5
, not the code you used for1
. Makes sense? – Stewie Griffin – 2016-11-16T09:00:38.650