← All Duels

gemini-2.5-pro_vs_grok-4_20260124_043638.jsonl — 10 puzzles

gemini-2.5-pro
-4
vs
grok-4
1
#1 Sample Solution Wrong
import sys

def mystery(x):
    if not isinstance(x, str) or len(x) % 2 != 0:
        return False
    
    try:
        data = bytes.fromhex(x)
    except ValueError:
        return False

    key = b'puzzler'
    
    decoded = bytearray()
    for i, byte in enumerate(data):
        decoded.append(byte ^ key[i % len(key)])
        
    try:
        return decoded.decode('utf-8') == "The magic number is 42."
    except UnicodeDecodeError:
        return False
"3e27150c181a030c0f3c1a160f061d0b0f5b111a130f1d10451e0f071a"
Proposer: gemini-2.5-pro Solver: grok-4
-1 vs 0
#2 Solver Failed
def mystery(x):
    if not isinstance(x, str) or len(x) % 2 != 0:
        return False
    
    try:
        data = bytes.fromhex(x)
    except ValueError:
        return False

    key = b'puzzle'
    
    decoded = bytearray()
    for i, byte in enumerate(data):
        decoded.append(byte ^ key[i % len(key)])
        
    try:
        return decoded.decode('utf-8') == "The answer is 42."
    except UnicodeDecodeError:
        return False
"2c15175a150b0300170c4c040355464842"
"241d1f5a0d0b03021f084c0c03554e4842"
Proposer: grok-4 Solver: gemini-2.5-pro
-1 vs 1
#3 Sample Solution Wrong
import zlib
import base64

def mystery(x):
    # The solver must provide a non-negative integer.
    if not isinstance(x, int) or x < 0:
        return False

    # The core of the puzzle: reversing a multi-step encoding process.
    # The solver needs to figure out that `x` is a number that needs to be
    # converted to a string in a specific base.
    
    B64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
    base = len(B64_ALPHABET)
    
    # Step 1: Convert the integer `x` back to a base-64 string.
    # This is a standard base conversion algorithm.
    if x == 0:
        s = B64_ALPHABET[0]
    else:
        s = ''
        temp_x = x
        while temp_x > 0:
            s = B64_ALPHABET[temp_x % base] + s
            temp_x //= base
            
    # Step 2: The decoded string might need padding for base64.
    # This is a tricky part. The solver needs to know base64 rules.
    padding = '=' * (-len(s) % 4)
    s_padded = s + padding
    
    try:
        # Step 3: Base64 decode the string.
        decoded_bytes = base64.b64decode(s_padded)
        
        # Step 4: Decompress the bytes using zlib.
        decompressed_bytes = zlib.decompress(decoded_bytes)
        
        # Step 5: Check against the hidden secret.
        return decompressed_bytes == b'A puzzle a day keeps the boredom away.'
        
    except (zlib.error, ValueError, TypeError):
        # Catches errors from b64decode, decompress, etc.
        return False
1432423438133502947113838043431692131341031299946283151834162002772596950275817811234850
Proposer: gemini-2.5-pro Solver: grok-4
-2 vs 1
#4 Sample Solution Wrong
import base64

def mystery(x):
    if not isinstance(x, str):
        return False
    try:
        b1 = base64.b64decode(x)
        b2 = base64.b32decode(b1)
        b3 = base64.b16decode(b2)
        return b3 == b'42'
    except:
        return False
"R11yREdNUT0="
Proposer: grok-4 Solver: gemini-2.5-pro
-2 vs 0
#5 Sample Solution Wrong
def mystery(x):
    if not isinstance(x, str) or len(x) != 16:
        return False

    # A fixed permutation rule.
    PERMUTATION_INDICES = [13, 1, 11, 4, 9, 7, 3, 0, 15, 8, 14, 6, 5, 2, 10, 12]
    
    def permute(s: str) -> str:
        res = [''] * 16
        for i, char in enumerate(s):
            res[PERMUTATION_INDICES[i]] = char
        return "".join(res)

    try:
        # The number of permutations depends on the input string itself.
        k = (ord(x[0]) + ord(x[1])) % 10 + 1
    except IndexError:
        return False

    # Apply the permutation k times.
    current_val = x
    for _ in range(k):
        current_val = permute(current_val)
        
    TARGET = "s1mple_p3rmut4t10n"
    
    return current_val == TARGET
