-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
905197c
commit 7a68273
Showing
7 changed files
with
547 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Help | ||
|
||
## Running the tests | ||
|
||
To run the tests: | ||
|
||
```sh | ||
$ dart test | ||
``` | ||
|
||
## Submitting your solution | ||
|
||
You can submit your solution using the `exercism submit lib/high_scores.dart` command. | ||
This command will upload your solution to the Exercism website and print the solution page's URL. | ||
|
||
It's possible to submit an incomplete solution which allows you to: | ||
|
||
- See how others have completed the exercise | ||
- Request help from a mentor | ||
|
||
## Need to get help? | ||
|
||
If you'd like help solving the exercise, check the following pages: | ||
|
||
- The [Dart track's documentation](https://exercism.org/docs/tracks/dart) | ||
- The [Dart track's programming category on the forum](https://forum.exercism.org/c/programming/dart) | ||
- [Exercism's programming category on the forum](https://forum.exercism.org/c/programming/5) | ||
- The [Frequently Asked Questions](https://exercism.org/docs/using/faqs) | ||
|
||
Should those resources not suffice, you could submit your (incomplete) solution to request mentoring. | ||
|
||
To get help if you're having trouble, you can use one of the following resources: | ||
|
||
- [Dart API Documentation](https://api.dart.dev/) | ||
- [Dart Gitter Chat](https://gitter.im/dart-lang/home) | ||
- [Community Information](https://www.dart.dev/community) | ||
- [/r/dartlang](https://www.reddit.com/r/dartlang) is the Dart subreddit. | ||
- [StackOverflow](https://stackoverflow.com/questions/tagged/dart) can be used to search for your problem and see if it has been answered already. You can also ask and answer questions. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# High Scores | ||
|
||
Welcome to High Scores on Exercism's Dart Track. | ||
If you need help running the tests or submitting your code, check out `HELP.md`. | ||
|
||
## Instructions | ||
|
||
Manage a game player's High Score list. | ||
|
||
Your task is to build a high-score component of the classic Frogger game, one of the highest selling and most addictive games of all time, and a classic of the arcade era. | ||
Your task is to write methods that return the highest score from the list, the last added score and the three highest scores. | ||
|
||
## Source | ||
|
||
### Created by | ||
|
||
- @Stargator | ||
|
||
### Contributed to by | ||
|
||
- @kytrinyx | ||
|
||
### Based on | ||
|
||
Tribute to the eighties' arcade game Frogger |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
analyzer: | ||
strong-mode: | ||
implicit-casts: false | ||
implicit-dynamic: false | ||
errors: | ||
unused_element: error | ||
unused_import: error | ||
unused_local_variable: error | ||
dead_code: error | ||
|
||
linter: | ||
rules: | ||
# Error Rules | ||
- avoid_relative_lib_imports | ||
- avoid_types_as_parameter_names | ||
- literal_only_boolean_expressions | ||
- no_adjacent_strings_in_list | ||
- valid_regexps |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class HighScores { | ||
List<int> scores = []; | ||
|
||
HighScores(this.scores); | ||
|
||
int latest() { | ||
return this.scores.last; | ||
} | ||
|
||
int personalBest() { | ||
var localScores = scores.toList()..sort(); | ||
|
||
return localScores.last; | ||
} | ||
|
||
List<int> personalTopThree() { | ||
var localScores = scores.toList()..sort(); | ||
|
||
return localScores.reversed.toList().take(3).toList(); | ||
} | ||
} |
Oops, something went wrong.