How abzy2020/dotty-game works
Project type and purpose
• This is a small standalone Java console application implementing a two-player “Dotty” sum-guessing game.
• Purpose: Present a command-line UI, accept player inputs (two numbers and sum guesses), enforce game rules, and declare a winner or loser.
File structure
• Top level:
• LICENSE, README.md
• Usogui/
– bin/ (compiled .class files)
– src/
• App.java – likely the entry point and CLI orchestration
• NumberGame.java – core game logic and rule enforcement
• No external configs, no database, no web layer.
README for additional insights
• Simple rule set: two players choose numbers in [1..10]; they alternate guessing the sum; invalid choices cause an instant loss.
• No mention of persistence, network, or GUI beyond console I/O.
a. Main components to show
• Presentation Layer
• Console Input/Output (in App.java)
• Application Layer
• Game Controller (App.java orchestrator)
• Domain Layer
• Game Engine (NumberGame.java)
• Utility/Infrastructure (optional)
• Validation logic (bounds check, sum logic)
• Error/Rule Violation Handler
b. Relationships and interactions
• User → Console I/O → App (reads numbers & guesses)
• App → NumberGame (pass inputs to game engine)
• NumberGame → Validation & Rule Engine → returns outcome (valid/invalid, win/lose, next turn)
• App ← outcome ← NumberGame → Console Output (display feedback, winner)
c. Architectural patterns or principles
• Separation of Concerns:
• Presentation (App.java I/O) vs. Business Logic (NumberGame.java)
• Single-Responsibility:
• App.java drives flow; NumberGame.java enforces rules
• Stateless core engine (no side-effects, all state passed in/out)
d. Key technologies
• Java (JDK 8+), standard IO (java.io or java.util.Scanner)
• No external dependencies or frameworks