Skip to content

Uploading my previous Solution to submit it for review - #779

Closed
cparkes1 wants to merge 3 commits into
the-csharp-academy:mainfrom
cparkes1:main
Closed

cparkes1 wants to merge 3 commits into
the-csharp-academy:mainfrom
cparkes1:main

Conversation

@cparkes1

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

🚀 Project Submitted!

Thanks for submitting your project! I will review it soon.

📋 Please check the dashboard to make sure the project is marked as Pending.

⚠️ If it's not marked as pending, submit it manually using the URL for this PR.

Import System.Diagnostics and add Stopwatch timing around the question loop. Capture start timestamp before the do/while loop and compute elapsed time after, formatted as mm:ss.fff and shown in console output. Replace scoreTracker int with score and update increments/usages. Change scoreList from List<int> to List<string> and store combined "score + formatted elapsed" entries. Update console messages to display points alongside elapsed time.
Replace the old string-based score list with a typed GameResult model and update program logic to store, sort, and display GameResult instances.

- Add GameResult class (Score:int, Time:TimeSpan) with ctor and ToString() that formats time as mm:ss.fff.
- Add using System.Collections.Generic and System.Linq to Program.cs.
- Replace List<string> scoreList with List<GameResult> scoreHistory.
- Build sortedLeaderboard with LINQ: OrderByDescending(r => r.Score).ThenBy(r => r.Time) and print entries via GameResult.ToString().
- On game end compute elapsedTime (TimeSpan) and add new GameResult(score, elapsedTime) instead of a preformatted string.
@cparkes1 cparkes1 closed this Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant