9
\$\begingroup\$

This is the Cops' thread. Robbers' thread is here.

Background

Boggle is a board game where the players have to find English words on a 4-by-4 board of random alphabets. Words can be constructed by selecting sequentially adjacent cells on the board. ("adjacent" means horizontally, vertically or diagonally adjacent.) Also, same cell can't be used more than once in a word.

The following is an example board:

I L A W
B N G E
I U A O
A S R L

On this board, BINGO, ORANGE and WEARS are valid words, but SURGE and RUSSIA are not:

  • SURGE : There's no adjacent pair on the board having RG.
  • RUSSIA : S cannot be used twice.

Modified Boggle is a modified version of Boggle, with the following rules:

  • The board size is m-by-n, where m and n can be any positive integer.
  • Each cell can contain any one byte between 0 and 255 inclusive.
  • A cell can be used more than once, but not twice in a row.

Using the example board above, in addition to BINGO, ORANGE and WEARS, LANGUAGE becomes a valid string (since G is used twice, but not twice in a row) but RUSSIA is still not (due to SS pair).

Here is another example using a code fragment. The string from itertools import*\n can be found on the following board, but not from itertoosl import* or from itertools import *:

f   i   ' ' s
r   t   m   l
e   o   o   p
\n  *   t   r

Note that you need two o's in order to match the oo sequence.


Cop's challenge

Write a full program in your language of choice that satisfies the following rules:

  • The program should print something which is consistent over multiple runs.
  • The program should finish in roughly 5 seconds.
  • The program may not take any input.
  • Both the program and the output should be at least 2 bytes.
  • Anything related to hash functions, PRNGs, or cryptography is not allowed.

Then, lay out your program and output into two separate modified-boggle boards. Each board can be a non-square. Note that 1-by-N and 2-by-N boards can pose special challenges to both the cop and the robber. If you want some cells on a board unusable (to add more restriction), you can pick some useless bytes and fill the holes with them.

For example, if you want a 2x2 grid with horizontal/vertical movements only, you can do this instead:

a b
c d
-----------
X a X
c X b
X d X

In your submission, specify the language you used, the lengths of the source code and the output, and the two boggle boards. Note that shorter code and/or longer output is allowed for robbers, so you can choose to give some room for the byte counts (i.e. specify longer code and/or shorter output than your actual solution).

If your board contains some unprintable characters, you can specify the board as byte values instead.

After a week a cop is posted, it can be marked safe by the poster if it isn't cracked until then. The cop is still open for robbers until it's actually marked safe. A safe cop can't be cracked, and the poster should reveal the intended solution.

You'll want to obfuscate the boards as much as possible, as the robber's challenge is to crack your submission by finding the code and its output on the boards. If you want to cram a long code into a small board, answers to the original Modified Boggle challenge may give some insights.

Scoring for cops

Since it's hard to say whether a larger or smaller board is harder to crack, each safe cop submission counts as a score of 1. The user with the greatest score wins. It's encouraged to participate with different languages and creative approaches.

Cop example & formatting

# Japt, code 9 bytes, output 20 bytes

