#!/bin/bash

# Set working directory to project root
cd "$(dirname "$0")/../../../" || exit

# Default parameters
NUM_OF_DATA=300
# NUM_OF_DATA=10  # Test parameter
MAX_ATTEMPTS=1000
UNIQUE_SOLUTION=true

mkdir -p ./games/tasks/sudoku/data

for DIFFICULTY in 1 2 3; do
  # Output current parameters
  echo "Generating Sudoku game data with the following parameters:"
  echo "Number of puzzles: $NUM_OF_DATA"
  echo "Maximum attempts: $MAX_ATTEMPTS"
  echo "Difficulty level (1-4): $DIFFICULTY"
  echo "Require unique solution: $UNIQUE_SOLUTION"

  # Create data directory

  # Prepare unique solution parameter
  UNIQUE_PARAM=""
  if $UNIQUE_SOLUTION; then
    UNIQUE_PARAM="--unique_solution"
  else
    UNIQUE_PARAM="--no-unique_solution"
  fi

  # Run game generation script
  python -m games.tasks.sudoku.scripts.sudoku \
    --num_of_data "$NUM_OF_DATA" \
    --max_attempts "$MAX_ATTEMPTS" \
    --difficulty "$DIFFICULTY" \
    $UNIQUE_PARAM

  echo "Sudoku game data generation completed!"

done