A command-line quiz game that fetches questions from OpenTrivia API with score tracking.
1.QuizGame.java # Main game logic (timer, scoring)
-
QuizService.java # API communication & JSON parsing
-
Question.java # Data model for questions
API Integration: Fetches questions from OpenTriviaDB
Timer: 15-second limit per question
Scoring: Tracks correct/incorrect answers
Data Storage: Saves high scores in data/scores.txt
-
Requirements:
- Java JDK 8+
- json-simple-1.1.jar
-
Commands:
# Compile
javac -cp .:json-simple-1.1.jar src/*.java
# Run
java -cp .:json-simple-1.1.jar src/QuizGame
## β
Project Requirements Met -
HTTP GET requests using HttpURLConnection
JSON parsing with json-simple
CLI-based game interface
OOP structure with separate classes
author harshit