How aadip-thapaliya/project-1 works
Project type and purpose
• This is a small, single‐module command-line (terminal) Python application implementing Tic Tac Toe for two local players.
• It has no client/server split, no database or external services—just an interactive prompt, game logic, and board state management.
File structure
• Top-level files:
• Project 1.ipynb – Jupyter notebook containing the entire game code (cells for imports, functions, game‐loop).
• README.md – documentation of rules, features, and usage.
• No separate “src/” or “lib/” folders; everything lives in one notebook.
• No build scripts, no configuration, no external dependencies.
Key components
a. User Interface (CLI Layer)
• Reads player input (marker choice, position choice, replay choice)
b. Game Controller
• Orchestrates turn order (including random first player selection)
c. Board State Model
• A list of 10 strings, index 1–9 map to board positions
• Maintains current markers
d. Game Logic / Utility Functions
• place_marker(board, marker, position)
• win_check(board, marker)
• full_board_check(board)
• replay() prompt
e. Randomizer Module
• random.choice to decide which player goes first
Relationships and data flows
• Player → CLI Layer: input
• CLI Layer → Controller: user decisions (marker, position)
• Controller → Board Model: update board
• Logic Functions → Controller: Boolean results
• Controller → CLI Layer: messages/outcome
• Controller → Randomizer: initial turn assignment
Architectural patterns / design principles
• Layered design: separate concerns (I/O vs. game logic vs. data model)
• Single execution loop in the Controller
• Stateless utility functions operate on the Board Model
• Use of Python standard library only
Checklist for the principal software engineer
• Five components and dependencies between them.
• Game loop cycle: input → process → update → output.
• Where Python’s standard library (random module, input/output) is used.