GPT-5.3 Codex prompt used to generate Yet Another Sudoku
đź§ľ System Prompt (Set Role / Guidelines)
You are an AI iOS Software Engineer Codex agent. Your task is to generate a full working Xcode project that implements a Sudoku game app per the specification below.

You must produce all source code, project files, and a basic test suite that verifies key logic. Treat this as a real professional deliverable. The output should be a complete structure that can be opened in Xcode and compiled.

Follow these rules:
- Use Swift 5 and SwiftUI for iOS (assume iOS 17+).
- Do not assume any pre-existing code — generate everything from scratch.
- Write clear, well-commented code.
- Include a basic test suite, including unit tests for puzzle generation and solver logic.
- Ensure code compiles and logically works per specification.
- Provide any necessary README.md or instructions within the project.

📦 Project Specification (User Prompt)

# 1. App Overview
Create an iOS app named “Yet Another Sudoku”.

## 2. Main Menu
The first screen is a Menu with:
- Title at top: “Yet Another Sudoku”
- Three large buttons:
  * Easy Game
  * Random Game
  * Daily Challenge

Button behavior:
- Easy Game → opens Puzzle screen with an Easy puzzle.
- Random Game → opens Puzzle screen with random difficulty puzzle (mix of easy to hard).
- Daily Challenge → opens Puzzle screen with a hard puzzle tied to today’s date seed.

## 3. Puzzle Generation Rules
- All puzzles must be generated at runtime using a random seed.
- Daily Challenge uses the current date as the seed so it is reproducible.
- Puzzle generation algorithm must:
  1. Generate a full, valid solved Sudoku board using the seed.
  2. Randomly remove numbers one by one using the same seeded RNG.
  3. After each removal, call your own Sudoku solver that finds forced moves.
  4. Stop when no forced moves remain.
  5. Depending on difficulty:
     - Easy: leave more revealed numbers
     - Random: mix
     - Daily: Hard with minimal pre-filled numbers
  6. Each mode should have parameters specifying how many numbers to add back once no forced moves are available.

## 4. Puzzle Screen UI
- Title showing the game mode and difficulty.
- Reset button at top to regenerate current mode puzzle.
- A 9x9 board where:
  - Non-editable cells show puzzle numbers.
  - Empty cells are tappable.
  - Tapped cells highlight (yellow).
- Number pad at bottom with digits 1–9 and a Clear button.
- When a cell is selected:
  - In Easy mode: keyboard enables only valid possible numbers for that cell given current board state.
  - In Random mode: show a checkbox “Enable Hints”. If checked, enable only possible numbers; if unchecked, enable all digits.
  - In Daily mode: no hints toggle; all keys enabled.

- When user types a number, display the input differently from original puzzle numbers (e.g., different color or style).

## 5. Game Completion
- Detect when Sudoku is solved correctly.
- Show a congratulation popup with:
  - “Play Next Puzzle”
  - If Daily Challenge: text saying “Come back tomorrow for a new Daily puzzle”.

## 6. Tests
Include tests in the project:
- Unit tests for the generator and solver logic:
  - Test random seed produces consistent puzzles.
  - Test solver correctly finds forced moves and validates puzzles.
- If possible include basic UI test for board rendering and number entry.

## 7. Output Structure
Provide a final directory tree such as:
```
YetAnotherSudoku/
├── YetAnotherSudoku.xcodeproj
├── Sources/
│   ├── Models/
│   ├── Views/
│   ├── ViewModels/
│   └── Helpers/
├── Tests/
│   ├── SudokuLogicTests.swift
│   └── UIInteractionTests.swift
└── README.md
```

## 8. Final Instructions
- Ensure project compiles in Xcode without errors.
- Provide any design notes where necessary.
- Focus on clarity and correctness.

# End Specification
© Javoft Ltd. All rights reserved.