Parallel Functional Programming Final Project - Xinchen Zhang

Dependencies:
Required Haskell packages (probably):
  - rdeepseq
  - random
  - parallel


Compile with optimization and threading support:

  ghc -O2 -threaded -rtsopts -package deepseq -package containers Main.hs

Add -eventlog for ThreadScope visualization:

  ghc -O2 -threaded -rtsopts -eventlog -package deepseq -package containers Main.hs


Basic Usage:
  ./Main [game] [workers] [chunk] [iters]

Parameters:
  game    - Game to play: "ttt" or "go"
  workers - Number of parallel workers
  chunk   - Chunk size for batching workers (default: 2)
  iters   - Iterations per worker (default: 20000)

Examples:

  # Run Tic-Tac-Toe with 8 cores, 5000 iterations per core
  ./Main ttt 8 5000 +RTS -N2 -s

  # Run Go 5x5 with 8 cores, 10000 iterations per core
  ./Main go 8 10000 +RTS -N4 -s


Output:
  1. The best move found by MCTS
  2. Execution time statistics

Game Implementations:
Tic-Tac-Toe:
  - Standard 3x3 board
  - Two players (P1 and P2)
  - Win conditions: 3 in a row (horizontal, vertical, diagonal)
  - Draws when board is full with no winner

Go 5x5:
  - 5x5 board (25 intersections)
  - Standard Go rules implemented:
    * Placing stones
    * Capturing (removing groups with no liberties)
    * Suicide rule (cannot place stone with no liberties)
    * Passing moves
    * Area scoring at game end
  - Game ends after 2 consecutive passes

Results:
Results are stored in the results/ directory with naming convention:
  [game]_N[cores].txt      - Performance statistics
  [game]_N[cores].eventlog - ThreadScope event log


