Skip Navigation

MarblePunk Puzzle "Factorial Calculator" (expert)

Factorial Calculator

Difficulty: Expert

Game Overview

Design a physical track where a marble rolls and executes programming instructions. The marble carries a value and performs calculations as it hits different track pieces.

Puzzle

Calculate the factorial of 4 (4! = 4 × 3 × 2 × 1) and output the result 24.

Starting Conditions:

  • Marble begins carrying the value: 4
  • Expected output: 24

Available Track Pieces (Use Each Once):

  • 2× CURVE - Changes marble direction 90°
  • 1× STRAIGHT - Continues marble in same direction
  • 1× LOOP-TRACK - Connects track to form a physical loop
  • 1× BRANCH-ZERO - Marble goes LEFT if carrying 0, RIGHT otherwise
  • 1× SUBTRACT-1 - Subtracts 1 from marble's value
  • 1× MULTIPLY - Multiplies marble's value by memory slot A
  • 1× STORE-A - Saves marble's current value to memory slot A
  • 1× LOAD-A - Loads value from memory slot A into marble
  • 1× OUTPUT - Displays marble's current value
  • 1× HALT - Stops the marble

Rules:

  • Arrange all track pieces to create a complete path
  • Marble executes instructions when rolling over pieces
  • Design must calculate factorial using the loop mechanism
  • Marble must output 24 and then halt

Goal

The marble completes its journey, outputs 24, and stops.

0 comments

No comments

Start the conversation!