A massive stone statue dominates the Chamber, its eyes glowing with arithmetic runes. It will not yield to a sword. Only correct calculations can break the enchantment β and wrong answers deal damage.
let, expr, and $(( ))./statue to trigger and win the boss encounter./sword)| Syntax | Example | Result |
|---|---|---|
let "var=expr" |
let "x=3*4" |
x=12 |
expr a op b |
expr 10 - 3 |
7 (printed) |
$((expr)) |
echo $((2**8)) |
256 |
$((var++)) |
echo $((n++)) |
value then increment |
| Operator | Meaning |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Integer division |
% |
Modulo (remainder) |
** |
Exponentiation |
ls -F
# runes statue* chest
cat runes
The runes pose a riddle: βTo defeat me, compute the Vault Code: multiply the number of doors in the Cellar by the number of exits in the Entrance, then add 7.β
The numbers vary per game session. Example: 4 doors Γ 1 exit + 7 = 11.
# Method 1: let
let "vault_code = 4 * 1 + 7"
echo $vault_code # 11
# Method 2: expr (each token must be a separate arg)
expr 4 \* 1 + 7 # 11 (escape * to avoid glob expansion)
# Method 3: arithmetic expansion (preferred modern style)
vault_code=$(( 4 * 1 + 7 ))
echo $vault_code # 11
Recommendation: Use
$(( ))β it is cleaner, handles operator precedence correctly, and does not requireexprto be installed.
Replace the example numbers with the values from YOUR runes:
# Template:
answer=$(( doors_in_cellar * exits_in_entrance + 7 ))
echo "My answer is: $answer"
./statue
# The statue asks: "What is the Vault Code?"
# Enter your answer: 11
# CRACK! The statue crumbles. Victory!
Wrong answers reduce your HP. Make sure your math is right before running ./statue.
cat chest
# Stone Key fragment obtained.
inventory
The stone key fragment is part of the multi-piece key that opens the Rift.
| Problem | Cause | Fix |
|---|---|---|
expr 4 * 1 β error |
* glob-expanded |
Escape: expr 4 \* 1 |
let "x=5/2" β 2 |
Integer division | Use bc for floats: echo "5/2" \| bc -l |
| Variable not set | Missing $ |
Use echo $var, not echo var |
| Wrong answer, took damage | Calculation error | Recalculate carefully before ./statue |
$(( )))map)The stone key fragment is needed for the Rift β but you still need pieces from the other branches first.
Continue exploring:
Continue your terminal adventure with these resources:
Stone dust settles. The Chamber is yours. Arithmetic β the ultimate weapon. π