Code board: 2 rows, 2 columns

    `l
    íÏ

As byte values:

    96  108
    237 207

Output board: 3 rows, 3 columns

    175
    120
    643

Modified Boggle verification script

All of the scripts below have an example input with it.

Script for character string(code/output) & boggle. This does not support multi-line string. The input format is

  • a single line of string (either code or output), followed by
  • the raw boggle board.

Script for character string with byte-value boggle. Use this if the target string is printable but has one or more newlines in it. The input format is

  • the number of lines for the string,
  • raw string (possibly multi-line), then
  • the boggle board as byte values.

Script for byte-value string & boggle. Use this if the target string contains one or more unprintable characters. The input format is

  • a single line of string (either code or output) as byte values, followed by
  • the boggle board as byte values.
\$\endgroup\$
8
  • \$\begingroup\$ Just to make sure, both the output and input bytes can be reused, but can't be used twice in a row, right? \$\endgroup\$
    – maxb
    Oct 5, 2018 at 6:58
  • \$\begingroup\$ @maxb You're right, except that it's code, not input (the code cannot take input at all). \$\endgroup\$
    – Bubbler
    Oct 5, 2018 at 7:01
  • \$\begingroup\$ My mistake, I meant the code. Is there any limit on output length? \$\endgroup\$
    – maxb
    Oct 5, 2018 at 7:12
  • \$\begingroup\$ @maxb No limits, but note that your program should terminate in 5 seconds. \$\endgroup\$
    – Bubbler
    Oct 5, 2018 at 7:29
  • \$\begingroup\$ I've been trying to come up with a non-trivial output for brainfuck using only []+., but I think it might be impossible. Anyone care to try? \$\endgroup\$
    – Jo King
    Oct 5, 2018 at 7:51

9 Answers 9

3
\$\begingroup\$

JavaScript, 1443 bytes code, 3 bytes output, cracked in moments by @ShieruAsakoto

Code board, 3 rows by 4 columns

!![+
+[]]
+]()

Output board, 1 row by 2 columns

aN

Kinda obvious what the output is. It'll be the code that's fun to crack. Forgot to mention that it was intended to be a full program (and kinda implied that it wasn't; see paragraph below). For the real challenge, see my other answer.

I don't think this is Node.js, but my knowledge in this area is zero. What I can say is that it runs in my console in both Edge and Chrome.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ What the JSF**k! lmao, and I bet the output is NaN \$\endgroup\$ Oct 5, 2018 at 5:07
  • \$\begingroup\$ @ShieruAsakoto You had a valid crack. I'll revert this to its original state, and you can undelete your answer. I'll resubmit with clarification. \$\endgroup\$ Oct 5, 2018 at 5:33
  • \$\begingroup\$ done reverting ;) codegolf.stackexchange.com/a/173396/71546 \$\endgroup\$ Oct 5, 2018 at 5:35
3
\$\begingroup\$

JavaScript (Node.js), code 53 bytes, output 41 bytes, cracked by Arnauld

Code Board: 3 rows by 6 columns:

cog(n)
lsn1()
e.+<<;

Output Board: 4 rows by 6 columns:

481534
270906
602148
53829n

Hint: the code only works on V8 JS engines, version 6.7 or later

Mine was console.log(1n+1n+1n<<(1n+1n+1n+1n<<1n+1n+1n+1n+1n)); with the semicolon (don't ask why) and the output is yes, 3 * 2**128 with an trailing n marking the number as a BigInt literal.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ If this doesn't start with console.log, I will be so impressed \$\endgroup\$
    – Quintec
    Oct 5, 2018 at 1:46
  • 2
    \$\begingroup\$ Single number alone can't be printed as 41 digits. There should be a way to cast to a string, but... console is not available except at start, no assignment, no string literal, no brackets (thus no array literal nor indexing). I even checked Node globals and console's properties, but nothing fits there. \$\endgroup\$
    – Bubbler
    Oct 5, 2018 at 6:48
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Arnauld
    Oct 5, 2018 at 14:23
2
\$\begingroup\$

JavaScript (Node.js), code 88 bytes, output 2 bytes, cracked by Arnauld with a 27-byte

Code Board: 7 rows by 9 columns:

e.i--)=%5
lc;,2s*17
fosn8407%
gnr785138
s(;527067
=);s%1419
4n,i=1832

Output Board: 1 rows by 2 columns:

0n

The output is obvious, but the code is not. ;)

My original answer was an LL-test of M127, which was

for(s=4n,i=125;i;s%=170141183460469231731687303715884105727n,i--)s=s*s-2n;console.log(s)

Arnauld's answer utilized the semicolons to bridge a shorter crack, and I didn't expect (or realize) the s%=s part at all:

s=4n;s%=s;7n;console.log(s)

Oh by the way my 3 posts have absolutely nothing to do with hash functions, PRNGs or cryptography. I swear these three are only about number manipulations.

there are unused bytes in code board

\$\endgroup\$
1
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Arnauld
    Oct 5, 2018 at 13:27
1
\$\begingroup\$

MathGolf, code 42 bytes, output 22 bytes

Code Board: 3 rows by 7 columns

 r5 qÄ 
~←▲↔▼→~
 Äq 5r 

Output Board: 3 rows by 6 columns:

421
402
135

This is quite a bit longer, but I'll give a small hint: The code board is supposed to resemble a bowtie, and you might need to "tie" it multiple times.

\$\endgroup\$
1
\$\begingroup\$

JavaScript, 1443 bytes code, 3 bytes output, cracked by @Bubbler

A full program.

Code board, 3 rows by 4 columns

!![+
+[]]
+]()

Output board, 1 row by 2 columns

aN

Kinda obvious what the output is. It'll be the code that's fun to crack.

I don't think this is Node.js, but my knowledge in this area is zero. What I can say is that it runs in both Edge and Chrome. By "full program" I mean that it runs when placed between <script> and </script> in an HTML file.

\$\endgroup\$
3
  • \$\begingroup\$ Correctly cracked this time :) \$\endgroup\$
    – Bubbler
    Oct 5, 2018 at 6:17
  • \$\begingroup\$ Isn't this identical to your other JS post? \$\endgroup\$
    – Shaggy
    Oct 5, 2018 at 7:22
  • \$\begingroup\$ @Shaggy The first one was missing the full program mention, and was cracked as REPL instead. \$\endgroup\$
    – Arnauld
    Oct 5, 2018 at 7:49
1
\$\begingroup\$

Python 3, code 56 bytes, output 69 bytes, SAFE

Code Board: 4 rows by 10 columns:

  print(1,
b; f,)*l(1
 =lamb+a,)
ese d:(-1)

Output Board: 7 rows by 7 columns:

1466900
3427430
1304212
9653895
0511633
5680228
4437679

Much difficult one than my first challenge ;)

Expected Code and Output:

Code:

l=lambda a,b:(a+b)*l(a-1,a*b)if a else b;print(l(11,11))

Output:

421827435070654423113161304555505960246647934329322186026783332352000
\$\endgroup\$
4
  • \$\begingroup\$ I love how you can’t form lambda xD \$\endgroup\$
    – Quintec
    Oct 5, 2018 at 11:39
  • \$\begingroup\$ You can, reusing a letter is allowed, just not twice directly in a row. (I think I have the form of this one down, but it's very tweakable, and that output could be anything… I found a 56 byte program with 69 byte output, but it's not on the Boggle board.) \$\endgroup\$
    – Lynn
    Oct 5, 2018 at 13:34
  • \$\begingroup\$ OK, I just realized output is allowed to be longer which changes things. But I still don't see a way to "trick" it (I bet there's some way to output 10^lots, though.) \$\endgroup\$
    – Lynn
    Oct 5, 2018 at 13:56
  • 1
    \$\begingroup\$ I bet it should look like l=lambda a,b:+l(a-1,a*b)if a else b;print(l(11,1))... But I cannot find one. \$\endgroup\$
    – tsh
    Oct 8, 2018 at 6:16
0
\$\begingroup\$

MathGolf, code 7 bytes, output 12 bytes

Just a first easy challenge, if you want to get into MathGolf!

Code Board: 2 rows by 4 columns

╒Æ■r
îm4~

Output Board: 2 rows by 3 columns

140
412
\$\endgroup\$
0
\$\begingroup\$

Jelly, 17 byte code, 19 byte output

The general method shouldn't be too hard to pick out.

Code board

»V
”;
“;

Output board

Krgwn
Ubots
RAbbt
\$\endgroup\$
0
\$\begingroup\$

J (REPL), code 9 bytes, output 10000 bytes

Code board: 3 rows, 3 columns

epi
j.r
oI5

Output board: 3 rows, 2 columns, as byte values

10  10
48  49
32  255

In essence, \n\n / 01 / <space><don't use>.

Intended solution gives 20008-byte output.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.