Repository navigation
Conversation
🚀 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. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.