├── .appends └── .github │ └── labels.yml ├── .github ├── CODEOWNERS ├── dependabot.yml ├── labels.yml └── workflows │ ├── analyze-code.yml │ ├── configlet.yml │ ├── format-check.yml │ ├── links.yml │ ├── no-important-files-changed.yml │ ├── pause-community-contributions.yml │ ├── ping-cross-track-maintainers-team.yml │ ├── sync-labels.yml │ └── test.yml ├── .gitignore ├── .lycheeignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── bin ├── check_formatting.dart ├── create_exercise.dart ├── fetch-configlet ├── fetch-configlet.ps1 └── presubmit.dart ├── concepts ├── callbacks │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── errors-basic │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── futures │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── iterables-basic │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── numbers-basic │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── recursion │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── strings-basic │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json └── type-conversion │ ├── .meta │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── config.json ├── docs ├── ABOUT.md ├── INSTALLATION.md ├── LEARNING.md ├── RESOURCES.md ├── SNIPPET.txt ├── TESTS.md └── config.json ├── exercises ├── practice │ ├── acronym │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── acronym.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── acronym_test.dart │ ├── all-your-base │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── all_your_base.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── all_your_base_test.dart │ ├── allergies │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── allergies.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── allergies_test.dart │ ├── anagram │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── anagram.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── anagram_test.dart │ ├── armstrong-numbers │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── armstrong_numbers.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── armstrong_numbers_test.dart │ ├── atbash-cipher │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── atbash_cipher.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── atbash_cipher_test.dart │ ├── beer-song │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── beer_song.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── beer_song_test.dart │ ├── binary-search-tree │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── binary_search_tree.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── binary_search_tree_test.dart │ ├── binary-search │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ ├── binary_search.dart │ │ │ └── value_not_found_exception.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── binary_search_test.dart │ ├── bob │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── bob.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── bob_test.dart │ ├── bottle-song │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── bottle_song.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── bottle_song_test.dart │ ├── circular-buffer │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── circular_buffer.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── circular_buffer_test.dart │ ├── collatz-conjecture │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── collatz_conjecture.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── collatz_conjecture_test.dart │ ├── darts │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── darts.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── darts_test.dart │ ├── diamond │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── diamond.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── diamond_test.dart │ ├── difference-of-squares │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── difference_of_squares.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── difference_of_squares_test.dart │ ├── dnd-character │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── dnd_character.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── dnd_character_test.dart │ ├── eliuds-eggs │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── eliuds_eggs.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── eliuds_eggs_test.dart │ ├── etl │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── etl.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── etl_test.dart │ ├── food-chain │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── food_chain.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── food_chain_test.dart │ ├── forth │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── forth.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── forth_test.dart │ ├── game-of-life │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── game_of_life.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── game_of_life_test.dart │ ├── gigasecond │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── gigasecond.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── gigasecond_test.dart │ ├── grade-school │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── grade_school.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── grade_school_test.dart │ ├── grains │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── grains.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── grains_test.dart │ ├── hamming │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── hamming.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── hamming_test.dart │ ├── hello-world │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── hello_world.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── hello_world_test.dart │ ├── high-scores │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── high_scores.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── high_scores_test.dart │ ├── house │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── house.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── house_test.dart │ ├── isbn-verifier │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── isbn_verifier.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── isbn_verifier_test.dart │ ├── isogram │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── isogram.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── isogram_test.dart │ ├── kindergarten-garden │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── kindergarten_garden.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── kindergarten_garden_test.dart │ ├── knapsack │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── knapsack.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── knapsack_test.dart │ ├── largest-series-product │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── largest_series_product.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── largest_series_product_test.dart │ ├── leap │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── leap.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── leap_test.dart │ ├── list-ops │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── list_ops.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── list_ops_test.dart │ ├── luhn │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── luhn.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── luhn_test.dart │ ├── matching-brackets │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── matching_brackets.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── matching_brackets_test.dart │ ├── meetup │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── meetup.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── meetup_test.dart │ ├── minesweeper │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── minesweeper.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── minesweeper_test.dart │ ├── nth-prime │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── nth_prime.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── nth_prime_test.dart │ ├── nucleotide-count │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── nucleotide_count.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── nucleotide_count_test.dart │ ├── pangram │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── pangram.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── pangram_test.dart │ ├── pascals-triangle │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── pascals_triangle.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── pascals_triangle_test.dart │ ├── perfect-numbers │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── lib │ │ │ └── perfect_numbers.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── perfect_numbers_test.dart │ ├── phone-number │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── phone_number.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── phone_number_test.dart │ ├── pig-latin │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── pig_latin.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── pig_latin_test.dart │ ├── prime-factors │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── prime_factors.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── prime_factors_test.dart │ ├── protein-translation │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── protein_translation.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── protein_translation_test.dart │ ├── proverb │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── proverb.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── proverb_test.dart │ ├── queen-attack │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── queen_attack.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── queen_attack_test.dart │ ├── raindrops │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── raindrops.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── raindrops_test.dart │ ├── relative-distance │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── relative_distance.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── relative_distance_test.dart │ ├── resistor-color-duo │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── resistor_color_duo.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── resistor_color_duo_test.dart │ ├── resistor-color-trio │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── resistor_color_trio.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── resistor_color_trio_test.dart │ ├── resistor-color │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── resistor_color.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── resistor_color_test.dart │ ├── reverse-string │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── reverse_string.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── reverse_string_test.dart │ ├── rna-transcription │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── rna_transcription.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── rna_transcription_test.dart │ ├── robot-simulator │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ ├── orientation.dart │ │ │ ├── position.dart │ │ │ └── robot_simulator.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── robot_simulator_test.dart │ ├── roman-numerals │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── roman_numerals.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── roman_numerals_test.dart │ ├── rotational-cipher │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── rotational_cipher.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── rotational_cipher_test.dart │ ├── run-length-encoding │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── run_length_encoding.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── run_length_encoding_test.dart │ ├── scrabble-score │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── scrabble_score.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── scrabble_score_test.dart │ ├── secret-handshake │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── secret_handshake.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── secret_handshake_test.dart │ ├── sieve │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── sieve.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── sieve_test.dart │ ├── space-age │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── space_age.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── space_age_test.dart │ ├── spiral-matrix │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── spiral_matrix.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── spiral_matrix_test.dart │ ├── square-root │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── square_root.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── square_root_test.dart │ ├── strain │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── lib │ │ │ └── strain.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── strain_test.dart │ ├── sublist │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── sublist.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── sublist_test.dart │ ├── sum-of-multiples │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── sum_of_multiples.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── sum_of_multiples_test.dart │ ├── triangle │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── triangle.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── triangle_test.dart │ ├── twelve-days │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── twelve_days.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── twelve_days_test.dart │ ├── two-bucket │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── two_bucket.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── two_bucket_test.dart │ ├── two-fer │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── canonical-data.json │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── two_fer.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── two_fer_test.dart │ ├── word-count │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ └── word_count.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── word_count_test.dart │ ├── yacht │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── lib │ │ │ │ └── example.dart │ │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ │ ├── categories.dart │ │ │ └── yacht.dart │ │ ├── pubspec.yaml │ │ └── test │ │ │ └── yacht_test.dart │ └── zebra-puzzle │ │ ├── .docs │ │ ├── instructions.md │ │ └── introduction.md │ │ ├── .meta │ │ ├── config.json │ │ ├── lib │ │ │ └── example.dart │ │ └── tests.toml │ │ ├── analysis_options.yaml │ │ ├── lib │ │ └── zebra_puzzle.dart │ │ ├── pubspec.yaml │ │ └── test │ │ └── zebra_puzzle_test.dart └── shared │ └── .docs │ ├── help.md │ └── tests.md ├── img └── .keep ├── lib └── src │ └── utils.dart ├── pubspec.lock ├── pubspec.yaml ├── reference └── implementing-a-concept-exercise.md └── test ├── create_exercise_test.dart └── exercises_test.dart /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Code owners 2 | .github/CODEOWNERS @exercism/maintainers-admin 3 | 4 | # Changes to `fetch-configlet` should be made in the `exercism/configlet` repo 5 | bin/fetch-configlet @exercism/maintainers-admin 6 | bin/fetch-configlet.ps1 @exercism/maintainers-admin 7 | 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | updates: 4 | 5 | # Keep dependencies for GitHub Actions up-to-date 6 | - package-ecosystem: 'github-actions' 7 | directory: '/' 8 | schedule: 9 | interval: 'monthly' 10 | -------------------------------------------------------------------------------- /.github/workflows/configlet.yml: -------------------------------------------------------------------------------- 1 | name: Configlet 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | workflow_dispatch: 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | configlet: 15 | uses: exercism/github-actions/.github/workflows/configlet.yml@main 16 | -------------------------------------------------------------------------------- /.github/workflows/pause-community-contributions.yml: -------------------------------------------------------------------------------- 1 | name: Pause Community Contributions 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | pull_request_target: 8 | types: 9 | - opened 10 | paths-ignore: 11 | - 'exercises/*/*/.approaches/**' 12 | - 'exercises/*/*/.articles/**' 13 | 14 | permissions: 15 | issues: write 16 | pull-requests: write 17 | 18 | jobs: 19 | pause: 20 | if: github.repository_owner == 'exercism' # Stops this job from running on forks 21 | uses: exercism/github-actions/.github/workflows/community-contributions.yml@main 22 | with: 23 | forum_category: dart 24 | secrets: 25 | github_membership_token: ${{ secrets.COMMUNITY_CONTRIBUTIONS_WORKFLOW_TOKEN }} 26 | -------------------------------------------------------------------------------- /.github/workflows/ping-cross-track-maintainers-team.yml: -------------------------------------------------------------------------------- 1 | name: Ping cross-track maintainers team 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | 8 | permissions: 9 | pull-requests: write 10 | 11 | jobs: 12 | ping: 13 | if: github.repository_owner == 'exercism' # Stops this job from running on forks 14 | uses: exercism/github-actions/.github/workflows/ping-cross-track-maintainers-team.yml@main 15 | secrets: 16 | github_membership_token: ${{ secrets.COMMUNITY_CONTRIBUTIONS_WORKFLOW_TOKEN }} 17 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yml: -------------------------------------------------------------------------------- 1 | name: Tools 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - .github/labels.yml 9 | - .github/workflows/sync-labels.yml 10 | workflow_dispatch: 11 | schedule: 12 | - cron: 0 0 1 * * # First day of each month 13 | 14 | permissions: 15 | issues: write 16 | 17 | jobs: 18 | sync-labels: 19 | uses: exercism/github-actions/.github/workflows/labels.yml@main 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | **/packages/ 3 | .buildlog 4 | .DS_Store 5 | .project 6 | bin/configlet 7 | bin/configlet.exe 8 | 9 | ### Dart ### 10 | # Directory created by dart tools 11 | /exercises/**/pubspec.lock 12 | .dart_tool/ 13 | .packages 14 | .pub/ 15 | build/ 16 | doc/ 17 | 18 | # Files created by dart2js 19 | *.dart.js 20 | *.part.js 21 | *.js.deps 22 | *.js.map 23 | *.info.json 24 | 25 | ## IDE files/folders 26 | /.idea/ 27 | /.vscode/ 28 | -------------------------------------------------------------------------------- /.lycheeignore: -------------------------------------------------------------------------------- 1 | https://www.reddit.com/r/dartlang 2 | -------------------------------------------------------------------------------- /bin/check_formatting.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:exercism_dart/src/utils.dart'; 3 | 4 | Future main() async { 5 | final CommonUtils utils = CommonUtils(); 6 | int errorCode = 0; 7 | 8 | print('Checking all Dart files formatting...'); 9 | errorCode = await utils 10 | .runCmd('dart', ['run', 'dart_style:format', '-i', '0', '-l', '120', '-n', '--set-exit-if-changed', '.']); 11 | 12 | if (errorCode != 0) { 13 | print('Checking exercise formatting failed!!'); 14 | await utils.terminate(); 15 | throw StateError('Formatting failed.'); 16 | } 17 | 18 | await utils.terminate(); 19 | } 20 | -------------------------------------------------------------------------------- /bin/presubmit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:exercism_dart/src/utils.dart'; 3 | 4 | Future main() async { 5 | final CommonUtils utils = CommonUtils(); 6 | 7 | if (await utils.fetchConfiglet() == 0) { 8 | print('Formatting config.json...'); 9 | print('Unsupported operation: Please see https://github.com/exercism/dart/issues/296'); 10 | // await utils.runCmdIfExecutable('bin/configlet', ['fmt', '.']); 11 | } 12 | 13 | print('Formatting all Dart files...'); 14 | await utils.runCmd('dart', ['run', 'dart_style:format', '-l', '120', '-w', '.']); 15 | 16 | print('Running tests...'); 17 | await utils.runCmd('dart', ['run', 'test']); 18 | 19 | await utils.terminate(); 20 | print('Done!'); 21 | } 22 | -------------------------------------------------------------------------------- /concepts/callbacks/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for callbacks concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/callbacks/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on callbacks concept 4 | -------------------------------------------------------------------------------- /concepts/callbacks/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: add introduction for callbacks concept 4 | -------------------------------------------------------------------------------- /concepts/callbacks/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/errors-basic/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for errors-basic concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/errors-basic/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on errors-basic concept 4 | -------------------------------------------------------------------------------- /concepts/errors-basic/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: add introduction for errors-basic concept 4 | -------------------------------------------------------------------------------- /concepts/errors-basic/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/futures/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for futures concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/futures/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on futures concept 4 | -------------------------------------------------------------------------------- /concepts/futures/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: the content below is copied from the exercise introduction and probably needs rewriting to a proper concept introduction 4 | 5 | ## futures 6 | -------------------------------------------------------------------------------- /concepts/futures/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/iterables-basic/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for iterables-basic concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/iterables-basic/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on iterables-basic concept 4 | -------------------------------------------------------------------------------- /concepts/iterables-basic/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: add introduction for iterables-basic concept 4 | -------------------------------------------------------------------------------- /concepts/iterables-basic/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/numbers-basic/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for numbers-basic concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/numbers-basic/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on numbers-basic concept 4 | -------------------------------------------------------------------------------- /concepts/numbers-basic/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: the content below is copied from the exercise introduction and probably needs rewriting to a proper concept introduction 4 | 5 | ## numbers-basic 6 | 7 | ## type-conversion 8 | -------------------------------------------------------------------------------- /concepts/numbers-basic/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/recursion/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for recursion concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/recursion/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on recursion concept 4 | -------------------------------------------------------------------------------- /concepts/recursion/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: add introduction for recursion concept 4 | -------------------------------------------------------------------------------- /concepts/recursion/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/strings-basic/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for strings-basic concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/strings-basic/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on strings-basic concept 4 | -------------------------------------------------------------------------------- /concepts/strings-basic/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Strings are useful for holding data that can be represented in text form. Some 4 | of the most-used operations on strings are to check their `length`, to build 5 | and concatenate them using the `+` and `+=` string operators, checking for the 6 | existence or location of substrings with the `indexOf()` method, or extracting 7 | substrings with the `substring()` method. 8 | -------------------------------------------------------------------------------- /concepts/strings-basic/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /concepts/type-conversion/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "TODO: add blurb for type-conversion concept", 3 | "authors": ["Stargator"], 4 | "contributors": [] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/type-conversion/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | TODO: add information on type-conversion concept 4 | -------------------------------------------------------------------------------- /concepts/type-conversion/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | TODO: the content below is copied from the exercise introduction and probably needs rewriting to a proper concept introduction 4 | 5 | ## numbers-basic 6 | 7 | ## type-conversion 8 | -------------------------------------------------------------------------------- /concepts/type-conversion/links.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /docs/INSTALLATION.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ## Installing Dart 4 | 5 | Instructions to install the Dart SDK can be found on the Dart website: [Get Dart][get-dart] 6 | 7 | ## Dart Plugin for your IDE or Editor 8 | 9 | If you are using an IDE or an editor, [add a Dart plugin][editors] if it exists for your editor of choice. 10 | 11 | [get-dart]: https://www.dart.dev/get-dart 12 | [editors]: https://www.dart.dev/tools#editors 13 | -------------------------------------------------------------------------------- /docs/RESOURCES.md: -------------------------------------------------------------------------------- 1 | # Useful Resources 2 | * [Dart API Documentation](https://api.dart.dev/) 3 | * [Dart Gitter Chat](https://gitter.im/dart-lang/home) 4 | * [Community Information](https://www.dart.dev/community) 5 | * [Stack Overflow](https://stackoverflow.com/questions/tagged/dart) 6 | * [Dart Subreddit](https://www.reddit.com/r/dartlang) 7 | * [Free Programming Books - Dart](https://github.com/EbookFoundation/free-programming-books/blob/main/books/free-programming-books-langs.md#dart) 8 | -------------------------------------------------------------------------------- /docs/SNIPPET.txt: -------------------------------------------------------------------------------- 1 | class HelloWorld { 2 | void main() { 3 | print("Hello World"); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/acronym/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Convert a phrase to its acronym. 4 | 5 | Techies love their TLA (Three Letter Acronyms)! 6 | 7 | Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG). 8 | 9 | Punctuation is handled as follows: hyphens are word separators (like whitespace); all other punctuation can be removed from the input. 10 | 11 | For example: 12 | 13 | | Input | Output | 14 | | ------------------------- | ------ | 15 | | As Soon As Possible | ASAP | 16 | | Liquid-crystal display | LCD | 17 | | Thank George It's Friday! | TGIF | 18 | -------------------------------------------------------------------------------- /exercises/practice/acronym/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Stargator" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/acronym.dart" 11 | ], 12 | "test": [ 13 | "test/acronym_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Convert a long phrase to its acronym.", 23 | "source": "Julien Vanier", 24 | "source_url": "https://github.com/monkbroc" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/acronym/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/acronym/lib/acronym.dart: -------------------------------------------------------------------------------- 1 | class Acronym { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/acronym/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'acronym' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/all-your-base/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You've just been hired as professor of mathematics. 4 | Your first week went well, but something is off in your second week. 5 | The problem is that every answer given by your students is wrong! 6 | Luckily, your math skills have allowed you to identify the problem: the student answers _are_ correct, but they're all in base 2 (binary)! 7 | Amazingly, it turns out that each week, the students use a different base. 8 | To help you quickly verify the student answers, you'll be building a tool to translate between bases. 9 | -------------------------------------------------------------------------------- /exercises/practice/all-your-base/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/all_your_base.dart" 8 | ], 9 | "test": [ 10 | "test/all_your_base_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Convert a number, represented as a sequence of digits in one base, to any other base." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/all-your-base/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/all-your-base/lib/all_your_base.dart: -------------------------------------------------------------------------------- 1 | class AllYourBase { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/all-your-base/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'all_your_base' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | 7 | -------------------------------------------------------------------------------- /exercises/practice/allergies/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Allergies { 2 | final substances = ['eggs', 'peanuts', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats']; 3 | 4 | bool allergicTo(String item, int score) { 5 | int index = substances.indexOf(item); 6 | return ((score >> index) & 1) == 1; 7 | } 8 | 9 | List list(int score) => substances.where((t) => allergicTo(t, score)).toList(); 10 | } 11 | -------------------------------------------------------------------------------- /exercises/practice/allergies/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/allergies/lib/allergies.dart: -------------------------------------------------------------------------------- 1 | class Allergies { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/allergies/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'allergies' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.docs/instructions.append.md: -------------------------------------------------------------------------------- 1 | # Instructions Append 2 | 3 | You must return the anagrams in the same order as they are listed in the candidate words. 4 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Stargator" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/anagram.dart" 11 | ], 12 | "test": [ 13 | "test/anagram_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Given a word and a list of possible anagrams, select the correct sublist.", 23 | "source": "Inspired by the Extreme Startup game", 24 | "source_url": "https://github.com/rchatley/extreme_startup" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/anagram/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | 20 | # Style rules 21 | - directives_ordering 22 | -------------------------------------------------------------------------------- /exercises/practice/anagram/lib/anagram.dart: -------------------------------------------------------------------------------- 1 | class Anagram { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/anagram/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'anagram' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | An [Armstrong number][armstrong-number] is a number that is the sum of its own digits each raised to the power of the number of digits. 4 | 5 | For example: 6 | 7 | - 9 is an Armstrong number, because `9 = 9^1 = 9` 8 | - 10 is _not_ an Armstrong number, because `10 != 1^2 + 0^2 = 1` 9 | - 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153` 10 | - 154 is _not_ an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190` 11 | 12 | Write some code to determine whether a number is an Armstrong number. 13 | 14 | [armstrong-number]: https://en.wikipedia.org/wiki/Narcissistic_number 15 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Stargator" 4 | ], 5 | "contributors": [ 6 | "amscotti", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/armstrong_numbers.dart" 12 | ], 13 | "test": [ 14 | "test/armstrong_numbers_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Determine if a number is an Armstrong number.", 24 | "source": "Wikipedia", 25 | "source_url": "https://en.wikipedia.org/wiki/Narcissistic_number" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class ArmstrongNumbers { 2 | /// The parameters and variables within the method that are set to final in order to prevent the accidentally modification of the value. 3 | /// As those variables are not needed to be changed. 4 | bool isArmstrongNumber(final String input) { 5 | final numOfDigits = input.length; 6 | var sum = BigInt.from(0); 7 | 8 | for (var count = 0; count < numOfDigits; count++) { 9 | final digitAsString = input.substring(count, count + 1); 10 | final digit = BigInt.parse(digitAsString); 11 | sum += digit.pow(numOfDigits); 12 | } 13 | 14 | return input == sum.toString(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/lib/armstrong_numbers.dart: -------------------------------------------------------------------------------- 1 | class ArmstrongNumbers { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'armstrong_numbers' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/atbash_cipher.dart" 8 | ], 9 | "test": [ 10 | "test/atbash_cipher_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Atbash" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/lib/atbash_cipher.dart: -------------------------------------------------------------------------------- 1 | class AtbashCipher { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'atbash_cipher' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Zureka" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/beer_song.dart" 8 | ], 9 | "test": [ 10 | "test/beer_song_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.", 20 | "source": "Learn to Program by Chris Pine", 21 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=06" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/lib/beer_song.dart: -------------------------------------------------------------------------------- 1 | class BeerSong { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'beer_song' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/binary-search-tree/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "devkabiir" 4 | ], 5 | "contributors": [ 6 | "amscotti", 7 | "Stargator" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/binary_search_tree.dart" 12 | ], 13 | "test": [ 14 | "test/binary_search_tree_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Insert and search for numbers in a binary tree.", 24 | "source": "Josh Cheek" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/binary-search-tree/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/binary-search-tree/lib/binary_search_tree.dart: -------------------------------------------------------------------------------- 1 | class BinarySearchTree { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/binary-search-tree/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'binary_search_tree' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/binary_search.dart" 8 | ], 9 | "test": [ 10 | "test/binary_search_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "editor": [ 16 | "lib/value_not_found_exception.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Implement a binary search algorithm.", 23 | "source": "Wikipedia", 24 | "source_url": "https://en.wikipedia.org/wiki/Binary_search_algorithm" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | import 'package:binary_search/value_not_found_exception.dart'; 2 | 3 | class BinarySearch { 4 | List items; 5 | 6 | BinarySearch(this.items); 7 | 8 | int find(int item) { 9 | int i = 0, j = items.length - 1; 10 | while (i <= j) { 11 | int mid = (i + j) ~/ 2; 12 | if (item == items[mid]) { 13 | return mid; 14 | } else if (item < items[mid]) { 15 | j = mid - 1; 16 | } else { 17 | i = mid + 1; 18 | } 19 | } 20 | throw ValueNotFoundException("foo bar"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/lib/binary_search.dart: -------------------------------------------------------------------------------- 1 | import 'package:binary_search/value_not_found_exception.dart'; 2 | 3 | class BinarySearch { 4 | // Your code here. 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/lib/value_not_found_exception.dart: -------------------------------------------------------------------------------- 1 | class ValueNotFoundException implements Exception { 2 | String message; 3 | ValueNotFoundException(this.message); 4 | } 5 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'binary_search' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/bob/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Bob is a [lackadaisical][] teenager. 4 | He likes to think that he's very cool. 5 | And he definitely doesn't get excited about things. 6 | That wouldn't be cool. 7 | 8 | When people talk to him, his responses are pretty limited. 9 | 10 | [lackadaisical]: https://www.collinsdictionary.com/dictionary/english/lackadaisical 11 | -------------------------------------------------------------------------------- /exercises/practice/bob/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SuperPaintman" 4 | ], 5 | "contributors": [ 6 | "camuthig", 7 | "kytrinyx", 8 | "Stargator" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "lib/bob.dart" 13 | ], 14 | "test": [ 15 | "test/bob_test.dart" 16 | ], 17 | "example": [ 18 | ".meta/lib/example.dart" 19 | ], 20 | "invalidator": [ 21 | "pubspec.yaml" 22 | ] 23 | }, 24 | "blurb": "Bob is a lackadaisical teenager. In conversation, his responses are very limited.", 25 | "source": "Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial.", 26 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=06" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/bob/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/bob/lib/bob.dart: -------------------------------------------------------------------------------- 1 | class Bob { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/bob/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'bob' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/bottle-song/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/bottle_song.dart" 8 | ], 9 | "test": [ 10 | "test/bottle_song_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ] 15 | }, 16 | "blurb": "Produce the lyrics to the popular children's repetitive song: Ten Green Bottles.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Ten_Green_Bottles" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/bottle-song/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/bottle-song/lib/bottle_song.dart: -------------------------------------------------------------------------------- 1 | class BottleSong { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/bottle-song/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'bottle_song' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/circular-buffer/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/circular_buffer.dart" 8 | ], 9 | "test": [ 10 | "test/circular_buffer_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "A data structure that uses a single, fixed-size buffer as if it were connected end-to-end.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Circular_buffer" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/circular-buffer/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class EmptyBufferException implements Exception {} 2 | 3 | class FullBufferException implements Exception {} 4 | 5 | class CircularBuffer { 6 | final int size; 7 | final List data = []; 8 | CircularBuffer(this.size); 9 | 10 | int read() { 11 | if (data.isEmpty) throw EmptyBufferException(); 12 | return data.removeAt(0); 13 | } 14 | 15 | void write(int value, {bool force = false}) { 16 | if (size == data.length) { 17 | if (force) { 18 | read(); 19 | } else { 20 | throw FullBufferException(); 21 | } 22 | } 23 | data.add(value); 24 | } 25 | 26 | void clear() { 27 | data.clear(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /exercises/practice/circular-buffer/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/circular-buffer/lib/circular_buffer.dart: -------------------------------------------------------------------------------- 1 | /* These implementation definitions enable zero-argument contructors: 2 | * throw EmptyBufferException(); 3 | */ 4 | 5 | class EmptyBufferException implements Exception {} 6 | 7 | class FullBufferException implements Exception {} 8 | 9 | class CircularBuffer { 10 | // Put your code here 11 | } 12 | -------------------------------------------------------------------------------- /exercises/practice/circular-buffer/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'circular_buffer' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a positive integer, return the number of steps it takes to reach 1 according to the rules of the Collatz Conjecture. 4 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/collatz_conjecture.dart" 11 | ], 12 | "test": [ 13 | "test/collatz_conjecture_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Calculate the number of steps to reach 1 using the Collatz conjecture.", 23 | "source": "Wikipedia", 24 | "source_url": "https://en.wikipedia.org/wiki/Collatz_conjecture" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class CollatzConjecture { 2 | int steps(int input) { 3 | if (input < 1) { 4 | throw new ArgumentError('Only positive integers are allowed'); 5 | } 6 | 7 | int n = input; 8 | int steps = 0; 9 | while (n != 1) { 10 | if (n % 2 == 0) { 11 | n = n ~/ 2; 12 | } else { 13 | n = 3 * n + 1; 14 | } 15 | steps += 1; 16 | } 17 | 18 | return steps; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/lib/collatz_conjecture.dart: -------------------------------------------------------------------------------- 1 | class CollatzConjecture { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'collatz_conjecture' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/darts/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/darts.dart" 11 | ], 12 | "test": [ 13 | "test/darts_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Calculate the points scored in a single toss of a Darts game.", 23 | "source": "Inspired by an exercise created by a professor Della Paolera in Argentina" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/darts/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class Darts { 4 | int score(num x, num y) { 5 | final distanceToDart = sqrt(x * x + y * y); 6 | 7 | if (distanceToDart > 10) return 0; 8 | if (distanceToDart > 5) return 1; 9 | if (distanceToDart > 1) return 5; 10 | return 10; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /exercises/practice/darts/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/darts/lib/darts.dart: -------------------------------------------------------------------------------- 1 | class Darts { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/darts/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'darts' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/diamond/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jvarness" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "Zureka", 8 | "kytrinyx" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "lib/diamond.dart" 13 | ], 14 | "test": [ 15 | "test/diamond_test.dart" 16 | ], 17 | "example": [ 18 | ".meta/lib/example.dart" 19 | ], 20 | "invalidator": [ 21 | "pubspec.yaml" 22 | ] 23 | }, 24 | "blurb": "Given a letter, print a diamond starting with 'A' with the supplied letter at the widest point.", 25 | "source": "Seb Rose", 26 | "source_url": "https://web.archive.org/web/20220807163751/http://claysnow.co.uk/recycling-tests-in-tdd/" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/diamond/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/diamond/lib/diamond.dart: -------------------------------------------------------------------------------- 1 | class Diamond { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/diamond/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'diamond' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SuperPaintman" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/difference_of_squares.dart" 12 | ], 13 | "test": [ 14 | "test/difference_of_squares_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.", 24 | "source": "Problem 6 at Project Euler", 25 | "source_url": "https://projecteuler.net/problem=6" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | import "dart:math" show pow; 2 | 3 | class DifferenceOfSquares { 4 | int squareOfSum(int input) => pow(_sum(input), 2).toInt(); 5 | 6 | int sumOfSquares(int input) => _range(input).map((i) => pow(i, 2).toInt()).reduce((r, i) => r + i); 7 | 8 | int differenceOfSquares(int input) => squareOfSum(input) - sumOfSquares(input); 9 | 10 | num _sum(int input) => input * (input + 1) ~/ 2; 11 | 12 | List _range(int length) => new List.generate(length, (i) => i + 1); 13 | } 14 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/lib/difference_of_squares.dart: -------------------------------------------------------------------------------- 1 | class DifferenceOfSquares { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'difference_of_squares' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/dnd-character/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/dnd_character.dart" 8 | ], 9 | "test": [ 10 | "test/dnd_character_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Randomly generate Dungeons & Dragons characters.", 20 | "source": "Simon Shine, Erik Schierboom", 21 | "source_url": "https://github.com/exercism/problem-specifications/issues/616#issuecomment-437358945" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/dnd-character/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/dnd-character/lib/dnd_character.dart: -------------------------------------------------------------------------------- 1 | class DndCharacter { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/dnd-character/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'dnd_character' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to count the number of 1 bits in the binary representation of a number. 4 | 5 | ## Restrictions 6 | 7 | Keep your hands off that bit-count functionality provided by your standard library! 8 | Solve this one yourself using other basic tools instead. 9 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/eliuds_eggs.dart" 8 | ], 9 | "test": [ 10 | "test/eliuds_eggs_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Help Eliud count the number of eggs in her chicken coop by counting the number of 1 bits in a binary representation.", 20 | "source": "Christian Willner, Eric Willigers", 21 | "source_url": "https://forum.exercism.org/t/new-exercise-suggestion-pop-count/7632/5" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class EggCounter { 2 | int count(int number) { 3 | int count = 0; 4 | while (number > 0) { 5 | count += number & 1; 6 | number >>= 1; 7 | } 8 | return count; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/lib/eliuds_eggs.dart: -------------------------------------------------------------------------------- 1 | class EggCounter { 2 | // Your code goes here. 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'eliuds_eggs' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/test/eliuds_eggs_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:eliuds_eggs/eliuds_eggs.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | final egg_counter = EggCounter(); 6 | 7 | test("0 eggs", () { 8 | expect(egg_counter.count(0), equals(0)); 9 | }, skip: false); 10 | 11 | test("1 egg", () { 12 | expect(egg_counter.count(16), equals(1)); 13 | }, skip: false); 14 | 15 | test("4 eggs", () { 16 | expect(egg_counter.count(89), equals(4)); 17 | }, skip: false); 18 | 19 | test("13 eggs", () { 20 | expect(egg_counter.count(2000000000), equals(13)); 21 | }, skip: false); 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/etl/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/etl.dart" 8 | ], 9 | "test": [ 10 | "test/etl_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Change the data format for scoring a game to more easily add other languages.", 20 | "source": "Based on an exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 21 | "source_url": "https://turing.edu" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/etl/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Etl { 2 | Map transform(Map> legacy) { 3 | final result = {}; 4 | 5 | for (final entry in legacy.entries) { 6 | final score = int.parse(entry.key); 7 | for (final letter in entry.value) { 8 | result[letter.toLowerCase()] = score; 9 | } 10 | } 11 | return result; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /exercises/practice/etl/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/etl/lib/etl.dart: -------------------------------------------------------------------------------- 1 | class Etl { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/etl/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'etl' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/food-chain/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/food_chain.dart" 8 | ], 9 | "test": [ 10 | "test/food_chain_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Generate the lyrics of the song 'I Know an Old Lady Who Swallowed a Fly'.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/food-chain/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/food-chain/lib/food_chain.dart: -------------------------------------------------------------------------------- 1 | class FoodChain { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/food-chain/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'food_chain' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/forth/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "matthewmorgan" 4 | ], 5 | "contributors": [ 6 | "AlexeyBukin", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/forth.dart" 12 | ], 13 | "test": [ 14 | "test/forth_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Implement an evaluator for a very simple subset of Forth." 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/forth/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/forth/lib/forth.dart: -------------------------------------------------------------------------------- 1 | class Forth { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/forth/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'forth' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/game-of-life/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | After each generation, the cells interact with their eight neighbors, which are cells adjacent horizontally, vertically, or diagonally. 4 | 5 | The following rules are applied to each cell: 6 | 7 | - Any live cell with two or three live neighbors lives on. 8 | - Any dead cell with exactly three live neighbors becomes a live cell. 9 | - All other cells die or stay dead. 10 | 11 | Given a matrix of 1s and 0s (corresponding to live and dead cells), apply the rules to each cell, and return the next generation. 12 | -------------------------------------------------------------------------------- /exercises/practice/game-of-life/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | [Conway's Game of Life][game-of-life] is a fascinating cellular automaton created by the British mathematician John Horton Conway in 1970. 4 | 5 | The game consists of a two-dimensional grid of cells that can either be "alive" or "dead." 6 | 7 | After each generation, the cells interact with their eight neighbors via a set of rules, which define the new generation. 8 | 9 | [game-of-life]: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life 10 | -------------------------------------------------------------------------------- /exercises/practice/game-of-life/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/game_of_life.dart" 8 | ], 9 | "test": [ 10 | "test/game_of_life_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ] 15 | }, 16 | "blurb": "Implement Conway's Game of Life.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/game-of-life/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/game-of-life/lib/game_of_life.dart: -------------------------------------------------------------------------------- 1 | class GameOfLife { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/game-of-life/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'game_of_life' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to determine the date and time one gigasecond after a certain date. 4 | 5 | A gigasecond is one thousand million seconds. 6 | That is a one with nine zeros after it. 7 | 8 | If you were born on _January 24th, 2015 at 22:00 (10:00:00pm)_, then you would be a gigasecond old on _October 2nd, 2046 at 23:46:40 (11:46:40pm)_. 9 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | DateTime addGigasecondTo(final DateTime moment) { 2 | return moment.add(Duration(seconds: 1000000000)); 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/lib/gigasecond.dart: -------------------------------------------------------------------------------- 1 | DateTime addGigasecondTo(final DateTime dateTime) { 2 | // Replace the throw call and put your code here 3 | throw UnimplementedError(); 4 | } 5 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'gigasecond' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/grade-school/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/grade_school.dart" 8 | ], 9 | "test": [ 10 | "test/grade_school_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given students' names along with the grade that they are in, create a roster for the school.", 20 | "source": "A pairing session with Phil Battos at gSchool" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/practice/grade-school/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/grade-school/lib/grade_school.dart: -------------------------------------------------------------------------------- 1 | class GradeSchool { 2 | // your code here ... 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/grade-school/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'grade_school' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/grains/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Calculate the number of grains of wheat on a chessboard. 4 | 5 | A chessboard has 64 squares. 6 | Square 1 has one grain, square 2 has two grains, square 3 has four grains, and so on, doubling each time. 7 | 8 | Write code that calculates: 9 | 10 | - the number of grains on a given square 11 | - the total number of grains on the chessboard 12 | -------------------------------------------------------------------------------- /exercises/practice/grains/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | There once was a wise servant who saved the life of a prince. 4 | The king promised to pay whatever the servant could dream up. 5 | Knowing that the king loved chess, the servant told the king he would like to have grains of wheat. 6 | One grain on the first square of a chessboard, with the number of grains doubling on each successive square. 7 | -------------------------------------------------------------------------------- /exercises/practice/grains/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/grains.dart" 8 | ], 9 | "test": [ 10 | "test/grains_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.", 20 | "source": "The CodeRanch Cattle Drive, Assignment 6", 21 | "source_url": "https://web.archive.org/web/20240908084142/https://coderanch.com/wiki/718824/Grains" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/grains/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | BigInt square(final int n) { 2 | if (1 > n || n > 64) { 3 | throw new ArgumentError("square must be between 1 and 64"); 4 | } 5 | 6 | return BigInt.from(2).pow(n - 1); 7 | } 8 | 9 | BigInt total() { 10 | return BigInt.from(2).pow(64) - BigInt.from(1); 11 | } 12 | -------------------------------------------------------------------------------- /exercises/practice/grains/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/grains/lib/grains.dart: -------------------------------------------------------------------------------- 1 | BigInt square(final int n) { 2 | // Replace the throw call and put your code here 3 | throw UnimplementedError(); 4 | } 5 | 6 | BigInt total() { 7 | // Replace the throw call and put your code here 8 | throw UnimplementedError(); 9 | } 10 | -------------------------------------------------------------------------------- /exercises/practice/grains/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'grains' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Calculate the Hamming distance between two DNA strands. 4 | 5 | We read DNA using the letters C, A, G and T. 6 | Two strands might look like this: 7 | 8 | GAGCCTACTAACGGGAT 9 | CATCGTAATGACGGCCT 10 | ^ ^ ^ ^ ^ ^^ 11 | 12 | They have 7 differences, and therefore the Hamming distance is 7. 13 | 14 | ## Implementation notes 15 | 16 | The Hamming distance is only defined for sequences of equal length, so an attempt to calculate it between sequences of different lengths should not work. 17 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SuperPaintman" 4 | ], 5 | "contributors": [ 6 | "jerold", 7 | "Stargator", 8 | "kytrinyx" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "lib/hamming.dart" 13 | ], 14 | "test": [ 15 | "test/hamming_test.dart" 16 | ], 17 | "example": [ 18 | ".meta/lib/example.dart" 19 | ], 20 | "invalidator": [ 21 | "pubspec.yaml" 22 | ] 23 | }, 24 | "blurb": "Calculate the Hamming distance between two DNA strands.", 25 | "source": "The Calculating Point Mutations problem at Rosalind", 26 | "source_url": "https://rosalind.info/problems/hamm/" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Hamming { 2 | int distance(String a, String b) { 3 | if (a.length != b.length) { 4 | throw ArgumentError('strands must be of equal length'); 5 | } 6 | 7 | int diff = 0; 8 | 9 | for (int i = 0; i < a.length; i++) { 10 | if (a[i] != b[i]) { 11 | diff++; 12 | } 13 | } 14 | 15 | return diff; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/hamming/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/hamming/lib/hamming.dart: -------------------------------------------------------------------------------- 1 | class Hamming { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/hamming/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'hamming' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | The classical introductory exercise. 4 | Just say "Hello, World!". 5 | 6 | ["Hello, World!"][hello-world] is the traditional first program for beginning programming in a new language or environment. 7 | 8 | The objectives are simple: 9 | 10 | - Modify the provided code so that it produces the string "Hello, World!". 11 | - Run the test suite and make sure that it succeeds. 12 | - Submit your solution and check it at the website. 13 | 14 | If everything goes well, you will be ready to fetch your first real exercise. 15 | 16 | [hello-world]: https://en.wikipedia.org/wiki/%22Hello,_world!%22_program 17 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SuperPaintman" 4 | ], 5 | "contributors": [ 6 | "rafaelalvessa", 7 | "Stargator" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/hello_world.dart" 12 | ], 13 | "test": [ 14 | "test/hello_world_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Exercism's classic introductory exercise. Just say \"Hello, World!\".", 24 | "source": "This is an exercise to introduce users to using Exercism", 25 | "source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class HelloWorld { 2 | String hello() { 3 | return "Hello, World!"; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.meta/tests.toml: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file. Regular comments will be removed when this 2 | # file is regenerated. Regenerating will not touch any manually added keys, 3 | # so comments can be added in a "comment" key. 4 | 5 | [af9ffe10-dc13-42d8-a742-e7bdafac449d] 6 | description = "Say Hi!" 7 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | exclude: 3 | - lib/hello_world.dart 4 | strong-mode: 5 | implicit-casts: false 6 | implicit-dynamic: false 7 | errors: 8 | unused_element: error 9 | unused_import: error 10 | unused_local_variable: error 11 | dead_code: error 12 | 13 | linter: 14 | rules: 15 | # Error Rules 16 | - avoid_relative_lib_imports 17 | - avoid_types_as_parameter_names 18 | - literal_only_boolean_expressions 19 | - no_adjacent_strings_in_list 20 | - valid_regexps 21 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/lib/hello_world.dart: -------------------------------------------------------------------------------- 1 | class HelloWorld { 2 | String hello() { 3 | return "Goodbye, Mars!"; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'hello_world' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/test/hello_world_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:hello_world/hello_world.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | test('Say Hi!', () { 6 | expect(HelloWorld().hello(), equals('Hello, World!')); 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Manage a game player's High Score list. 4 | 5 | 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. 6 | Your task is to write methods that return the highest score from the list, the last added score and the three highest scores. 7 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Stargator" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/high_scores.dart" 11 | ], 12 | "test": [ 13 | "test/high_scores_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Manage a player's High Score list.", 23 | "source": "Tribute to the eighties' arcade game Frogger" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/lib/high_scores.dart: -------------------------------------------------------------------------------- 1 | class HighScores { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'high_scores' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/house/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/house.dart" 8 | ], 9 | "test": [ 10 | "test/house_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ] 15 | }, 16 | "blurb": "Output the nursery rhyme 'This is the House that Jack Built'.", 17 | "source": "British nursery rhyme", 18 | "source_url": "https://en.wikipedia.org/wiki/This_Is_The_House_That_Jack_Built" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/house/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/house/lib/house.dart: -------------------------------------------------------------------------------- 1 | class House { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/house/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'house' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/isbn-verifier/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | final RegExp _formatChecker = new RegExp(r'^\d-?\d{3}-?\d{5}-?[\dX]$'); 2 | final RegExp _cleaner = new RegExp(r'\W'); 3 | 4 | bool isValid(String isbn) { 5 | if (!_formatChecker.hasMatch(isbn)) { 6 | return false; 7 | } 8 | 9 | String clean = isbn.replaceAll(_cleaner, ''); 10 | 11 | int checkSum = 0; 12 | clean.split('').toList().asMap().forEach((index, c) { 13 | checkSum += c == 'X' ? 10 : int.parse(c) * (10 - index); 14 | }); 15 | 16 | return checkSum % 11 == 0; 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/isbn-verifier/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/isbn-verifier/lib/isbn_verifier.dart: -------------------------------------------------------------------------------- 1 | // Put your code here 2 | -------------------------------------------------------------------------------- /exercises/practice/isbn-verifier/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'isbn_verifier' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/isogram/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Determine if a word or phrase is an isogram. 4 | 5 | An isogram (also known as a "non-pattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. 6 | 7 | Examples of isograms: 8 | 9 | - lumberjacks 10 | - background 11 | - downstream 12 | - six-year-old 13 | 14 | The word _isograms_, however, is not an isogram, because the s repeats. 15 | -------------------------------------------------------------------------------- /exercises/practice/isogram/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jvarness" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/isogram.dart" 11 | ], 12 | "test": [ 13 | "test/isogram_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Determine if a word or phrase is an isogram.", 23 | "source": "Wikipedia", 24 | "source_url": "https://en.wikipedia.org/wiki/Isogram" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/isogram/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/isogram/lib/isogram.dart: -------------------------------------------------------------------------------- 1 | class Isogram { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/isogram/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'isogram' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | The kindergarten class is learning about growing plants. 4 | The teacher thought it would be a good idea to give the class seeds to plant and grow in the dirt. 5 | To this end, the children have put little cups along the window sills and planted one type of plant in each cup. 6 | The children got to pick their favorites from four available types of seeds: grass, clover, radishes, and violets. 7 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/kindergarten_garden.dart" 8 | ], 9 | "test": [ 10 | "test/kindergarten_garden_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given a diagram, determine which plants each child in the kindergarten class is responsible for.", 20 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 21 | "source_url": "https://turing.edu" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/lib/kindergarten_garden.dart: -------------------------------------------------------------------------------- 1 | enum Plant { 2 | radishes, 3 | clover, 4 | violets, 5 | grass, 6 | } 7 | 8 | enum Student { 9 | Alice, 10 | Bob, 11 | Charlie, 12 | David, 13 | Eve, 14 | Fred, 15 | Ginny, 16 | Harriet, 17 | Ileana, 18 | Joseph, 19 | Kincaid, 20 | Larry, 21 | } 22 | 23 | class KindergartenGarden { 24 | // your code here 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'kindergarten_garden' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Lhakpa is a [Sherpa][sherpa] mountain guide and porter. 4 | After months of careful planning, the expedition Lhakpa works for is about to leave. 5 | She will be paid the value she carried to the base camp. 6 | 7 | In front of her are many items, each with a value and weight. 8 | Lhakpa would gladly take all of the items, but her knapsack can only hold so much weight. 9 | 10 | [sherpa]: https://en.wikipedia.org/wiki/Sherpa_people#Mountaineering 11 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/knapsack.dart" 8 | ], 9 | "test": [ 10 | "test/knapsack_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given a knapsack that can only carry a certain weight, determine which items to put in the knapsack in order to maximize their combined value.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Knapsack_problem" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | typedef Item = ({int weight, int value}); 4 | 5 | class Knapsack { 6 | final int maxWeight; 7 | Knapsack({required this.maxWeight}); 8 | 9 | int maxValue(List items) { 10 | var table = List.filled(maxWeight + 1, 0); 11 | for (var item in items) { 12 | if (item.weight <= maxWeight) { 13 | for (var w = maxWeight; w >= item.weight; w--) { 14 | table[w] = max(table[w], table[w - item.weight] + item.value); 15 | } 16 | } 17 | } 18 | return table.last; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/lib/knapsack.dart: -------------------------------------------------------------------------------- 1 | typedef Item = ({int weight, int value}); 2 | 3 | class Knapsack { 4 | // your code here ... 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'knapsack' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/largest-series-product/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You work for a government agency that has intercepted a series of encrypted communication signals from a group of bank robbers. 4 | The signals contain a long sequence of digits. 5 | Your team needs to use various digital signal processing techniques to analyze the signals and identify any patterns that may indicate the planning of a heist. 6 | -------------------------------------------------------------------------------- /exercises/practice/largest-series-product/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/largest_series_product.dart" 8 | ], 9 | "test": [ 10 | "test/largest_series_product_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given a string of digits, calculate the largest product for a contiguous substring of digits of length n.", 20 | "source": "A variation on Problem 8 at Project Euler", 21 | "source_url": "https://projecteuler.net/problem=8" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/largest-series-product/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/largest-series-product/lib/largest_series_product.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class LargestSeriesProduct { 4 | // Your code here. 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/largest-series-product/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'largest_series_product' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | 7 | -------------------------------------------------------------------------------- /exercises/practice/leap/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to determine whether a given year is a leap year. 4 | -------------------------------------------------------------------------------- /exercises/practice/leap/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | A leap year (in the Gregorian calendar) occurs: 4 | 5 | - In every year that is evenly divisible by 4. 6 | - Unless the year is evenly divisible by 100, in which case it's only a leap year if the year is also evenly divisible by 400. 7 | 8 | Some examples: 9 | 10 | - 1997 was not a leap year as it's not divisible by 4. 11 | - 1900 was not a leap year as it's not divisible by 400. 12 | - 2000 was a leap year! 13 | 14 | ~~~~exercism/note 15 | For a delightful, four-minute explanation of the whole phenomenon of leap years, check out [this YouTube video](https://www.youtube.com/watch?v=xX96xng7sAE). 16 | ~~~~ 17 | -------------------------------------------------------------------------------- /exercises/practice/leap/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SuperPaintman" 4 | ], 5 | "contributors": [ 6 | "jvarness", 7 | "Stargator", 8 | "kytrinyx" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "lib/leap.dart" 13 | ], 14 | "test": [ 15 | "test/leap_test.dart" 16 | ], 17 | "example": [ 18 | ".meta/lib/example.dart" 19 | ], 20 | "invalidator": [ 21 | "pubspec.yaml" 22 | ] 23 | }, 24 | "blurb": "Determine whether a given year is a leap year.", 25 | "source": "CodeRanch Cattle Drive, Assignment 3", 26 | "source_url": "https://web.archive.org/web/20240907033714/https://coderanch.com/t/718816/Leap" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/leap/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Leap { 2 | bool leapYear(int year) { 3 | if (year % 4 != 0) { 4 | return false; 5 | } 6 | 7 | return year % 100 != 0 || year % 400 == 0; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/practice/leap/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/leap/lib/leap.dart: -------------------------------------------------------------------------------- 1 | class Leap { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/leap/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'leap' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/list-ops/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/list_ops.dart" 8 | ], 9 | "test": [ 10 | "test/list_ops_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Implement basic list operations." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/list-ops/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/list-ops/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'list_ops' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/luhn/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/luhn.dart" 11 | ], 12 | "test": [ 13 | "test/luhn_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Given a number determine whether or not it is valid per the Luhn formula.", 23 | "source": "The Luhn Algorithm on Wikipedia", 24 | "source_url": "https://en.wikipedia.org/wiki/Luhn_algorithm" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/luhn/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Luhn { 2 | bool valid(String value) { 3 | String clean = value.replaceAll(new RegExp(r'\s'), ''); 4 | 5 | if (clean.length <= 1 || clean.contains(new RegExp(r'\D'))) { 6 | return false; 7 | } 8 | 9 | int doubleEverySecond = 0; 10 | 11 | clean.split('').reversed.map(int.parse).toList().asMap().forEach((index, number) { 12 | int b = index.isOdd ? number * 2 : number; 13 | doubleEverySecond += b > 9 ? b - 9 : b; 14 | }); 15 | 16 | return doubleEverySecond % 10 == 0; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/luhn/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/luhn/lib/luhn.dart: -------------------------------------------------------------------------------- 1 | class Luhn { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/luhn/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'luhn' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched and nested correctly. 4 | Any other characters should be ignored. 5 | For example, `"{what is (42)}?"` is balanced and `"[text}"` is not. 6 | -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You're given the opportunity to write software for the Bracketeer™, an ancient but powerful mainframe. 4 | The software that runs on it is written in a proprietary language. 5 | Much of its syntax is familiar, but you notice _lots_ of brackets, braces and parentheses. 6 | Despite the Bracketeer™ being powerful, it lacks flexibility. 7 | If the source code has any unbalanced brackets, braces or parentheses, the Bracketeer™ crashes and must be rebooted. 8 | To avoid such a scenario, you start writing code that can verify that brackets, braces, and parentheses are balanced before attempting to run it on the Bracketeer™. 9 | -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "johnngugi" 4 | ], 5 | "contributors": [ 6 | "amscotti", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/matching_brackets.dart" 12 | ], 13 | "test": [ 14 | "test/matching_brackets_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Make sure the brackets and braces all match.", 24 | "source": "Ginna Baker" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/lib/matching_brackets.dart: -------------------------------------------------------------------------------- 1 | class MatchingBrackets { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'matching_brackets' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/meetup/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | There are some tests that can trip you up with daylight saving time. 4 | If you are creating a DateTime object, you should set it in the UTC time zone. 5 | -------------------------------------------------------------------------------- /exercises/practice/meetup/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/meetup.dart" 8 | ], 9 | "test": [ 10 | "test/meetup_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Calculate the date of meetups.", 20 | "source": "Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/practice/meetup/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/meetup/lib/meetup.dart: -------------------------------------------------------------------------------- 1 | class Meetup { 2 | // your code here... 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/meetup/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'meetup' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | [Minesweeper][wikipedia] is a popular game where the user has to find the mines using numeric hints that indicate how many mines are directly adjacent (horizontally, vertically, diagonally) to a square. 4 | 5 | [wikipedia]: https://en.wikipedia.org/wiki/Minesweeper_(video_game) 6 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "devkabiir" 4 | ], 5 | "contributors": [ 6 | "sisminnmaw", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/minesweeper.dart" 12 | ], 13 | "test": [ 14 | "test/minesweeper_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Add the numbers to a minesweeper board." 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/lib/minesweeper.dart: -------------------------------------------------------------------------------- 1 | class Minesweeper { 2 | // Put your code here. 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'minesweeper' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a number n, determine what the nth prime is. 4 | 5 | By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. 6 | 7 | If your language provides methods in the standard library to deal with prime numbers, pretend they don't exist and implement them yourself. 8 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/nth_prime.dart" 11 | ], 12 | "test": [ 13 | "test/nth_prime_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Given a number n, determine what the nth prime is.", 23 | "source": "A variation on Problem 7 at Project Euler", 24 | "source_url": "https://projecteuler.net/problem=7" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/.meta/tests.toml: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file. Regular comments will be removed when this 2 | # file is regenerated. Regenerating will not touch any manually added keys, 3 | # so comments can be added in a "comment" key. 4 | 5 | [75c65189-8aef-471a-81de-0a90c728160c] 6 | description = "first prime" 7 | 8 | [2c38804c-295f-4701-b728-56dea34fd1a0] 9 | description = "second prime" 10 | 11 | [56692534-781e-4e8c-b1f9-3e82c1640259] 12 | description = "sixth prime" 13 | 14 | [fce1e979-0edb-412d-93aa-2c744e8f50ff] 15 | description = "big prime" 16 | 17 | [bd0a9eae-6df7-485b-a144-80e13c7d55b2] 18 | description = "there is no zeroth prime" 19 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/lib/nth_prime.dart: -------------------------------------------------------------------------------- 1 | class NthPrime { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'nth_prime' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/nucleotide_count.dart" 8 | ], 9 | "test": [ 10 | "test/nucleotide_count_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given a DNA string, compute how many times each nucleotide occurs in the string.", 20 | "source": "The Calculating DNA Nucleotides_problem at Rosalind", 21 | "source_url": "https://rosalind.info/problems/dna/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class InvalidNucleotideException implements Exception {} 2 | 3 | class NucleotideCount { 4 | Map count(String strand) { 5 | final result = {"A": 0, "C": 0, "G": 0, "T": 0}; 6 | 7 | for (final nucleotide in strand.split('')) { 8 | if (!result.containsKey(nucleotide)) { 9 | throw InvalidNucleotideException(); 10 | } 11 | 12 | result[nucleotide] = result[nucleotide]! + 1; 13 | } 14 | 15 | return result; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/lib/nucleotide_count.dart: -------------------------------------------------------------------------------- 1 | // Implement a custom InvalidNucleotideException exception 2 | 3 | class NucleotideCount { 4 | // Put your code here 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'nucleotide_count' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/pangram/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to figure out if a sentence is a pangram. 4 | 5 | A pangram is a sentence using every letter of the alphabet at least once. 6 | It is case insensitive, so it doesn't matter if a letter is lower-case (e.g. `k`) or upper-case (e.g. `K`). 7 | 8 | For this exercise, a sentence is a pangram if it contains each of the 26 letters in the English alphabet. 9 | -------------------------------------------------------------------------------- /exercises/practice/pangram/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You work for a company that sells fonts through their website. 4 | They'd like to show a different sentence each time someone views a font on their website. 5 | To give a comprehensive sense of the font, the random sentences should use **all** the letters in the English alphabet. 6 | 7 | They're running a competition to get suggestions for sentences that they can use. 8 | You're in charge of checking the submissions to see if they are valid. 9 | 10 | ~~~~exercism/note 11 | Pangram comes from Greek, παν γράμμα, pan gramma, which means "every letter". 12 | 13 | The best known English pangram is: 14 | 15 | > The quick brown fox jumps over the lazy dog. 16 | ~~~~ 17 | -------------------------------------------------------------------------------- /exercises/practice/pangram/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/pangram.dart" 11 | ], 12 | "test": [ 13 | "test/pangram_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Determine if a sentence is a pangram.", 23 | "source": "Wikipedia", 24 | "source_url": "https://en.wikipedia.org/wiki/Pangram" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/pangram/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Pangram { 2 | bool isPangram(String sentence) { 3 | Set uniqueLetters = new Set(); 4 | String cleanSentence = sentence.toLowerCase().replaceAll(new RegExp(r"[^a-zA-Z]"), ""); 5 | uniqueLetters.addAll(cleanSentence.split("")); 6 | 7 | return uniqueLetters.length == 26; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /exercises/practice/pangram/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/pangram/lib/pangram.dart: -------------------------------------------------------------------------------- 1 | class Pangram { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/pangram/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'pangram' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jvarness" 4 | ], 5 | "contributors": [ 6 | "devkabiir", 7 | "Stargator", 8 | "kytrinyx" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "lib/pascals_triangle.dart" 13 | ], 14 | "test": [ 15 | "test/pascals_triangle_test.dart" 16 | ], 17 | "example": [ 18 | ".meta/lib/example.dart" 19 | ], 20 | "invalidator": [ 21 | "pubspec.yaml" 22 | ] 23 | }, 24 | "blurb": "Compute Pascal's triangle up to a given number of rows.", 25 | "source": "Pascal's Triangle at Wolfram Math World", 26 | "source_url": "https://www.wolframalpha.com/input/?i=Pascal%27s+triangle" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/lib/pascals_triangle.dart: -------------------------------------------------------------------------------- 1 | class PascalsTriangle { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'pascals_triangle' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/perfect-numbers/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/perfect_numbers.dart" 8 | ], 9 | "test": [ 10 | "test/perfect_numbers_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for positive integers.", 20 | "source": "Taken from Chapter 2 of Functional Thinking by Neal Ford.", 21 | "source_url": "https://www.oreilly.com/library/view/functional-thinking/9781449365509/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/perfect-numbers/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | enum Classification { 2 | perfect, 3 | abundant, 4 | deficient, 5 | } 6 | 7 | class PerfectNumbers { 8 | Classification classify(int number) { 9 | if (number <= 0) { 10 | throw ArgumentError('Number must be greater than 0'); 11 | } 12 | 13 | var sum = 0; 14 | for (var i = 1; i < number; i++) { 15 | if (number % i == 0) { 16 | sum += i; 17 | } 18 | } 19 | 20 | if (sum == number) { 21 | return Classification.perfect; 22 | } else if (sum > number) { 23 | return Classification.abundant; 24 | } else { 25 | return Classification.deficient; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /exercises/practice/perfect-numbers/lib/perfect_numbers.dart: -------------------------------------------------------------------------------- 1 | // define the Classification enum 2 | 3 | class PerfectNumbers { 4 | // Put your code here 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/perfect-numbers/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'perfect_numbers' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/.docs/instructions.append.md: -------------------------------------------------------------------------------- 1 | # Tip 2 | 3 | A function with a *return type* can only return data of that *type* and `null`. 4 | However the function caller is only expecting one data type. 5 | 6 | Example: 7 | ```dart 8 | String hello(int a){ 9 | if ( a == 0){ 10 | return "a"; 11 | } else { 12 | return null; 13 | } 14 | } 15 | ``` 16 | To make it more clear that this function can also return `null` or more data types, use `dynamic`. 17 | ```dart 18 | dynamic hello(int a){ 19 | if ( a == 0){ 20 | return "a"; 21 | } else { 22 | return null; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "devkabiir" 4 | ], 5 | "contributors": [ 6 | "kytrinyx", 7 | "Stargator" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/phone_number.dart" 12 | ], 13 | "test": [ 14 | "test/phone_number_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Clean up user-entered phone numbers so that they can be sent SMS messages.", 24 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 25 | "source_url": "https://turing.edu" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/lib/phone_number.dart: -------------------------------------------------------------------------------- 1 | class PhoneNumber { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'phone_number' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | ## 1. Prefixed library imports 4 | 5 | - Notice that the test script (test/pig_latin_test.dart) imports the solution file using a prefix: 6 | 7 | ```dart 8 | import 'package:pig_latin/pig_latin.dart' as pigLatin; 9 | ``` 10 | - Learn more: [Specifying a library prefix 11 | ](https://dart.dev/guides/language/language-tour#specifying-a-library-prefix) 12 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Your parents have challenged you and your sibling to a game of two-on-two basketball. 4 | Confident they'll win, they let you score the first couple of points, but then start taking over the game. 5 | Needing a little boost, you start speaking in [Pig Latin][pig-latin], which is a made-up children's language that's difficult for non-children to understand. 6 | This will give you the edge to prevail over your parents! 7 | 8 | [pig-latin]: https://en.wikipedia.org/wiki/Pig_latin 9 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "HornMichaelS" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/pig_latin.dart" 8 | ], 9 | "test": [ 10 | "test/pig_latin_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "forked_from": [ 20 | "csharp/pig-latin" 21 | ], 22 | "blurb": "Implement a program that translates from English to Pig Latin.", 23 | "source": "The Pig Latin exercise at Test First Teaching by Ultrasaurus", 24 | "source_url": "https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/lib/pig_latin.dart: -------------------------------------------------------------------------------- 1 | // Your code here 2 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'pig_latin' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/prime_factors.dart" 11 | ], 12 | "test": [ 13 | "test/prime_factors_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Compute the prime factors of a given natural number.", 23 | "source": "The Prime Factors Kata by Uncle Bob", 24 | "source_url": "https://web.archive.org/web/20221026171801/http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class PrimeFactors { 2 | List factors(int value) { 3 | List factors = []; 4 | int divisor = 2; 5 | 6 | while (value > 1) { 7 | while (value % divisor == 0) { 8 | factors.add(divisor); 9 | value = value ~/ divisor; 10 | } 11 | divisor++; 12 | } 13 | return factors; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/lib/prime_factors.dart: -------------------------------------------------------------------------------- 1 | class PrimeFactors { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'prime_factors' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/protein-translation/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/protein_translation.dart" 8 | ], 9 | "test": [ 10 | "test/protein_translation_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Translate RNA sequences into proteins.", 20 | "source": "Tyler Long" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/practice/protein-translation/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/protein-translation/lib/protein_translation.dart: -------------------------------------------------------------------------------- 1 | class ProteinTranslation { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/protein-translation/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'protein_translation' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/proverb/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/proverb.dart" 8 | ], 9 | "test": [ 10 | "test/proverb_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "For want of a horseshoe nail, a kingdom was lost, or so the saying goes. Output the full text of this proverbial rhyme.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/For_Want_of_a_Nail" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/proverb/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Proverb { 2 | String recite(List pieces) { 3 | if (pieces.isEmpty) { 4 | return ''; 5 | } 6 | 7 | final List results = []; 8 | for (int i = 0; i < pieces.length - 1; i++) { 9 | results.add('For want of a ${pieces[i]} the ${pieces[i + 1]} was lost.'); 10 | } 11 | results.add('And all for the want of a ${pieces.first}.'); 12 | 13 | return results.join('\n'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /exercises/practice/proverb/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/proverb/lib/proverb.dart: -------------------------------------------------------------------------------- 1 | class Proverb { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/proverb/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'proverb' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/queen-attack/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/queen_attack.dart" 8 | ], 9 | "test": [ 10 | "test/queen_attack_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given the position of two queens on a chess board, indicate whether or not they are positioned so that they can attack each other.", 20 | "source": "J Dalbey's Programming Practice problems", 21 | "source_url": "https://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/queen-attack/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Queen { 2 | final int row; 3 | final int column; 4 | 5 | Queen(int row, int column) 6 | : assert(row >= 0, 'row not positive'), 7 | assert(row <= 7, 'row not on board'), 8 | assert(column >= 0, 'column not positive'), 9 | assert(column <= 7, 'column not on board'), 10 | this.row = row, 11 | this.column = column; 12 | 13 | bool canAttack(Queen other) => 14 | this.row == other.row || 15 | this.column == other.column || 16 | (this.row - other.row).abs() == (this.column - other.column).abs(); 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/queen-attack/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/queen-attack/lib/queen_attack.dart: -------------------------------------------------------------------------------- 1 | class Queen { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/queen-attack/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'queen_attack' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Raindrops is a slightly more complex version of the FizzBuzz challenge, a classic interview question. 4 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Raindrops { 2 | String convert(int i) { 3 | bool isDiv(int divisor) { 4 | return i % divisor == 0; 5 | } 6 | 7 | String out = ""; 8 | if (isDiv(3)) { 9 | out += "Pling"; 10 | } 11 | if (isDiv(5)) { 12 | out += "Plang"; 13 | } 14 | if (isDiv(7)) { 15 | out += "Plong"; 16 | } 17 | 18 | if (out == "") { 19 | out = i.toString(); 20 | } 21 | return out; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/lib/raindrops.dart: -------------------------------------------------------------------------------- 1 | class Raindrops { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'raindrops' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/relative-distance/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/relative_distance.dart" 8 | ], 9 | "test": [ 10 | "test/relative_distance_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ] 15 | }, 16 | "blurb": "Given a family tree, calculate the degree of separation.", 17 | "source": "vaeng", 18 | "source_url": "https://github.com/exercism/problem-specifications/pull/2537" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/relative-distance/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/relative-distance/lib/relative_distance.dart: -------------------------------------------------------------------------------- 1 | class RelativeDistance { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/relative-distance/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'relative_distance' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/resistor_color_duo.dart" 12 | ], 13 | "test": [ 14 | "test/resistor_color_duo_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Convert color codes, as used on resistors, to a numeric value.", 24 | "source": "Maud de Vries, Erik Schierboom", 25 | "source_url": "https://github.com/exercism/problem-specifications/issues/1464" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class ResistorColorDuo { 2 | final colors = ['black', 'brown', 'red', 'orange', 'yellow', 'green', 'blue', 'violet', 'grey', 'white']; 3 | 4 | int value(List input) { 5 | if (input.length > 2) input.removeLast(); 6 | return int.parse(input.map(colors.indexOf).join()); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/lib/resistor_color_duo.dart: -------------------------------------------------------------------------------- 1 | class ResistorColorDuo { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'resistor_color_duo' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-trio/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/resistor_color_trio.dart" 8 | ], 9 | "test": [ 10 | "test/resistor_color_trio_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ] 15 | }, 16 | "blurb": "Convert color codes, as used on resistors, to a human-readable label.", 17 | "source": "Maud de Vries, Erik Schierboom", 18 | "source_url": "https://github.com/exercism/problem-specifications/issues/1549" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-trio/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-trio/lib/resistor_color_trio.dart: -------------------------------------------------------------------------------- 1 | class ResistorColorTrio { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-trio/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'resistor_color_trio' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/resistor_color.dart" 11 | ], 12 | "test": [ 13 | "test/resistor_color_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Convert a resistor band's color to its numeric representation.", 23 | "source": "Maud de Vries, Erik Schierboom", 24 | "source_url": "https://github.com/exercism/problem-specifications/issues/1458" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class ResistorColor { 2 | final colors = ["black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white"]; 3 | 4 | int colorCode(String color) => colors.indexOf(color); 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.meta/tests.toml: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file. Regular comments will be removed when this 2 | # file is regenerated. Regenerating will not touch any manually added keys, 3 | # so comments can be added in a "comment" key. 4 | 5 | [49eb31c5-10a8-4180-9f7f-fea632ab87ef] 6 | description = "Black" 7 | 8 | [0a4df94b-92da-4579-a907-65040ce0b3fc] 9 | description = "White" 10 | 11 | [5f81608d-f36f-4190-8084-f45116b6f380] 12 | description = "Orange" 13 | 14 | [581d68fa-f968-4be2-9f9d-880f2fb73cf7] 15 | description = "Colors" 16 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/lib/resistor_color.dart: -------------------------------------------------------------------------------- 1 | class ResistorColor { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'resistor_color' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to reverse a given string. 4 | 5 | Some examples: 6 | 7 | - Turn `"stressed"` into `"desserts"`. 8 | - Turn `"strops"` into `"sports"`. 9 | - Turn `"racecar"` into `"racecar"`. 10 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Reversing strings (reading them from right to left, rather than from left to right) is a surprisingly common task in programming. 4 | 5 | For example, in bioinformatics, reversing the sequence of DNA or RNA strings is often important for various analyses, such as finding complementary strands or identifying palindromic sequences that have biological significance. 6 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "Zureka", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/reverse_string.dart" 12 | ], 13 | "test": [ 14 | "test/reverse_string_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Reverse a given string.", 24 | "source": "Introductory challenge to reverse an input string", 25 | "source_url": "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | String reverse(String value) => value.split('').reversed.join(''); 2 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/lib/reverse_string.dart: -------------------------------------------------------------------------------- 1 | String reverse() { 2 | // Replace the throw call and put your code here 3 | throw UnimplementedError(); 4 | } 5 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'reverse_string' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You work for a bioengineering company that specializes in developing therapeutic solutions. 4 | 5 | Your team has just been given a new project to develop a targeted therapy for a rare type of cancer. 6 | 7 | ~~~~exercism/note 8 | It's all very complicated, but the basic idea is that sometimes people's bodies produce too much of a given protein. 9 | That can cause all sorts of havoc. 10 | 11 | But if you can create a very specific molecule (called a micro-RNA), it can prevent the protein from being produced. 12 | 13 | This technique is called [RNA Interference][rnai]. 14 | 15 | [rnai]: https://admin.acceleratingscience.com/ask-a-scientist/what-is-rnai/ 16 | ~~~~ 17 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SuperPaintman" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/rna_transcription.dart" 12 | ], 13 | "test": [ 14 | "test/rna_transcription_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Given a DNA strand, return its RNA complement.", 24 | "source": "Hyperphysics", 25 | "source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class RnaTranscription { 2 | String toRna(String dna) { 3 | return dna.split("").map((c) { 4 | switch (c) { 5 | case "G": 6 | return "C"; 7 | case "C": 8 | return "G"; 9 | case "T": 10 | return "A"; 11 | case "A": 12 | return "U"; 13 | default: 14 | throw ArgumentError("Invalid input"); 15 | } 16 | }).join(""); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/lib/rna_transcription.dart: -------------------------------------------------------------------------------- 1 | class RnaTranscription { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'rna_transcription' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Corentin-Leffy" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/robot_simulator.dart" 12 | ], 13 | "test": [ 14 | "test/robot_simulator_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Write a robot simulator.", 24 | "source": "Inspired by an interview question at a famous company." 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/lib/orientation.dart: -------------------------------------------------------------------------------- 1 | enum Orientation { north, east, south, west } 2 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/lib/position.dart: -------------------------------------------------------------------------------- 1 | class Position { 2 | int x, y; 3 | 4 | Position(this.x, this.y); 5 | 6 | @override 7 | bool operator ==(Object other) => other is Position && other.x == this.x && other.y == this.y; 8 | 9 | @override 10 | int get hashCode { 11 | final int prime = 31; 12 | int result = 1; 13 | result = prime * result + x; 14 | result = prime * result + y; 15 | return result; 16 | } 17 | 18 | @override 19 | String toString() => "[x: $x, y: $y]"; 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/lib/robot_simulator.dart: -------------------------------------------------------------------------------- 1 | class Robot { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'robot_simulator' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/.docs/instructions.append.md: -------------------------------------------------------------------------------- 1 | # ignore 2 | 3 | ## Dart Extension Methods 4 | 5 | We're implementing this exercise with an extention method on the `int` class. 6 | For details, see [the Dart docs][extension-methods]. 7 | 8 | [extension-methods]: https://dart.dev/language/extension-methods 9 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Your task is to convert a number from Arabic numerals to Roman numerals. 4 | 5 | For this exercise, we are only concerned about traditional Roman numerals, in which the largest number is MMMCMXCIX (or 3,999). 6 | 7 | ~~~~exercism/note 8 | There are lots of different ways to convert between Arabic and Roman numerals. 9 | We recommend taking a naive approach first to familiarise yourself with the concept of Roman numerals and then search for more efficient methods. 10 | 11 | Make sure to check out our Deep Dive video at the end to explore the different approaches you can take! 12 | ~~~~ 13 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/roman_numerals.dart" 8 | ], 9 | "test": [ 10 | "test/roman_numerals_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Convert modern Arabic numbers into Roman numerals.", 20 | "source": "The Roman Numeral Kata", 21 | "source_url": "https://codingdojo.org/kata/RomanNumerals/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/lib/roman_numerals.dart: -------------------------------------------------------------------------------- 1 | extension ConvertToRomanNumerals on int { 2 | String toRoman() { 3 | // Put your code here 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'roman_numerals' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/rotational_cipher.dart" 8 | ], 9 | "test": [ 10 | "test/rotational_cipher_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Create an implementation of the rotational cipher, also sometimes called the Caesar cipher.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Caesar_cipher" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class RotationalCipher { 2 | String rotate({required String text, required int shiftKey}) { 3 | return text.replaceAllMapped(RegExp(r'\p{L}', unicode: true), (match) { 4 | var letter = match[0]!.codeUnitAt(0); 5 | if (65 <= letter && letter <= 90) { 6 | letter = (letter - 65 + shiftKey) % 26 + 65; 7 | } else if (97 <= letter && letter <= 122) { 8 | letter = (letter - 97 + shiftKey) % 26 + 97; 9 | } 10 | return String.fromCharCode(letter); 11 | }); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/lib/rotational_cipher.dart: -------------------------------------------------------------------------------- 1 | class RotationalCipher { 2 | // your code here... 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'rotational_cipher' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/run_length_encoding.dart" 8 | ], 9 | "test": [ 10 | "test/run_length_encoding_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Implement run-length encoding and decoding.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Run-length_encoding" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class RunLengthEncoder { 2 | String encode(String plaintext) { 3 | return plaintext.replaceAllMapped( 4 | RegExp(r'(.)\1+'), (Match m) => m[0]!.length.toString() + m[1]!); 5 | } 6 | 7 | String decode(String ciphertext) { 8 | return ciphertext.replaceAllMapped( 9 | RegExp(r'(\d+)(.)'), (Match m) => m[2]! * int.parse(m[1]!)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/lib/run_length_encoding.dart: -------------------------------------------------------------------------------- 1 | class RunLengthEncoder { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'run_length_encoding' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | [Scrabble][wikipedia] is a word game where players place letter tiles on a board to form words. 4 | Each letter has a value. 5 | A word's score is the sum of its letters' values. 6 | 7 | [wikipedia]: https://en.wikipedia.org/wiki/Scrabble 8 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jvarness" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/scrabble_score.dart" 12 | ], 13 | "test": [ 14 | "test/scrabble_score_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Given a word, compute the Scrabble score for that word.", 24 | "source": "Inspired by the Extreme Startup game", 25 | "source_url": "https://github.com/rchatley/extreme_startup" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | final Map _scores = const { 2 | 'a': 1, 3 | 'e': 1, 4 | 'i': 1, 5 | 'o': 1, 6 | 'u': 1, 7 | 'n': 1, 8 | 'l': 1, 9 | 'r': 1, 10 | 's': 1, 11 | 't': 1, 12 | 'd': 2, 13 | 'g': 2, 14 | 'b': 3, 15 | 'c': 3, 16 | 'm': 3, 17 | 'p': 3, 18 | 'f': 4, 19 | 'h': 4, 20 | 'v': 4, 21 | 'w': 4, 22 | 'y': 4, 23 | 'k': 5, 24 | 'j': 8, 25 | 'x': 8, 26 | 'z': 10, 27 | 'q': 10 28 | }; 29 | 30 | int score(String word) { 31 | int val = 0; 32 | if (word.length > 0) { 33 | word.split('').forEach((char) { 34 | final score = _scores[char.toLowerCase()]; 35 | val += score ?? 0; 36 | }); 37 | } 38 | return val; 39 | } 40 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/lib/scrabble_score.dart: -------------------------------------------------------------------------------- 1 | // Put your code here 2 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'scrabble_score' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You are starting a secret coding club with some friends and friends-of-friends. 4 | Not everyone knows each other, so you and your friends have decided to create a secret handshake that you can use to recognize that someone is a member. 5 | You don't want anyone who isn't in the know to be able to crack the code. 6 | 7 | You've designed the code so that one person says a number between 1 and 31, and the other person turns it into a series of actions. 8 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/secret_handshake.dart" 11 | ], 12 | "test": [ 13 | "test/secret_handshake_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Given a decimal number, convert it to the appropriate sequence of events for a secret handshake.", 23 | "source": "Bert, in Mary Poppins", 24 | "source_url": "https://www.imdb.com/title/tt0058331/quotes/?item=qt0437047" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class SecretHandshake { 2 | final _signal = ['wink', 'double blink', 'close your eyes', 'jump']; 3 | final _reverse = 4; 4 | 5 | bool _isBitset(int position, int number) { 6 | return ((number >> position) & 1) == 1; 7 | } 8 | 9 | List commands(int number) { 10 | List handshake = []; 11 | 12 | for (int index = 0; index < _signal.length; index++) { 13 | if (_isBitset(index, number)) { 14 | handshake.add(_signal[index]); 15 | } 16 | } 17 | 18 | return _isBitset(_reverse, number) ? handshake.reversed.toList() : handshake; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/lib/secret_handshake.dart: -------------------------------------------------------------------------------- 1 | class SecretHandshake { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'secret_handshake' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/sieve/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You bought a big box of random computer parts at a garage sale. 4 | You've started putting the parts together to build custom computers. 5 | 6 | You want to test the performance of different combinations of parts, and decide to create your own benchmarking program to see how your computers compare. 7 | You choose the famous "Sieve of Eratosthenes" algorithm, an ancient algorithm, but one that should push your computers to the limits. 8 | -------------------------------------------------------------------------------- /exercises/practice/sieve/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/sieve.dart" 8 | ], 9 | "test": [ 10 | "test/sieve_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Use the Sieve of Eratosthenes to find all the primes from 2 up to a given number.", 20 | "source": "Sieve of Eratosthenes at Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/sieve/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/sieve/lib/sieve.dart: -------------------------------------------------------------------------------- 1 | class Sieve { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/sieve/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'sieve' 2 | environment: 3 | sdk: '>=2.18.0 <3.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/space-age/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "devkabiir" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/space_age.dart" 12 | ], 13 | "test": [ 14 | "test/space_age_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Given an age in seconds, calculate how old someone is in terms of a given planet's solar years.", 24 | "source": "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial.", 25 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=01" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/space-age/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/space-age/lib/space_age.dart: -------------------------------------------------------------------------------- 1 | class SpaceAge { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/space-age/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'space_age' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to return a square matrix of a given size. 4 | 5 | The matrix should be filled with natural numbers, starting from 1 in the top-left corner, increasing in an inward, clockwise spiral order, like these examples: 6 | 7 | ## Examples 8 | 9 | ### Spiral matrix of size 3 10 | 11 | ```text 12 | 1 2 3 13 | 8 9 4 14 | 7 6 5 15 | ``` 16 | 17 | ### Spiral matrix of size 4 18 | 19 | ```text 20 | 1 2 3 4 21 | 12 13 14 5 22 | 11 16 15 6 23 | 10 9 8 7 24 | ``` 25 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/spiral_matrix.dart" 8 | ], 9 | "test": [ 10 | "test/spiral_matrix_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given the size, return a square matrix of numbers in spiral order.", 20 | "source": "Reddit r/dailyprogrammer challenge #320 [Easy] Spiral Ascension.", 21 | "source_url": "https://web.archive.org/web/20230607064729/https://old.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/lib/spiral_matrix.dart: -------------------------------------------------------------------------------- 1 | class SpiralMatrix { 2 | // Your code goes here. 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'spiral_matrix' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/square-root/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | We are launching a deep space exploration rocket and we need a way to make sure the navigation system stays on target. 4 | 5 | As the first step in our calculation, we take a target number and find its square root (that is, the number that when multiplied by itself equals the target number). 6 | 7 | The journey will be very long. 8 | To make the batteries last as long as possible, we had to make our rocket's onboard computer very power efficient. 9 | Unfortunately that means that we can't rely on fancy math libraries and functions, as they use more power. 10 | Instead we want to implement our own square root calculation. 11 | -------------------------------------------------------------------------------- /exercises/practice/square-root/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/square_root.dart" 8 | ], 9 | "test": [ 10 | "test/square_root_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given a natural radicand, return its square root.", 20 | "source": "wolf99", 21 | "source_url": "https://github.com/exercism/problem-specifications/pull/1582" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/square-root/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class SquareRoot { 2 | int squareRoot(int radicand) { 3 | if (radicand == 1) { 4 | return 1; 5 | } 6 | 7 | int guess = radicand ~/ 2; 8 | 9 | while (guess * guess != radicand) { 10 | guess = (guess + radicand ~/ guess) ~/ 2; 11 | } 12 | 13 | return guess; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /exercises/practice/square-root/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/square-root/lib/square_root.dart: -------------------------------------------------------------------------------- 1 | class SquareRoot { 2 | // your code here... 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/square-root/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'square_root' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/strain/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/strain.dart" 8 | ], 9 | "test": [ 10 | "test/strain_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Implement the `keep` and `discard` operation on collections.", 20 | "source": "Conversation with James Edward Gray II", 21 | "source_url": "http://graysoftinc.com/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/strain/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Strain { 2 | List keep(List list, bool Function(T) predicate) { 3 | final result = []; 4 | 5 | for (final item in list) { 6 | if (predicate(item)) { 7 | result.add(item); 8 | } 9 | } 10 | 11 | return result; 12 | } 13 | 14 | List discard(List list, bool Function(T) predicate) { 15 | return keep(list, (item) => !predicate(item)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/strain/lib/strain.dart: -------------------------------------------------------------------------------- 1 | class Strain { 2 | // your code here... 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/strain/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'strain' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/sublist/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/sublist.dart" 8 | ], 9 | "test": [ 10 | "test/sublist_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Write a function to determine if a list is a sublist of another list." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/sublist/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/sublist/lib/sublist.dart: -------------------------------------------------------------------------------- 1 | // Implement the Classification enum. 2 | 3 | class Sublist { 4 | // your code here... 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/sublist/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'sublist' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You work for a company that makes an online, fantasy-survival game. 4 | 5 | When a player finishes a level, they are awarded energy points. 6 | The amount of energy awarded depends on which magical items the player found while exploring that level. 7 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "Stargator" 4 | ], 5 | "contributors": [ 6 | "kytrinyx" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "lib/sum_of_multiples.dart" 11 | ], 12 | "test": [ 13 | "test/sum_of_multiples_test.dart" 14 | ], 15 | "example": [ 16 | ".meta/lib/example.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Given a number, find the sum of all the multiples of particular numbers up to but not including that number.", 23 | "source": "A variation on Problem 1 at Project Euler", 24 | "source_url": "https://projecteuler.net/problem=1" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class SumOfMultiples { 2 | 3 | int sum(List rootArray, int limit) { 4 | final multiplesTracked = {}; 5 | 6 | for (final num in rootArray) { 7 | for (int count = 1; num != 0 && (num * count) < limit; count++) { 8 | multiplesTracked.add(num * count); 9 | } 10 | } 11 | 12 | return multiplesTracked.fold(0, _addUpMultiples); 13 | } 14 | 15 | int _addUpMultiples(int currentSum, int arrayValue) => currentSum + arrayValue; 16 | } 17 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/lib/sum_of_multiples.dart: -------------------------------------------------------------------------------- 1 | class SumOfMultiples { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'sum_of_multiples' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/triangle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "Zureka", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/triangle.dart" 12 | ], 13 | "test": [ 14 | "test/triangle_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Determine if a triangle is equilateral, isosceles, or scalene.", 24 | "source": "The Ruby Koans triangle project, parts 1 & 2", 25 | "source_url": "https://web.archive.org/web/20220831105330/http://rubykoans.com" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/triangle/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | class Triangle { 2 | bool _check(num a, num b, num c) { 3 | return [a, b, c].every((t) => t > 0) && (a <= b + c) && (b <= c + a) && (c <= a + b); 4 | } 5 | 6 | bool equilateral(num a, num b, num c) { 7 | return _check(a, b, c) && (a == b) && (b == c); 8 | } 9 | 10 | bool isosceles(num a, num b, num c) { 11 | return _check(a, b, c) && ((a == b) || (b == c) || (c == a)); 12 | } 13 | 14 | bool scalene(num a, num b, num c) { 15 | return _check(a, b, c) && (a != b) && (b != c) && (c != a); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/triangle/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/triangle/lib/triangle.dart: -------------------------------------------------------------------------------- 1 | class Triangle { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/triangle/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'triangle' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/twelve-days/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/twelve_days.dart" 8 | ], 9 | "test": [ 10 | "test/twelve_days_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ] 15 | }, 16 | "blurb": "Output the lyrics to 'The Twelve Days of Christmas'.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_(song)" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/twelve-days/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/twelve-days/lib/twelve_days.dart: -------------------------------------------------------------------------------- 1 | class TwelveDays { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/twelve-days/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'twelve_days' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/two-bucket/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/two_bucket.dart" 8 | ], 9 | "test": [ 10 | "test/two_bucket_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Given two buckets of different size, demonstrate how to measure an exact number of liters.", 20 | "source": "Water Pouring Problem", 21 | "source_url": "https://demonstrations.wolfram.com/WaterPouringProblem/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/two-bucket/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/two-bucket/lib/two_bucket.dart: -------------------------------------------------------------------------------- 1 | typedef Result = ({int moves, String goalBucket, int otherBucket}); 2 | 3 | class TwoBucket { 4 | // your code here... 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/two-bucket/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'two_bucket' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to determine what you will say as you give away the extra cookie. 4 | 5 | If you know the person's name (e.g. if they're named Do-yun), then you will say: 6 | 7 | ```text 8 | One for Do-yun, one for me. 9 | ``` 10 | 11 | If you don't know the person's name, you will say _you_ instead. 12 | 13 | ```text 14 | One for you, one for me. 15 | ``` 16 | 17 | Here are some examples: 18 | 19 | | Name | Dialogue | 20 | | :----- | :-------------------------- | 21 | | Alice | One for Alice, one for me. | 22 | | Bohdan | One for Bohdan, one for me. | 23 | | | One for you, one for me. | 24 | | Zaphod | One for Zaphod, one for me. | 25 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | In some English accents, when you say "two for" quickly, it sounds like "two fer". 4 | Two-for-one is a way of saying that if you buy one, you also get one for free. 5 | So the phrase "two-fer" often implies a two-for-one offer. 6 | 7 | Imagine a bakery that has a holiday offer where you can buy two cookies for the price of one ("two-fer one!"). 8 | You take the offer and (very generously) decide to give the extra cookie to someone else in the queue. 9 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/canonical-data.json: -------------------------------------------------------------------------------- 1 | { 2 | "exercise": "two-fer", 3 | "version": "1.2.0", 4 | "cases": [ 5 | { 6 | "description": "no name given", 7 | "property": "twoFer", 8 | "expected": "One for you, one for me." 9 | }, 10 | { 11 | "description": "a name given", 12 | "property": "twoFer", 13 | "input": { 14 | "name": "Alice" 15 | }, 16 | "expected": "One for Alice, one for me." 17 | }, 18 | { 19 | "description": "another name given", 20 | "property": "twoFer", 21 | "input": { 22 | "name": "Bob" 23 | }, 24 | "expected": "One for Bob, one for me." 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "amscotti" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/two_fer.dart" 12 | ], 13 | "test": [ 14 | "test/two_fer_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Create a sentence of the form \"One for X, one for me.\".", 24 | "source_url": "https://github.com/exercism/problem-specifications/issues/757" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/lib/example.dart: -------------------------------------------------------------------------------- 1 | String twoFer([String name = "you"]) => "One for ${name}, one for me."; 2 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/tests.toml: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file. Regular comments will be removed when this 2 | # file is regenerated. Regenerating will not touch any manually added keys, 3 | # so comments can be added in a "comment" key. 4 | 5 | [1cf3e15a-a3d7-4a87-aeb3-ba1b43bc8dce] 6 | description = "no name given" 7 | 8 | [b4c6dbb8-b4fb-42c2-bafd-10785abe7709] 9 | description = "a name given" 10 | 11 | [3549048d-1a6e-4653-9a79-b0bda163e8d5] 12 | description = "another name given" 13 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/lib/two_fer.dart: -------------------------------------------------------------------------------- 1 | String twoFer() { 2 | // Replace the throw call and put your code here 3 | throw UnimplementedError(); 4 | } 5 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'two_fer' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/test/two_fer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | import 'package:two_fer/two_fer.dart'; 3 | 4 | void main() { 5 | group('TwoFer', () { 6 | test('no name given', () { 7 | final result = twoFer(); 8 | expect(result, equals('One for you, one for me.')); 9 | }, skip: false); 10 | 11 | test('a name given', () { 12 | final result = twoFer('Alice'); 13 | expect(result, equals('One for Alice, one for me.')); 14 | }, skip: true); 15 | 16 | test('another name given', () { 17 | final result = twoFer('Bob'); 18 | expect(result, equals('One for Bob, one for me.')); 19 | }, skip: true); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /exercises/practice/word-count/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You teach English as a foreign language to high school students. 4 | 5 | You've decided to base your entire curriculum on TV shows. 6 | You need to analyze which words are used, and how often they're repeated. 7 | 8 | This will let you choose the simplest shows to start with, and to gradually increase the difficulty as time passes. 9 | -------------------------------------------------------------------------------- /exercises/practice/word-count/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "devkabiir" 4 | ], 5 | "contributors": [ 6 | "Stargator", 7 | "kytrinyx" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "lib/word_count.dart" 12 | ], 13 | "test": [ 14 | "test/word_count_test.dart" 15 | ], 16 | "example": [ 17 | ".meta/lib/example.dart" 18 | ], 19 | "invalidator": [ 20 | "pubspec.yaml" 21 | ] 22 | }, 23 | "blurb": "Given a phrase, count the occurrences of each word in that phrase.", 24 | "source": "This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour." 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/word-count/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/word-count/lib/word_count.dart: -------------------------------------------------------------------------------- 1 | class WordCount { 2 | // Put your code here 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/word-count/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'word_count' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/yacht/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Each year, something new is "all the rage" in your high school. 4 | This year it is a dice game: [Yacht][yacht]. 5 | 6 | The game of Yacht is from the same family as Poker Dice, Generala and particularly Yahtzee, of which it is a precursor. 7 | The game consists of twelve rounds. 8 | In each, five dice are rolled and the player chooses one of twelve categories. 9 | The chosen category is then used to score the throw of the dice. 10 | 11 | [yacht]: https://en.wikipedia.org/wiki/Yacht_(dice_game) 12 | -------------------------------------------------------------------------------- /exercises/practice/yacht/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/yacht.dart" 8 | ], 9 | "test": [ 10 | "test/yacht_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "editor": [ 16 | "lib/categories.dart" 17 | ], 18 | "invalidator": [ 19 | "pubspec.yaml" 20 | ] 21 | }, 22 | "blurb": "Score a single throw of dice in the game Yacht.", 23 | "source": "James Kilfiger, using Wikipedia", 24 | "source_url": "https://en.wikipedia.org/wiki/Yacht_(dice_game)" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/yacht/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/yacht/lib/categories.dart: -------------------------------------------------------------------------------- 1 | enum Category { 2 | ones, 3 | twos, 4 | threes, 5 | fours, 6 | fives, 7 | sixes, 8 | full_house, 9 | four_of_a_kind, 10 | little_straight, 11 | big_straight, 12 | choice, 13 | yacht, 14 | } 15 | -------------------------------------------------------------------------------- /exercises/practice/yacht/lib/yacht.dart: -------------------------------------------------------------------------------- 1 | import 'package:yacht/categories.dart'; 2 | 3 | class Yacht { 4 | // Your code here. 5 | } 6 | -------------------------------------------------------------------------------- /exercises/practice/yacht/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'yacht' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "glennj" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "lib/zebra_puzzle.dart" 8 | ], 9 | "test": [ 10 | "test/zebra_puzzle_test.dart" 11 | ], 12 | "example": [ 13 | ".meta/lib/example.dart" 14 | ], 15 | "invalidator": [ 16 | "pubspec.yaml" 17 | ] 18 | }, 19 | "blurb": "Solve the zebra puzzle.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Zebra_Puzzle" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | unused_element: error 7 | unused_import: error 8 | unused_local_variable: error 9 | dead_code: error 10 | 11 | linter: 12 | rules: 13 | # Error Rules 14 | - avoid_relative_lib_imports 15 | - avoid_types_as_parameter_names 16 | - literal_only_boolean_expressions 17 | - no_adjacent_strings_in_list 18 | - valid_regexps 19 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/lib/zebra_puzzle.dart: -------------------------------------------------------------------------------- 1 | class ZebraPuzzle { 2 | // your solution goes here ... 3 | } 4 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: 'zebra_puzzle' 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | dev_dependencies: 5 | test: '<2.0.0' 6 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/test/zebra_puzzle_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | import 'package:zebra_puzzle/zebra_puzzle.dart'; 3 | 4 | void main() { 5 | final zebraPuzzle = ZebraPuzzle(); 6 | zebraPuzzle.solve(); 7 | 8 | test('resident who drinks water', () { 9 | expect(zebraPuzzle.drinksWater, 'Norwegian'); 10 | }); 11 | 12 | test('resident who owns zebra', () { 13 | expect(zebraPuzzle.ownsZebra, 'Japanese'); 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /exercises/shared/.docs/help.md: -------------------------------------------------------------------------------- 1 | # Help 2 | 3 | To get help if you're having trouble, you can use one of the following resources: 4 | 5 | - [Dart API Documentation](https://api.dart.dev/) 6 | - [Dart Gitter Chat](https://gitter.im/dart-lang/home) 7 | - [Community Information](https://www.dart.dev/community) 8 | - [/r/dartlang](https://www.reddit.com/r/dartlang) is the Dart subreddit. 9 | - [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. 10 | -------------------------------------------------------------------------------- /exercises/shared/.docs/tests.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | To run the tests: 4 | 5 | ```sh 6 | $ dart test 7 | ``` 8 | -------------------------------------------------------------------------------- /img/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/dart/26cc7e518536719477cf4e3694222d3df91b2dde/img/.keep -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: exercism_dart 2 | environment: 3 | sdk: '>=3.2.0 <4.0.0' 4 | authors: 5 | - SuperPaintman 6 | - Stargator 7 | - fwip 8 | - devkabiir 9 | - jvarness 10 | dev_dependencies: 11 | args: ^2.4.2 12 | dart_style: ^2.3.4 13 | io: ^1.0.4 14 | test: ^1.25.2 15 | yaml: ^3.1.2 16 | -------------------------------------------------------------------------------- /reference/implementing-a-concept-exercise.md: -------------------------------------------------------------------------------- 1 | # How to implement an Dart concept exercise 2 | 3 | TODO: describe how to implement a concept exercise for the Dart track. For inspiration, check out the [C# version of this file][csharp-implementing]. 4 | 5 | [csharp-implementing]: https://github.com/exercism/v3/blob/main/languages/csharp/reference/implementing-a-concept-exercise.md 6 | --------------------------------------------------------------------------------