Modified Boggle-able Code and Output: CnR Edition (Cops)

8

1

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.

Bubbler

Posted 2018-10-04T23:30:41.597

Reputation: 16 616

Just to make sure, both the output and input bytes can be reused, but can't be used twice in a row, right? – maxb – 2018-10-05T06:58:03.637

@maxb You're right, except that it's code, not input (the code cannot take input at all). – Bubbler – 2018-10-05T07:01:29.903

My mistake, I meant the code. Is there any limit on output length? – maxb – 2018-10-05T07:12:31.830

@maxb No limits, but note that your program should terminate in 5 seconds. – Bubbler – 2018-10-05T07:29:13.457

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? – Jo King – 2018-10-05T07:51:16.263

@JoKing That means using only one cell, then when exiting ] the memory is always zero. The only thing complicated is nested loops, and I don't think using it makes sense. The only thing "non-trivial" would be an arithmetic progression modulo 256. – Bubbler – 2018-10-05T08:06:50.813

There can be unused characters in your boggle boards, right? – Quintec – 2018-10-05T11:44:09.983

@Quintec 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. so yes – Shieru Asakoto – 2018-10-05T12:33:56.540

Answers

3

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.

Shieru Asakoto

Posted 2018-10-04T23:30:41.597

Reputation: 4 445

2If this doesn't start with console.log, I will be so impressed – Quintec – 2018-10-05T01:46:38.520

2Single 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. – Bubbler – 2018-10-05T06:48:52.657

Cracked – Arnauld – 2018-10-05T14:23:37.987

3

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.

Khuldraeseth na'Barya

Posted 2018-10-04T23:30:41.597

Reputation: 2 608

1What the JSF**k! lmao, and I bet the output is NaN – Shieru Asakoto – 2018-10-05T05:07:12.040

@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. – Khuldraeseth na'Barya – 2018-10-05T05:33:45.797

done reverting ;) https://codegolf.stackexchange.com/a/173396/71546

– Shieru Asakoto – 2018-10-05T05:35:03.530

2

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

Shieru Asakoto

Posted 2018-10-04T23:30:41.597

Reputation: 4 445

Cracked – Arnauld – 2018-10-05T13:27:24.983

1

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

Shieru Asakoto

Posted 2018-10-04T23:30:41.597

Reputation: 4 445

I love how you can’t form lambda xD – Quintec – 2018-10-05T11:39:52.120

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.) – Lynn – 2018-10-05T13:34:08.760

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.) – Lynn – 2018-10-05T13:56:43.380

1I 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. – tsh – 2018-10-08T06:16:53.300

1

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.

Khuldraeseth na'Barya

Posted 2018-10-04T23:30:41.597

Reputation: 2 608

Correctly cracked this time :) – Bubbler – 2018-10-05T06:17:24.050

Isn't this identical to your other JS post? – Shaggy – 2018-10-05T07:22:19.437

@Shaggy The first one was missing the full program mention, and was cracked as REPL instead. – Arnauld – 2018-10-05T07:49:17.740

1

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.

maxb

Posted 2018-10-04T23:30:41.597

Reputation: 5 754

0

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

maxb

Posted 2018-10-04T23:30:41.597

Reputation: 5 754

0

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

dylnan

Posted 2018-10-04T23:30:41.597

Reputation: 4 993

0

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.

Bubbler

Posted 2018-10-04T23:30:41.597

Reputation: 16 616