How bnk0dev/oyunteorisi works
Project type and purpose
• This is a simple command-line Java application (“oyunTeorisi”) that simulates a two-player iterative game (trust vs. betray) where each player starts at 0 points and races to 10 points. The core functionality lives in a single Java source file (game.java).
File structure
• Top-level:
• README.md – project description and rules
• game.java – all code (game loop, input handling, scoring logic, end-condition)
• No separate frontend/backend, no external dependencies, no configuration or build scripts beyond a standard javac/java invocation.
README for additional insights
• Rules for scoring:
• Both trust → +2 each
• One betrays → betrayer +3, betrayed −1
• Both betray → no points
• Goal: first to 10 points wins
a. Main components
1. Command-Line Interface (CLI) – reads player input and displays results
2. Game Engine – orchestrates rounds, applies game rules
3. Score Manager – computes and updates scores based on decisions
4. Player Entities – two instances representing “You” and “Opponent”
5. Termination Checker – determines if a player has reached 10 points
b. Relationships and interactions
• The CLI passes decisions to the Game Engine each round
• Game Engine invokes the Score Manager with both decisions
• Score Manager returns updated scores to the Game Engine
• Game Engine updates Player Entities and calls the Termination Checker
• If no winner, loop back to CLI for the next round; otherwise CLI displays the winner
c. Architectural patterns/design principles
• Separation of concerns:
• Input/Output (CLI) vs. core logic (Game Engine) vs. scoring rules (Score Manager)
• Single-threaded, synchronous loop
d. Key technologies
• Java SE standard libraries (java.util.Scanner for input)
• No external frameworks or databases