g | x | w | all
Bytes Lang Time Link
077C64 Basic250729T151614ZOSI8

C64 Basic, 77 bytes

0fOa=0to1:fOf=0to1:b=1-a:x=a<>f:t=1-f:y=(faNb=0)<>(baNt=0):ifx=ytHnE:nE
1?a+1

Description

Definitions

Rules

Algorithm

Result

The output is 2, so box 2 contains gold.

Additum

The above program stops at the first result found. But if you iterate to the end, it finds two cases, both with gold in box 2 but different statements about the inscription.

enter image description here

Try in emulator