"u_n0t_s0_s1mpl3"
Proposer: gemini-2.5-pro Solver: grok-4
-3 vs 0
#6 Sample Solution Wrong
import base64

def mystery(x):
    if not isinstance(x, str):
        return False
    
    try:
        data = bytes.fromhex(x)
    except ValueError:
        return False

    key = b'secret'
    
    decoded = bytearray()
    for i, byte in enumerate(data):
        decoded.append(byte ^ key[i % len(key)])
        
    decoded_bytes = bytes(decoded)
    
    further_decoded = base64.b64decode(decoded_bytes)
    
    return further_decoded == b'The answer is 42.'

    # No except here, but the decodes can raise.
    
except:
    return False
"25220b1e002d2450191657220a2c241e1f3d37341a3e0249"
Proposer: grok-4 Solver: gemini-2.5-pro
-3 vs -1
#7 Solved
def mystery(x):
    if not isinstance(x, str):
        return False

    # The state is a 2x2 matrix, initialized to the identity matrix.
    # We represent [[a, b], [c, d]] as a flat list [a, b, c, d].
    state = [1, 0, 0, 1]

    # Two transformation matrices, which the solver must identify.
    A = [[1, 1], [1, 0]]
    B = [[1, 2], [0, 1]]

    def mat_mul(M1_flat, M2):
        # Multiplies matrix M1 (flat) by M2 (2x2), returning a new flat matrix.
        a, b, c, d = M1_flat
        e, f = M2[0]
        g, h = M2[1]
        
        # Result = M1 * M2
        return [a * e + b * g, a * f + b * h, c * e + d * g, c * f + d * h]

    # Each character in the input string applies a matrix transformation.
    for char in x:
        if char == 'A':
            state = mat_mul(state, A)
        elif char == 'B':
            state = mat_mul(state, B)
        else:
            # The input string must only contain 'A' or 'B'.
            return False
            
    # The puzzle is solved if the final state matrix matches this specific target.
    target = [100, 19, 79, 15]
    
    return state == target
"ABAABABBA"
"ABAABABBA"
Proposer: gemini-2.5-pro Solver: grok-4
-3 vs -1
#8 Solver Failed
def mystery(x):
    if not isinstance(x, int) or x < 0:
        return False
    if x % 101 != 42:
        return False
    if x % 103 != 43:
        return False
    if x % 107 != 44:
        return False
    if x % 109 != 45:
        return False
    return True
102380310
102360310
Proposer: grok-4 Solver: gemini-2.5-pro
-3 vs 0
#9 Sample Solution Wrong
def mystery(x):
    if not isinstance(x, int) or x <= 1:
        return False
    
    n = x
    # This loop follows the famous Collatz sequence.
    # The puzzle is to find a starting number `x` that reaches
    # a specific target value in a specific number of steps.
    for i in range(100):
        # Check for the target state.
        if n == 1337:
            # The number of iterations must be exact.
            # i is 0 on the first step, so i=57 means 58 steps have been taken.
            return i == 57

        # The Collatz transformation rules.
        if n % 2 == 0:
            n = n // 2
        else:
            n = 3 * n + 1
            
    return False
123456789
Proposer: gemini-2.5-pro Solver: grok-4
-4 vs 0
#10 Solver Failed
def mystery(x):
    if not isinstance(x, int) or x < 0:
        return False
    if x % 101 != 42:
        return False
    if x % 103 != 43:
        return False
    if x % 107 != 44:
        return False
    if x % 109 != 45:
        return False
    if x % 113 != 46:
        return False
    return True
6855155611
5076898059
Proposer: grok-4 Solver: gemini-2.5-pro
-4 vs 1