Running Marlin
After building Marlin, launch the interactive CLI:Available Commands
Marlin supports the following commands:| Command | Description | Example |
|---|---|---|
position [moves] | Set up a position by playing moves | position 4433 |
display | Show the current board state | display |
go | Find the best move using the solver | go |
help | Show available commands | help |
quit | Exit the program | quit |
Move Format
Moves are represented as digits 1-7, where each digit corresponds to a column:4→ Drop a piece in column 4 (the center column)4433→ Play four moves:- Player 1 drops in column 4
- Player 2 drops in column 4
- Player 1 drops in column 3
- Player 2 drops in column 3
Example Session
Here’s a complete example showing how to analyze a position:Set up a position
Let’s create a position where both players have played in the center columns:This plays:
- Move 1: Player 1 (X) → column 4
- Move 2: Player 2 (O) → column 4
- Move 3: Player 1 (X) → column 3
- Move 4: Player 2 (O) → column 3
Display the board
View the current position:Legend:
X= Current player’s pieces (Player 1)O= Opponent’s pieces (Player 2).= Empty cells
Understanding the Analysis
Score Interpretation
Marlin’s scores are always from the current player’s perspective:Positive Score
Current player can force a winExample:
+18 = Win in 18 movesZero Score
Perfect play leads to a drawNeither player can force a win
Negative Score
Opponent can force a winExample:
-12 = Lose in 12 moves- Higher positive → Faster win for current player
- Lower negative → Faster win for opponent
Move Analysis Output
When you rungo, Marlin shows the evaluation for each legal move:
- Each column’s game-theoretic value
- Which move is optimal (column 3 with score +18)
- How many positions were searched
Common Workflows
Analyze an Opening
Reset to Empty Board
Detect Immediate Wins
Marlin quickly detects winning moves without deep search:Performance Notes
Marlin uses transposition tables to cache positions. The first analysis of a position tree may take longer, but subsequent analyses (even from different move orders) will be much faster.
- Small numbers (< 1,000) → Shallow search or heavily pruned
- Large numbers (> 100,000) → Deep search in complex positions
- The transposition table and alpha-beta pruning work together to minimize this count
Next Steps
Now that you can run basic analyses, learn how Marlin works under the hood:Core Concepts
Understand bitboards, negamax, and alpha-beta pruning
API Reference
Explore Marlin’s classes and methods