├── .appends └── .github │ └── labels.yml ├── .gitattributes ├── .github ├── CODEOWNERS ├── dependabot.yml ├── labels.yml ├── org-wide-files-config.toml ├── stale.yml └── workflows │ ├── build.yml │ ├── configlet.yml │ ├── no-important-files-changed.yml │ ├── ping-cross-track-maintainers-team.yml │ └── sync-labels.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── TAGS.md ├── bin ├── analyze-all-exercises-in-docker.sh ├── analyze_all_exercises.sh ├── build.sh ├── fetch-configlet ├── generate_concept_exercise.sh ├── generate_practice_exercise.sh ├── run-all-exercises-in-docker.sh └── run_all_exercises.sh ├── concepts ├── array │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── basics-1 │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── basics-2 │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── bitwise-operations │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── booleans │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── comparison │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── custom-types │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── dict │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── generics │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── json │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── let │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── lists │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── maybe │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── opaque-types │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── parsing │ ├── .meta │ │ ├── LolCodeParser.elm │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── partial-application-composition │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── pattern-matching │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── phantom-types │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── random │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── records │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── recursion │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── result │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── set │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── strings │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── time │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json ├── tuples │ ├── .meta │ │ └── config.json │ ├── about.md │ ├── introduction.md │ └── links.json └── web-applications-sandbox │ ├── .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 └── contributing-concept.md ├── elm-tooling.json ├── exercises ├── concept │ ├── annalyns-infiltration │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── AnnalynsInfiltration.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── bandwagoner │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── Bandwagoner.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── bettys-bike-shop │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── BettysBikeShop.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── bird-count │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── BirdCount.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── blorkemon-cards │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── BlorkemonCards.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── githup-api │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── GithupApi.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── go │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ ├── Go.elm │ │ │ └── GoSupport.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── gotta-snatch-em-all │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── GottaSnatchEmAll.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── kurokos-clock │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── KurokosClock.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── lucians-luscious-lasagna │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── LuciansLusciousLasagna.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── magician-in-training │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── MagicianInTraining.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── marios-marvellous-lasagna │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── MariosMarvellousLasagna.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── maze-maker │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ ├── MazeMaker.elm │ │ │ └── MazeMakerSupport.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── monster-attack │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── MonsterAttack.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── paolas-prestigious-pizza │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── PaolasPrestigiousPizza.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── paulas-palindromes │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm-watch.json │ │ ├── elm.json │ │ ├── index.html │ │ ├── src │ │ │ ├── Browser.elm │ │ │ └── Main.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── role-playing-game │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── RolePlayingGame.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── secrets │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── Secrets.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── secure-treasure-chest │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── SecureTreasureChest.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── squeaky-clean │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── SqueakyClean.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── ticket-please │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ ├── TicketPlease.elm │ │ │ └── TicketPleaseSupport.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── tisbury-treasure-hunt │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── TisburyTreasureHunt.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── top-scorers │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ ├── TopScorers.elm │ │ │ └── TopScorersSupport.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── tracks-on-tracks-on-tracks │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── TracksOnTracksOnTracks.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── treasure-chest │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── TreasureChest.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── treasure-factory │ │ ├── .docs │ │ │ ├── hints.md │ │ │ ├── instructions.md │ │ │ ├── introduction.md │ │ │ └── introduction.md.tpl │ │ ├── .meta │ │ │ ├── Exemplar.elm │ │ │ ├── config.json │ │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ │ └── TreasureFactory.elm │ │ └── tests │ │ │ └── Tests.elm │ └── valentines-day │ │ ├── .docs │ │ ├── hints.md │ │ ├── instructions.md │ │ ├── introduction.md │ │ └── introduction.md.tpl │ │ ├── .meta │ │ ├── Exemplar.elm │ │ ├── config.json │ │ └── design.md │ │ ├── elm.json │ │ ├── src │ │ └── ValentinesDay.elm │ │ └── tests │ │ └── Tests.elm ├── practice │ ├── accumulate │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Accumulate.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Accumulate.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── acronym │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Acronym.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Acronym.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── all-your-base │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── AllYourBase.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── AllYourBase.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── allergies │ │ ├── .approaches │ │ │ ├── bitwise-and-case │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ │ ├── bitwise-and-dict │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ │ ├── bitwise-and-list │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ │ ├── bitwise-and-type-alias │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ │ ├── config.json │ │ │ └── introduction.md │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Allergies.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Allergies.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── anagram │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Anagram.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Anagram.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── armstrong-numbers │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ArmstrongNumbers.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ArmstrongNumbers.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── atbash-cipher │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── AtbashCipher.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── AtbashCipher.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── binary-search-tree │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── BinarySearchTree.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── BinarySearchTree.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── binary-search │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── BinarySearch.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── BinarySearch.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── bob │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Bob.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Bob.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── bowling │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ ├── Bowling.example.elm │ │ │ │ ├── Bowling.example2.elm │ │ │ │ └── Bowling.example3.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Bowling.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── circular-buffer │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── CircularBuffer.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── CircularBuffer.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── collatz-conjecture │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── CollatzConjecture.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── CollatzConjecture.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── complex-numbers │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ComplexNumbers.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ComplexNumbers.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── custom-set │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── CustomSet.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── CustomSet.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── darts │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Darts.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Darts.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── diamond │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Diamond.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Diamond.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── difference-of-squares │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── DifferenceOfSquares.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── DifferenceOfSquares.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── dnd-character │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── DndCharacter.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── DndCharacter.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── eliuds-eggs │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── EliudsEggs.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── EliudsEggs.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── etl │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Etl.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Etl.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── food-chain │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── FoodChain.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── FoodChain.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── gigasecond │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Gigasecond.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Gigasecond.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── grade-school │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── GradeSchool.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── GradeSchool.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── grains │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Grains.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Grains.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── hamming │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Hamming.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Hamming.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── hello-world │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── HelloWorld.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── HelloWorld.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── isogram │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Isogram.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Isogram.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── kindergarten-garden │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── KindergartenGarden.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── KindergartenGarden.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── knapsack │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Knapsack.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Knapsack.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── largest-series-product │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── LargestSeriesProduct.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── LargestSeriesProduct.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── leap │ │ ├── .approaches │ │ │ ├── case-expression │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ │ ├── config.json │ │ │ ├── if-expression │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ │ ├── introduction.md │ │ │ └── logical-expression │ │ │ │ ├── content.md │ │ │ │ └── snippet.txt │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Leap.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Leap.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── list-ops │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ListOps.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ListOps.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── luhn │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Luhn.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Luhn.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── matching-brackets │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── MatchingBrackets.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── MatchingBrackets.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── meetup │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Meetup.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Meetup.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── minesweeper │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Minesweeper.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Minesweeper.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── nucleotide-count │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── NucleotideCount.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── NucleotideCount.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── pangram │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── description.md │ │ │ ├── src │ │ │ │ └── Pangram.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Pangram.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── pascals-triangle │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── PascalsTriangle.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── PascalsTriangle.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── phone-number │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── PhoneNumber.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── PhoneNumber.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── pig-latin │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── PigLatin.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── PigLatin.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── protein-translation │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ProteinTranslation.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ProteinTranslation.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── pythagorean-triplet │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── PythagoreanTriplet.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── PythagoreanTriplet.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── raindrops │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Raindrops.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Raindrops.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── relative-distance │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RelativeDistance.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RelativeDistance.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── resistor-color-duo │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ResistorColorDuo.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ResistorColorDuo.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── resistor-color-trio │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ResistorColorTrio.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ResistorColorTrio.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── resistor-color │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ResistorColor.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ResistorColor.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── rest-api │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RestApi.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RestApi.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── reverse-string │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ReverseString.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ReverseString.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── rna-transcription │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RnaTranscription.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RnaTranscription.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── robot-simulator │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RobotSimulator.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RobotSimulator.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── roman-numerals │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RomanNumerals.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RomanNumerals.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── rotational-cipher │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RotationalCipher.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RotationalCipher.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── run-length-encoding │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── RunLengthEncoding.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── RunLengthEncoding.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── say │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Say.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Say.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── scrabble-score │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── ScrabbleScore.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── ScrabbleScore.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── secret-handshake │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SecretHandshake.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SecretHandshake.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── series │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Series.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Series.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── sgf-parsing │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SgfParsing.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SgfParsing.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── sieve │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Sieve.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Sieve.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── simple-cipher │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SimpleCipher.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SimpleCipher.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── space-age │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SpaceAge.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SpaceAge.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── spiral-matrix │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SpiralMatrix.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SpiralMatrix.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── split-second-stopwatch │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SplitSecondStopwatch.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SplitSecondStopwatch.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── square-root │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SquareRoot.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SquareRoot.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── strain │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Strain.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Strain.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── sublist │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Sublist.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Sublist.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── sum-of-multiples │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SumOfMultiples.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SumOfMultiples.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── swift-scheduling │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── SwiftScheduling.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── SwiftScheduling.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── transpose │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Transpose.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Transpose.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── triangle │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Triangle.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Triangle.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── twelve-days │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── TwelveDays.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── TwelveDays.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── two-bucket │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── TwoBucket.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── TwoBucket.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── two-fer │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── TwoFer.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── TwoFer.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── word-count │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── WordCount.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── WordCount.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── wordy │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Wordy.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Wordy.elm │ │ └── tests │ │ │ └── Tests.elm │ ├── yacht │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── src │ │ │ │ └── Yacht.example.elm │ │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ │ └── Yacht.elm │ │ └── tests │ │ │ └── Tests.elm │ └── zebra-puzzle │ │ ├── .docs │ │ ├── instructions.md │ │ └── introduction.md │ │ ├── .meta │ │ ├── config.json │ │ ├── src │ │ │ └── ZebraPuzzle.example.elm │ │ └── tests.toml │ │ ├── elm.json │ │ ├── src │ │ └── ZebraPuzzle.elm │ │ └── tests │ │ └── Tests.elm └── shared │ └── .docs │ ├── debug.md │ ├── help.md │ └── tests.md ├── generate_practice_exercise ├── README.md ├── elm.json ├── generate.js └── src │ ├── Main.elm │ └── cli.js └── template ├── elm.json ├── src └── Exercise.elm └── tests └── Tests.elm /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.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 | 7 | -------------------------------------------------------------------------------- /.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/org-wide-files-config.toml: -------------------------------------------------------------------------------- 1 | [configlet] 2 | fmt = true 3 | 4 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/elm/ed59adc92c01c76923a4d261e41d53501f706471/.github/stale.yml -------------------------------------------------------------------------------- /.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 | with: 17 | fmt: true 18 | -------------------------------------------------------------------------------- /.github/workflows/no-important-files-changed.yml: -------------------------------------------------------------------------------- 1 | name: No important files changed 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened] 6 | branches: [main] 7 | paths: 8 | - "exercises/concept/**" 9 | - "exercises/practice/**" 10 | - "!exercises/*/*/.approaches/**" 11 | - "!exercises/*/*/.articles/**" 12 | - "!exercises/*/*/.docs/**" 13 | - "!exercises/*/*/.meta/**" 14 | 15 | permissions: 16 | pull-requests: write 17 | 18 | jobs: 19 | check: 20 | uses: exercism/github-actions/.github/workflows/check-no-important-files-changed.yml@main 21 | with: 22 | repository: ${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }} 23 | ref: ${{ github.head_ref }} 24 | -------------------------------------------------------------------------------- /.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 | .DS_Store 3 | bin/configlet 4 | bin/configlet.exe 5 | bin/elm-format 6 | elm-stuff 7 | CHECKLIST 8 | build.js 9 | node_modules 10 | build 11 | main.js 12 | -------------------------------------------------------------------------------- /bin/analyze-all-exercises-in-docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e # Make script exit when a command fail. 4 | set -u # Exit on usage of undeclared variable. 5 | # set -x # Trace what gets executed. 6 | set -o pipefail # Catch failures in pipes. 7 | 8 | # pull docker image 9 | docker pull exercism/elm-analyzer 10 | 11 | # run image passing the arguments 12 | docker run \ 13 | --rm \ 14 | --read-only \ 15 | --network none \ 16 | --mount type=bind,src=${PWD},dst=/opt/analyzer/elm_repo \ 17 | --mount type=tmpfs,dst=/tmp \ 18 | --volume "${PWD}/bin/analyze_all_exercises.sh:/opt/analyzer/bin/analyze_all_exercises.sh" \ 19 | --entrypoint /opt/analyzer/bin/analyze_all_exercises.sh \ 20 | exercism/elm-analyzer \ 21 | /opt/analyzer/elm_repo 22 | -------------------------------------------------------------------------------- /concepts/array/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use arrays in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg", 8 | "jiegillet" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/array/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elmprogramming.com/array.html", 4 | "description": "Detailed book section about Elm arrays" 5 | }, 6 | { 7 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Array", 8 | "description": "Code documentation of the Array module" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/basics-1/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mpizenberg" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "blurb": "Learn the basic syntax of an Elm file" 9 | } 10 | -------------------------------------------------------------------------------- /concepts/basics-1/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elm-lang.org/", 4 | "description": "Elm language" 5 | }, 6 | { 7 | "url": "https://elm-lang.org/docs/syntax#modules", 8 | "description": "Modules" 9 | }, 10 | { 11 | "url": "https://guide.elm-lang.org/core_language.html", 12 | "description": "Core Elm Language" 13 | }, 14 | { 15 | "url": "https://elmprogramming.com/indentation.html", 16 | "description": "Indentation / significant whitespace" 17 | }, 18 | { 19 | "url": "https://elm-lang.org/docs/style-guide", 20 | "description": "Style guide" 21 | }, 22 | { 23 | "url": "https://github.com/avh4/elm-format", 24 | "description": "Elm format" 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /concepts/basics-2/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "blurb": "Learn the basics of Elm programming" 9 | } 10 | -------------------------------------------------------------------------------- /concepts/bitwise-operations/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "stewartmurrie" 4 | ], 5 | "contributors": ["jiegillet"], 6 | "blurb": "Learn how to use integer bitwise operations in Elm" 7 | } 8 | -------------------------------------------------------------------------------- /concepts/bitwise-operations/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Bitwise", 4 | "description": "Bitwise module" 5 | }, 6 | { 7 | "url": "https://guide.elm-lang.org/appendix/types_as_bits", 8 | "description": "Documentation on how Elm represents types as bits" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/booleans/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use booleans in an Elm program", 3 | "authors": [ 4 | "mpizenberg" 5 | ], 6 | "contributors": [ 7 | "ceddlyburge" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/booleans/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | The `Bool` type is one of the building blocks of the language. 4 | It aims at describing whether something is true or false, with the respective `True` and `False` values. 5 | 6 | Booleans can be combined with the `&&` "AND" and the `||` "OR" operators, and negated with the `not` function. 7 | 8 | Booleans are also extremely useful to make branches in your code that only get executed if certain conditions are met. 9 | In Elm, this is done with an `if-then-else` expression, used as follows. 10 | 11 | ```elm 12 | if someCondition || (someOtherCondition && anotherCondition) then 13 | doSomething 14 | else 15 | doSomethingElse 16 | ``` 17 | -------------------------------------------------------------------------------- /concepts/booleans/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Basics#Bool", 4 | "description": "Boolean operators" 5 | }, 6 | { 7 | "url": "https://elm-lang.org/docs/syntax#conditionals", 8 | "description": "Syntax for conditional branches" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/comparison/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Find out which types can be compared directly", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "mpizenberg", 8 | "ceddlyburge" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/custom-types/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use custom types in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/custom-types/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://guide.elm-lang.org/types/custom_types.html", 4 | "description": "Custom Types" 5 | }, 6 | { 7 | "url": "https://guide.elm-lang.org/types/pattern_matching.html", 8 | "description": "Pattern matching" 9 | }, 10 | { 11 | "url": "https://www.youtube.com/watch?v=IcgmSRJHu_8", 12 | "description": "Making impossible states impossible" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /concepts/dict/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use the Dict type in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "jiegillet", 8 | "mpizenberg" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/dict/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Dict", 4 | "description": "Dict module" 5 | }, 6 | { 7 | "url": "https://riptutorial.com/elm/example/7088/dictionaries", 8 | "description": "Dict tutorial" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/generics/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to create and use Elm code that is generic.", 3 | "authors": ["ceddlyburge"], 4 | "contributors": ["mpizenberg", "jiegillet"] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/generics/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elmprogramming.com/type-system.html", 4 | "description": "Elm type system" 5 | }, 6 | { 7 | "url": "https://guide.elm-lang.org/types/custom_types.html", 8 | "description": "Custom types in Elm" 9 | } 10 | 11 | ] 12 | -------------------------------------------------------------------------------- /concepts/json/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to parse and write JSON content", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [] 7 | } 8 | -------------------------------------------------------------------------------- /concepts/let/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use the let statement in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/let/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elm-lang.org/docs/syntax#let-expressions", 4 | "description": "Syntax for let expressions" 5 | }, 6 | { 7 | "url": "https://elmprogramming.com/let-expression.html", 8 | "description": "Beginning Elm guide to let expressions" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/lists/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use lists in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/lists/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elmprogramming.com/list.html", 4 | "description": "Detailed book section about Elm lists" 5 | }, 6 | { 7 | "url": "https://package.elm-lang.org/packages/elm/core/latest/List", 8 | "description": "Code documentation of the List module" 9 | }, 10 | { 11 | "url": "https://www.bekk.christmas/post/2020/8/peeking-inside-lists", 12 | "description": "Pattern matching lists" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /concepts/maybe/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use optional values with the Maybe type", 3 | "authors": [ 4 | "mpizenberg" 5 | ], 6 | "contributors": [ 7 | "ceddlyburge" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/maybe/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://guide.elm-lang.org/error_handling/maybe.html", 4 | "description": "Official guide about Maybe" 5 | }, 6 | { 7 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Maybe", 8 | "description": "Documentation of the Maybe module in elm/core" 9 | }, 10 | { 11 | "url": "https://thoughtbot.com/blog/problem-solving-with-maybe", 12 | "description": "Rules for writing tidy code with Maybe" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /concepts/opaque-types/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to create and use Opaque Types in Elm.", 3 | "authors": ["ceddlyburge"], 4 | "contributors": ["jiegillet"] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/parsing/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Parsing is the process of transforming text into meaningful data", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "mpizenberg", 8 | "ceddlyburge" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/parsing/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://package.elm-lang.org/packages/elm/parser/latest/", 4 | "description": "Elm parser library" 5 | }, 6 | { 7 | "url": "https://korban.net/posts/elm/2018-09-07-introduction-elm-parser/", 8 | "description": "Introduction to the elm/parser package" 9 | }, 10 | { 11 | "url": "https://elm-radio.com/episode/elm-parser/", 12 | "description": "Elm Radio podcast episode about elm/parser" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /concepts/partial-application-composition/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Partial application and composition make it easy to compose functions together", 3 | "authors": ["ceddlyburge"], 4 | "contributors": ["jiegillet", "mpizenberg"] 5 | } 6 | -------------------------------------------------------------------------------- /concepts/pattern-matching/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Pattern matching is a powerfull tool to identify and bind any kind of data.", 3 | "authors": [ 4 | "mpizenberg", 5 | "jiegillet" 6 | ], 7 | "contributors": [ 8 | "ceddlyburge" 9 | ] 10 | } -------------------------------------------------------------------------------- /concepts/phantom-types/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use phantom types in Elm", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "ceddlyburge", 8 | "mpizenberg" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/phantom-types/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://ckoster22.medium.com/advanced-types-in-elm-phantom-types-808044c5946d", 4 | "description": "Advanced Types in Elm - Phantom Types" 5 | }, 6 | { 7 | "url": "https://thoughtbot.com/blog/modeling-currency-in-elm-using-phantom-types", 8 | "description": "Modeling Currency in Elm using Phantom Types" 9 | }, 10 | { 11 | "url": "https://elm-radio.com/episode/phantom-builder/", 12 | "description": "Elm Radio - Phantom Builder Pattern" 13 | }, 14 | { 15 | "url": "https://www.youtube.com/watch?v=Trp3tmpMb-o", 16 | "description": "The phantom builder pattern - Jeroen Engels" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /concepts/random/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to generate random values in Elm", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "pwadsworth", 8 | "ceddlyburge" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/random/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://package.elm-lang.org/packages/elm/random/latest/", 4 | "description": "Random module documentation" 5 | }, 6 | { 7 | "url": "https://guide.elm-lang.org/effects/random", 8 | "description": "Elm guide on the Random module" 9 | }, 10 | { 11 | "url": "https://package.elm-lang.org/packages/elm-community/random-extra/latest/", 12 | "description": "random-extra package documentation" 13 | }, 14 | { 15 | "url": "https://elmprogramming.com/commands.html", 16 | "description": "Beginning Elm: Commands" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /concepts/records/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use records in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/records/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elm-lang.org/docs/records", 4 | "description": "Records" 5 | }, 6 | { 7 | "url": "https://elmprogramming.com/record.html", 8 | "description": "Records (in more detail)" 9 | }, 10 | { 11 | "url": "https://en.wikipedia.org/wiki/Structural_type_system", 12 | "description": "Structural types" 13 | }, 14 | { 15 | "url": "https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/scopedlabels.pdf", 16 | "description": "Extensible records white paper" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /concepts/recursion/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Recursive functions are functions that call themselves. Learn how to use recursion in Elm", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "ceddlyburge" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/recursion/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://functional-programming-in-elm.netlify.app/recursion/", 4 | "description": "Recursion described by Evan Czaplicki, creator of Elm" 5 | }, 6 | { 7 | "url": "https://learnyouanelm.github.io/pages/05-recursion.html", 8 | "description": "Recursion chapter from Learn You an Elm" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/result/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn about error reporting and handling with the Result type", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/result/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://guide.elm-lang.org/error_handling/result.html", 4 | "description": "Official guide about Result" 5 | }, 6 | { 7 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Result", 8 | "description": "Documentation of the Result module in elm/core" 9 | }, 10 | { 11 | "url": "https://package.elm-lang.org/packages/elm-community/result-extra/latest/Result.Extra", 12 | "description": "Community contributed esoteric extensions to Result (usually not required, but can be helpful in some situations)" 13 | } 14 | 15 | ] 16 | -------------------------------------------------------------------------------- /concepts/set/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use sets", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "mpizenberg", 8 | "ceddlyburge" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /concepts/set/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Set", 4 | "description": "Set module" 5 | }, 6 | { 7 | "url": "https://package.elm-lang.org/packages/turboMaCk/any-set/latest/", 8 | "description": "Sets for non-comparable types" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/strings/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use Elm strings", 3 | "authors": [ 4 | "pwadsworth" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /concepts/strings/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://elmprogramming.com/string.html", 4 | "description": "Beginning Elm Strings Tutorial" 5 | }, 6 | { 7 | "url": "https://package.elm-lang.org/packages/elm/core/latest/String", 8 | "description": "Elm's String documentation" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /concepts/time/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to display time in Elm", 3 | "authors": [ 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "ceddlyburge" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/tuples/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to use tuples in an Elm program", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "mpizenberg" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /concepts/tuples/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://www.bekk.christmas/post/2020/1/once-twice-three-times-a-value", 4 | "description": "a concise introduction to tuples" 5 | }, 6 | { 7 | "url": "https://elmprogramming.com/tuple.html", 8 | "description": "an in depth introduction to tuples" 9 | }, 10 | { 11 | "url": "https://package.elm-lang.org/packages/elm/core/latest/Tuple", 12 | "description": "detailed API doc of the Tuple module in elm/core package" 13 | }, 14 | { 15 | "url": "https://www.bekk.christmas/post/2020/7/simplify-your-code-with-ad-hoc-tuples", 16 | "description": "simplifying code with ad-hoc tuples" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /concepts/web-applications-sandbox/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Learn how to write Web Applications in Elm", 3 | "authors": [ 4 | "ceddlyburge" 5 | ], 6 | "contributors": [ 7 | "jiegillet" 8 | ] 9 | } -------------------------------------------------------------------------------- /concepts/web-applications-sandbox/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://guide.elm-lang.org/architecture/", 4 | "description": "The Elm Architecture" 5 | }, 6 | { 7 | "url": "https://guide.elm-lang.org/architecture/buttons", 8 | "description": "Buttons example (using Browser.sandbox)" 9 | }, 10 | { 11 | "url": "https://package.elm-lang.org/packages/elm/browser/latest/", 12 | "description": "Browser package" 13 | }, 14 | { 15 | "url": "https://github.com/lustre-labs/lustre", 16 | "description": "Lustre, a Gleam framework based on The Elm Architecture" 17 | }, 18 | { 19 | "url": "https://github.com/redbadger/crux", 20 | "description": "Crux, a Rust cross platform app framework based on The Elm Architecture" 21 | } 22 | ] -------------------------------------------------------------------------------- /docs/ABOUT.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | Elm describes itself as a "delightful language for reliable webapps". 4 | It aims at producing web applications with great performances and no runtime exception. 5 | 6 | Concretely, it is a functional programming language compiling to JavaScript. 7 | Its syntax and features originated from the ML family of languages, such as Haskell, 8 | but with [a strong emphasis on learnability and simplicity][blog-syntax]. 9 | 10 | You can learn more about elm on the official website, [elm-lang.org][elm-lang]. 11 | Newcomers should start with the elm guide, located at [guide.elm-lang.org][guide]. 12 | 13 | [blog-syntax]: https://elm-lang.org/news/the-syntax-cliff 14 | [elm-lang]: https://elm-lang.org 15 | [guide]: https://guide.elm-lang.org 16 | -------------------------------------------------------------------------------- /docs/SNIPPET.txt: -------------------------------------------------------------------------------- 1 | module HelloWorld exposing (helloWorld) 2 | 3 | 4 | helloWorld : Maybe String -> String 5 | helloWorld maybeName = 6 | case maybeName of 7 | Nothing -> 8 | "Hello, World!" 9 | 10 | Just name -> 11 | "Hello, " ++ name ++ "!" 12 | -------------------------------------------------------------------------------- /elm-tooling.json: -------------------------------------------------------------------------------- 1 | { 2 | "tools": { 3 | "elm": "0.19.1", 4 | "elm-format": "0.8.5", 5 | "elm-test-rs": "3.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /exercises/concept/annalyns-infiltration/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | ## General 4 | 5 | - Boolean functions and operators are described in the [Elm documentation of the Basics module][bool]. 6 | 7 | [bool]: https://package.elm-lang.org/packages/elm/core/latest/Basics#Bool 8 | 9 | ## 5. Count the damage that a stealth attack could do 10 | 11 | - Conditional examples are provided in the [Elm syntax guide][syntax]. 12 | 13 | [syntax]: https://elm-lang.org/docs/syntax#conditionals 14 | -------------------------------------------------------------------------------- /exercises/concept/annalyns-infiltration/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | ## Booleans 4 | 5 | The `Bool` type is one of the building blocks of the language. 6 | It aims at describing whether something is true or false, with the respective `True` and `False` values. 7 | 8 | Booleans can be combined with the `&&` "AND" and the `||` "OR" operators, and negated with the `not` function. 9 | 10 | Booleans are also extremely useful to make branches in your code that only get executed if certain conditions are met. 11 | In Elm, this is done with an `if-then-else` expression, used as follows. 12 | 13 | ```elm 14 | if someCondition || (someOtherCondition && anotherCondition) then 15 | doSomething 16 | else 17 | doSomethingElse 18 | ``` 19 | -------------------------------------------------------------------------------- /exercises/concept/annalyns-infiltration/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: booleans} 4 | -------------------------------------------------------------------------------- /exercises/concept/annalyns-infiltration/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mpizenberg" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/AnnalynsInfiltration.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "forked_from": [ 20 | "fsharp/annalyns-infiltration" 21 | ], 22 | "blurb": "Learn usage of Booleans while helping Annalyn rescue her friend" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/concept/annalyns-infiltration/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Goal 4 | 5 | The goal of this exercise is to teach the students what are Booleans and what you can do with them. 6 | 7 | ## Learning objectives 8 | 9 | - Know of the existence of the `Bool` type and its two values. 10 | - Know about boolean operators and how to build logical expressions with them. 11 | - Know of the boolean operator precedence rules. 12 | - Know how to use conditional branching (if-then-else). 13 | 14 | ## Out of scope 15 | 16 | - The actual definition of the `Bool` type as a sum type. 17 | - Pattern matching. 18 | 19 | ## Concepts 20 | 21 | - `booleans` 22 | 23 | ## Prerequisites 24 | 25 | - `basics-2` 26 | -------------------------------------------------------------------------------- /exercises/concept/bandwagoner/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: records} 4 | -------------------------------------------------------------------------------- /exercises/concept/bandwagoner/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module Bandwagoner exposing (..) 2 | 3 | 4 | type alias Coach = 5 | { name : String 6 | , formerPlayer : Bool 7 | } 8 | 9 | 10 | type alias Stats = 11 | { wins : Int 12 | , losses : Int 13 | } 14 | 15 | 16 | type alias Team = 17 | { name : String 18 | , coach : Coach 19 | , stats : Stats 20 | } 21 | 22 | 23 | createTeam : String -> Stats -> Coach -> Team 24 | createTeam name stats coach = 25 | { name = name, stats = stats, coach = coach } 26 | 27 | 28 | replaceCoach : Coach -> Team -> Team 29 | replaceCoach newCoach team = 30 | { team | coach = newCoach } 31 | 32 | 33 | rootForTeam : { a | stats : Stats } -> Bool 34 | rootForTeam { stats } = 35 | stats.wins > stats.losses 36 | -------------------------------------------------------------------------------- /exercises/concept/bandwagoner/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/Bandwagoner.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "blurb": "Learn usage of Records while keeping a history of basketball statistics" 20 | } 21 | -------------------------------------------------------------------------------- /exercises/concept/bandwagoner/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Learning objectives 4 | 5 | - Know what a record is 6 | - Know when records should be used 7 | - Know how to define records 8 | - Know that records have structural equality 9 | - Know how to deconstruct records (including as parameters) 10 | - Know how to pattern match on records 11 | - Know that records are immutable 12 | - Know how to return a modified copy of a record 13 | - Know how to define extensible records 14 | 15 | ## Out of scope 16 | 17 | - Adding / removing members to records 18 | - Mutually recursive records 19 | 20 | ## Concepts 21 | 22 | - `records` 23 | 24 | ## Prerequisites 25 | 26 | - `basics-2` 27 | -------------------------------------------------------------------------------- /exercises/concept/bandwagoner/src/Bandwagoner.elm: -------------------------------------------------------------------------------- 1 | module Bandwagoner exposing (..) 2 | 3 | -- TODO: please define a type alias for the 'Coach' record 4 | -- TODO: please define the 'Stats' record 5 | -- TODO: please define the 'Team' record 6 | 7 | 8 | replaceCoach newCoach team = 9 | Debug.todo "Please implement this function" 10 | 11 | 12 | createTeam name stats coach = 13 | Debug.todo "Please implement this function" 14 | 15 | 16 | 17 | -- TODO: use an extensible record to accept any record that has a `stats: Stats` field 18 | -- TODO: use pattern matching in the function parameter to get the `stats` field from the record 19 | 20 | 21 | rootForTeam team = 22 | Debug.todo "Please implement this function, try to pattern match in the function parameter" 23 | -------------------------------------------------------------------------------- /exercises/concept/bettys-bike-shop/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | ## General 4 | 5 | - Basic integer operators are described in elm [Basics module documentation][basics-int]. 6 | - Basic float operators are described in elm [Basics module documentation][basics-float]. 7 | - String functionality is described in [String chapter of Beginning Elm][string-beginning-elm] and in the elm [String module documentation][string-module]. 8 | 9 | [basics-int]: https://package.elm-lang.org/packages/elm/core/latest/Basics#Int 10 | [basics-float]: https://package.elm-lang.org/packages/elm/core/latest/Basics#Float 11 | [string-beginning-elm]: https://elmprogramming.com/string.html 12 | [string-module]: https://package.elm-lang.org/packages/elm/core/latest/String 13 | -------------------------------------------------------------------------------- /exercises/concept/bettys-bike-shop/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: basics-2} 4 | -------------------------------------------------------------------------------- /exercises/concept/bettys-bike-shop/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module BettysBikeShop exposing (penceToPounds, poundsToString) 2 | 3 | import String 4 | 5 | 6 | penceToPounds : Int -> Float 7 | penceToPounds pence = 8 | toFloat pence / 100.0 9 | 10 | 11 | poundsToString : Float -> String 12 | poundsToString pounds = 13 | "£" ++ String.fromFloat pounds 14 | -------------------------------------------------------------------------------- /exercises/concept/bettys-bike-shop/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge", 4 | "mpizenberg" 5 | ], 6 | "contributors": [ 7 | "jiegillet" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/BettysBikeShop.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ] 19 | }, 20 | "blurb": "Continue learning the basics of Elm by helping Betty to display her bikes prices" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/bettys-bike-shop/src/BettysBikeShop.elm: -------------------------------------------------------------------------------- 1 | module BettysBikeShop exposing (poundsToString) 2 | 3 | -- TODO: import the String module 4 | 5 | 6 | penceToPounds pence = 7 | Debug.todo "implement this function and create a type annotation" 8 | 9 | 10 | poundsToString pounds = 11 | Debug.todo "implement this function and create a type annotation" 12 | -------------------------------------------------------------------------------- /exercises/concept/bird-count/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: recursion} 4 | -------------------------------------------------------------------------------- /exercises/concept/bird-count/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/BirdCount.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "exemplar": [ 13 | ".meta/Exemplar.elm" 14 | ] 15 | }, 16 | "forked_from": [ 17 | "csharp/bird-watcher" 18 | ], 19 | "icon": "bird-watcher", 20 | "blurb": "Learn about recursion by keeping track of how many birds visit your garden each day." 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/bird-count/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Goal 4 | 5 | The Goal is to learn to use recursion 6 | 7 | ## Learning objectives 8 | 9 | Students should be able to 10 | 11 | - understand that it's a fundamental pattern in FP 12 | - understand that many core functions are built with recursion 13 | - use recursive functions 14 | - write a recursive function 15 | 16 | ## Out of scope 17 | 18 | Tail call recursion. 19 | 20 | ## Concepts 21 | 22 | The concept this exercise unlocks is: 23 | 24 | - `recursion` 25 | 26 | ## Prerequisites 27 | 28 | - maybe 29 | - lists 30 | - pattern matching 31 | 32 | ## Analyzer 33 | 34 | - [essential] functions from the `List` module are not used anywhere 35 | -------------------------------------------------------------------------------- /exercises/concept/bird-count/src/BirdCount.elm: -------------------------------------------------------------------------------- 1 | module BirdCount exposing (busyDays, hasDayWithoutBirds, incrementDayCount, today, total) 2 | 3 | 4 | today : List Int -> Maybe Int 5 | today counts = 6 | Debug.todo "Please implement today" 7 | 8 | 9 | incrementDayCount : List Int -> List Int 10 | incrementDayCount counts = 11 | Debug.todo "Please implement incrementDayCount" 12 | 13 | 14 | hasDayWithoutBirds : List Int -> Bool 15 | hasDayWithoutBirds counts = 16 | Debug.todo "Please implement hasDayWithoutBirds" 17 | 18 | 19 | total : List Int -> Int 20 | total counts = 21 | Debug.todo "Please implement total" 22 | 23 | 24 | busyDays : List Int -> Int 25 | busyDays counts = 26 | Debug.todo "Please implement busyDays" 27 | -------------------------------------------------------------------------------- /exercises/concept/blorkemon-cards/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: comparison} 4 | -------------------------------------------------------------------------------- /exercises/concept/blorkemon-cards/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "mpizenberg", 7 | "ceddlyburge" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/BlorkemonCards.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ] 19 | }, 20 | "icon": "character-study", 21 | "blurb": "Learn comparisons by playing a vintage trading card game" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/concept/githup-api/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: json} 4 | -------------------------------------------------------------------------------- /exercises/concept/githup-api/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/GithupApi.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "blurb": "Learn to decode and encode JSON values with Elm" 20 | } 21 | -------------------------------------------------------------------------------- /exercises/concept/go/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | - If you want a complementary explanation on the `Result` type, you can have a look at the [Elm guide][guide-result]. 4 | - The [Result module][result-module] has some useful functions for working with the Result type, such as `Result.map` and `Result.andThen`. 5 | 6 | [guide-result]: https://guide.elm-lang.org/error_handling/result.html 7 | [result-module]: https://package.elm-lang.org/packages/elm/core/latest/Result 8 | -------------------------------------------------------------------------------- /exercises/concept/go/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: result} 4 | -------------------------------------------------------------------------------- /exercises/concept/go/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module Go exposing (..) 2 | 3 | import GoSupport exposing (..) 4 | 5 | 6 | applyRules : Game -> Rule -> NonValidatingRule -> Rule -> Rule -> Game 7 | applyRules game oneStonePerPointRule captureRule libertyRule koRule = 8 | let 9 | updatedGameOrError = 10 | oneStonePerPointRule game 11 | |> Result.map captureRule 12 | |> Result.andThen libertyRule 13 | |> Result.andThen koRule 14 | |> Result.map changePlayer 15 | in 16 | case updatedGameOrError of 17 | Ok updatedGame -> 18 | updatedGame 19 | 20 | Err msg -> 21 | { game | error = msg } 22 | -------------------------------------------------------------------------------- /exercises/concept/go/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/Go.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ], 18 | "editor": [ 19 | "src/GoSupport.elm" 20 | ] 21 | }, 22 | "icon": "go-counting", 23 | "blurb": "Learn usage of Result by applying the rules of the game of Go" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/concept/go/src/Go.elm: -------------------------------------------------------------------------------- 1 | module Go exposing (..) 2 | 3 | import GoSupport exposing (..) 4 | 5 | 6 | applyRules : Game -> Rule -> NonValidatingRule -> Rule -> Rule -> Game 7 | applyRules game oneStonePerPointRule captureRule libertyRule koRule = 8 | Debug.todo "Please implement the `applyRules` function" 9 | -------------------------------------------------------------------------------- /exercises/concept/go/src/GoSupport.elm: -------------------------------------------------------------------------------- 1 | module GoSupport exposing (..) 2 | 3 | 4 | type Player 5 | = Black 6 | | White 7 | 8 | 9 | type alias Game = 10 | { whiteCapturedStones : Int 11 | , blackCapturedStones : Int 12 | , player : Player 13 | , error : String 14 | } 15 | 16 | 17 | type alias Rule = 18 | Game -> Result String Game 19 | 20 | 21 | type alias NonValidatingRule = 22 | Game -> Game 23 | 24 | 25 | changePlayer : Game -> Game 26 | changePlayer game = 27 | let 28 | newPlayer = 29 | if game.player == White then 30 | Black 31 | 32 | else 33 | White 34 | in 35 | { game | player = newPlayer } 36 | -------------------------------------------------------------------------------- /exercises/concept/gotta-snatch-em-all/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: set} 4 | -------------------------------------------------------------------------------- /exercises/concept/gotta-snatch-em-all/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/GottaSnatchEmAll.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "icon": "character-study", 20 | "blurb": "Learn to use sets by playing a vintage trading card game" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/kurokos-clock/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: time} 4 | -------------------------------------------------------------------------------- /exercises/concept/kurokos-clock/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/KurokosClock.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "exemplar": [ 13 | ".meta/Exemplar.elm" 14 | ] 15 | }, 16 | "blurb": "Learn to format dates and times in different time zones and locales" 17 | } 18 | -------------------------------------------------------------------------------- /exercises/concept/kurokos-clock/src/KurokosClock.elm: -------------------------------------------------------------------------------- 1 | module KurokosClock exposing (Locale(..), showDateTime, showLocalDate, showLocalTime) 2 | 3 | import Time exposing (Month(..), Posix, Zone) 4 | 5 | 6 | type Locale 7 | = US 8 | | JP 9 | 10 | 11 | showLocalDate : Locale -> Int -> Month -> Int -> String 12 | showLocalDate locale year month day = 13 | Debug.todo "Please implement showLocalDate" 14 | 15 | 16 | showLocalTime : Locale -> Int -> Int -> String 17 | showLocalTime locale hour minute = 18 | Debug.todo "Please implement showLocalTime" 19 | 20 | 21 | showDateTime : Locale -> Zone -> Posix -> String 22 | showDateTime locale zone posix = 23 | Debug.todo "Please implement showDateTime" 24 | -------------------------------------------------------------------------------- /exercises/concept/lucians-luscious-lasagna/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # General 2 | 3 | - Basic numbers operators are described in elm [Basics module documentation][basics-doc]. 4 | 5 | [basics-doc]: https://package.elm-lang.org/packages/elm/core/latest/Basics#Int 6 | -------------------------------------------------------------------------------- /exercises/concept/lucians-luscious-lasagna/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: basics-1} 4 | -------------------------------------------------------------------------------- /exercises/concept/lucians-luscious-lasagna/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module LuciansLusciousLasagna exposing (elapsedTimeInMinutes, expectedMinutesInOven, preparationTimeInMinutes) 2 | 3 | 4 | expectedMinutesInOven = 5 | 40 6 | 7 | 8 | preparationTimeInMinutes layers = 9 | 2 * layers 10 | 11 | 12 | elapsedTimeInMinutes layers passedAlready = 13 | passedAlready + preparationTimeInMinutes layers 14 | -------------------------------------------------------------------------------- /exercises/concept/lucians-luscious-lasagna/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mpizenberg", 4 | "ceddlyburge" 5 | ], 6 | "files": { 7 | "solution": [ 8 | "src/LuciansLusciousLasagna.elm" 9 | ], 10 | "test": [ 11 | "tests/Tests.elm" 12 | ], 13 | "exemplar": [ 14 | ".meta/Exemplar.elm" 15 | ] 16 | }, 17 | "forked_from": [ 18 | "fsharp/lucians-luscious-lasagna" 19 | ], 20 | "icon": "lasagna", 21 | "blurb": "Learn the basics of Elm by cooking Lucian's Luscious Lasagna" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/concept/lucians-luscious-lasagna/src/LuciansLusciousLasagna.elm: -------------------------------------------------------------------------------- 1 | module LuciansLusciousLasagna exposing (elapsedTimeInMinutes, expectedMinutesInOven, preparationTimeInMinutes) 2 | 3 | -- TODO: define the expectedMinutesInOven constant 4 | -- TODO: define the preparationTimeInMinutes function 5 | -- TODO: define the elapsedTimeInMinutes function 6 | -------------------------------------------------------------------------------- /exercises/concept/magician-in-training/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | ## General 4 | 5 | - Arrays in Elm use zero-based indices. The first index in an Array is `0`. 6 | - The [Array module][array-module] has documentation for all the standard array functions. 7 | 8 | [array-module]: https://package.elm-lang.org/packages/elm/core/latest/Array 9 | -------------------------------------------------------------------------------- /exercises/concept/magician-in-training/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: array} 4 | -------------------------------------------------------------------------------- /exercises/concept/magician-in-training/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/MagicianInTraining.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "exemplar": [ 13 | ".meta/Exemplar.elm" 14 | ] 15 | }, 16 | "forked_from": [ 17 | "swift/magician-in-training" 18 | ], 19 | "icon": "magician-in-training", 20 | "blurb": "Help Elyse with her Enchantments and learn about arrays in the process." 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/magician-in-training/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Learning objectives 4 | 5 | - Know about the `Array` data structure. 6 | - Know how to create an empty array. 7 | - Know how to add and remove elements to an array. 8 | - Know how to get an element from an array. 9 | - Know how to convert an array to and from a list. 10 | - Know how to iterate over an array. 11 | 12 | ## Out of scope 13 | 14 | - Nothing is really out of scope. 15 | 16 | ## Concepts 17 | 18 | - array 19 | 20 | ## Prerequisites 21 | 22 | - lists 23 | - maybe 24 | -------------------------------------------------------------------------------- /exercises/concept/marios-marvellous-lasagna/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # General 2 | 3 | - The `let` expressions are described in the [Elm lang documentation][let-elm-lang]. 4 | - Whitespace is important 5 | - Multiple expressions can be defined in the `let` section, separate with new lines 6 | - There can only be one expression in the `in` section 7 | 8 | [let-elm-lang]: https://elm-lang.org/docs/syntax#let-expressions 9 | -------------------------------------------------------------------------------- /exercises/concept/marios-marvellous-lasagna/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: let} 4 | -------------------------------------------------------------------------------- /exercises/concept/marios-marvellous-lasagna/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module MariosMarvellousLasagna exposing (remainingTimeInMinutes) 2 | 3 | 4 | remainingTimeInMinutes : Int -> Int -> Int 5 | remainingTimeInMinutes layers minutesSinceStarting = 6 | let 7 | expectedMinutesInOven = 8 | 40 9 | 10 | preparationTimeInMinutes = 11 | 2 * layers 12 | in 13 | preparationTimeInMinutes + expectedMinutesInOven - minutesSinceStarting 14 | -------------------------------------------------------------------------------- /exercises/concept/marios-marvellous-lasagna/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/MariosMarvellousLasagna.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "icon": "lasagna-master", 20 | "blurb": "Learn the Elm `let` expression by cooking Mario's Marvellous Lasagna" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/marios-marvellous-lasagna/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Learning objectives 4 | 5 | - Understand local scoping within let expressions. 6 | - Know that variable shadowing is not allowed, even in let expressions. 7 | - Know how to define local functions in let expressions. 8 | 9 | ## Out of scope 10 | 11 | Nothing in particular. 12 | 13 | ## Concepts 14 | 15 | - `let` 16 | 17 | ## Prerequisites 18 | 19 | - `basics-2` 20 | -------------------------------------------------------------------------------- /exercises/concept/marios-marvellous-lasagna/src/MariosMarvellousLasagna.elm: -------------------------------------------------------------------------------- 1 | module MariosMarvellousLasagna exposing (remainingTimeInMinutes) 2 | 3 | -- TODO: define the remainingTimeInMinutes function 4 | -------------------------------------------------------------------------------- /exercises/concept/maze-maker/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: random} 4 | -------------------------------------------------------------------------------- /exercises/concept/maze-maker/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "pwadsworth", 7 | "ceddlyburge" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/MazeMaker.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ], 19 | "editor": [ 20 | "src/MazeMakerSupport.elm" 21 | ] 22 | }, 23 | "blurb": "Learn to generate random values in Elm" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/concept/monster-attack/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # General 2 | 3 | - [Partial application][partial-application] and [`(|>)`][pipe-operator] make it easy to write elegant, chained, code, when the main data structure as last argument of functions. All the common functions in the standard library do this, such as `List.map` 4 | - A [Let statement][let] can be used in the `attack` functions to partially apply the `attackWithSword` and `attachWithClaw` functions with the correct strength for Annalyn and Kazak. 5 | 6 | [pipe-operator]: https://package.elm-lang.org/packages/elm/core/latest/Basics#|%3E 7 | [partial-application]: https://riptutorial.com/elm/example/7499/partial-application 8 | [let]: "https://elmprogramming.com/let-expression.html" 9 | -------------------------------------------------------------------------------- /exercises/concept/monster-attack/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: partial-application-composition} 4 | -------------------------------------------------------------------------------- /exercises/concept/monster-attack/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/MonsterAttack.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "exemplar": [ 13 | ".meta/Exemplar.elm" 14 | ] 15 | }, 16 | "icon": "dnd-character", 17 | "blurb": "Learn partial application and function composition in Elm by attacking a monster" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/concept/paolas-prestigious-pizza/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: parsing} 4 | -------------------------------------------------------------------------------- /exercises/concept/paolas-prestigious-pizza/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "mpizenberg", 7 | "ceddlyburge" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/PaolasPrestigiousPizza.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ] 19 | }, 20 | "icon": "pizza-slices", 21 | "blurb": "Learn the basics of parsing by processing the menu of Paola's Prestigious Pizza" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/concept/paulas-palindromes/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: web-applications-sandbox} 4 | -------------------------------------------------------------------------------- /exercises/concept/paulas-palindromes/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Main.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "exemplar": [ 13 | ".meta/Exemplar.elm" 14 | ], 15 | "editor": [ 16 | "src/Browser.elm" 17 | ] 18 | }, 19 | "icon": "palindrome-products", 20 | "blurb": "Learn the basics of Elm web applications by checking if a string is a palindrome" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/paulas-palindromes/elm-watch.json: -------------------------------------------------------------------------------- 1 | { 2 | "serve": ".", 3 | "targets": { 4 | "Paulas Palindromes": { 5 | "inputs": [ 6 | "src/Main.elm" 7 | ], 8 | "output": "build/main.js" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /exercises/concept/paulas-palindromes/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | -------------------------------------------------------------------------------- /exercises/concept/paulas-palindromes/src/Browser.elm: -------------------------------------------------------------------------------- 1 | module Browser exposing (sandbox) 2 | 3 | import Html exposing (Html) 4 | 5 | 6 | type alias Sandbox msg model = 7 | { init : model 8 | , update : msg -> model -> model 9 | , view : model -> Html msg 10 | } 11 | 12 | 13 | 14 | -- This file is a fake of `Browser.sandbox`, so that we can run the tests easily within the exercism online editor. 15 | 16 | 17 | sandbox : Sandbox msg model -> Html msg 18 | sandbox { init, view } = 19 | view init 20 | -------------------------------------------------------------------------------- /exercises/concept/role-playing-game/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | - If you want a complementary explanation on the `Maybe` type, you can have a look at the [Elm guide][guide-maybe]. 4 | 5 | ## 3. Implement the spell casting mechanic 6 | 7 | - There exists a [`max` function][max] that you can use to make sure the health does not go below 0. 8 | 9 | [guide-maybe]: https://guide.elm-lang.org/error_handling/maybe.html 10 | [max]: https://package.elm-lang.org/packages/elm/core/latest/Basics#max 11 | -------------------------------------------------------------------------------- /exercises/concept/role-playing-game/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: maybe} 4 | -------------------------------------------------------------------------------- /exercises/concept/role-playing-game/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mpizenberg" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/RolePlayingGame.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "forked_from": [ 20 | "rust/role-playing-game" 21 | ], 22 | "blurb": "Learn usage of Maybe by designing game mechanics" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/concept/role-playing-game/src/RolePlayingGame.elm: -------------------------------------------------------------------------------- 1 | module RolePlayingGame exposing (Player, castSpell, introduce, revive) 2 | 3 | 4 | type alias Player = 5 | { name : Maybe String 6 | , level : Int 7 | , health : Int 8 | , mana : Maybe Int 9 | } 10 | 11 | 12 | introduce : Player -> String 13 | introduce { name } = 14 | Debug.todo "Please implement this function" 15 | 16 | 17 | revive : Player -> Maybe Player 18 | revive player = 19 | Debug.todo "Please implement this function" 20 | 21 | 22 | castSpell : Int -> Player -> ( Player, Int ) 23 | castSpell manaCost player = 24 | Debug.todo "Please implement this function" 25 | -------------------------------------------------------------------------------- /exercises/concept/secrets/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: bitwise-operations} 4 | -------------------------------------------------------------------------------- /exercises/concept/secrets/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module Secrets exposing (clearBits, decrypt, flipBits, setBits, shiftBack) 2 | 3 | import Bitwise 4 | 5 | 6 | shiftBack amount value = 7 | Bitwise.shiftRightZfBy amount value 8 | 9 | 10 | setBits mask value = 11 | Bitwise.or mask value 12 | 13 | 14 | flipBits mask value = 15 | Bitwise.xor mask value 16 | 17 | 18 | clearBits mask value = 19 | mask 20 | |> Bitwise.complement 21 | |> Bitwise.and value 22 | 23 | 24 | decrypt secret = 25 | secret 26 | |> setBits 1996 27 | |> flipBits 2009 28 | |> shiftBack 5 29 | |> clearBits 17 30 | -------------------------------------------------------------------------------- /exercises/concept/secrets/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "stewartmurrie" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Secrets.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "exemplar": [ 13 | ".meta/Exemplar.elm" 14 | ] 15 | }, 16 | "forked_from": [ 17 | "java/secrets" 18 | ], 19 | "blurb": "Learn about bit manipulation by writing the software for an encryption device." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/concept/secrets/src/Secrets.elm: -------------------------------------------------------------------------------- 1 | module Secrets exposing (clearBits, decrypt, flipBits, setBits, shiftBack) 2 | 3 | 4 | shiftBack amount value = 5 | Debug.todo "Please implement shiftBack" 6 | 7 | 8 | setBits mask value = 9 | Debug.todo "Please implement setBits" 10 | 11 | 12 | flipBits mask value = 13 | Debug.todo "Please implement flipBits" 14 | 15 | 16 | clearBits mask value = 17 | Debug.todo "Please implement clearBits" 18 | 19 | 20 | decrypt secret = 21 | Debug.todo "Please implement decrypt" 22 | -------------------------------------------------------------------------------- /exercises/concept/secure-treasure-chest/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: opaque-types} 4 | -------------------------------------------------------------------------------- /exercises/concept/secure-treasure-chest/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge", 4 | "jiegillet" 5 | ], 6 | "files": { 7 | "solution": [ 8 | "src/SecureTreasureChest.elm" 9 | ], 10 | "test": [ 11 | "tests/Tests.elm" 12 | ], 13 | "exemplar": [ 14 | ".meta/Exemplar.elm" 15 | ] 16 | }, 17 | "icon": "tisbury-treasure-hunt", 18 | "blurb": "Learn how to create and use Opaque Types in Elm by creating a Treasure Chest" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/concept/secure-treasure-chest/src/SecureTreasureChest.elm: -------------------------------------------------------------------------------- 1 | module SecureTreasureChest exposing (..) 2 | 3 | 4 | type Password 5 | = TODO 6 | 7 | 8 | type SecureTreasureChest treasure 9 | = SecureTreasureChest String treasure 10 | 11 | 12 | createPassword passwordCandidate = 13 | Debug.todo "Please implement createPassword" 14 | 15 | 16 | createTreasure treasure password = 17 | Debug.todo "Please implement createTreasure" 18 | 19 | 20 | getTreasure passwordAttempt secureTreasureChest = 21 | Debug.todo "Please implement getTreasure" 22 | -------------------------------------------------------------------------------- /exercises/concept/squeaky-clean/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: strings} 4 | -------------------------------------------------------------------------------- /exercises/concept/squeaky-clean/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "pwadsworth" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "ceddlyburge" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/SqueakyClean.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ] 19 | }, 20 | "blurb": "Learn about characters and strings by cleaning strings." 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/squeaky-clean/src/SqueakyClean.elm: -------------------------------------------------------------------------------- 1 | module SqueakyClean exposing (clean, clean1, clean2, clean3, clean4) 2 | 3 | 4 | clean1 : String -> String 5 | clean1 str = 6 | Debug.todo "Please implement this function" 7 | 8 | 9 | clean2 : String -> String 10 | clean2 str = 11 | Debug.todo "Please implement this function" 12 | 13 | 14 | clean3 : String -> String 15 | clean3 str = 16 | Debug.todo "Please implement this function" 17 | 18 | 19 | clean4 : String -> String 20 | clean4 str = 21 | Debug.todo "Please implement this function" 22 | 23 | 24 | clean : String -> String 25 | clean str = 26 | Debug.todo "Please implement this function" 27 | -------------------------------------------------------------------------------- /exercises/concept/ticket-please/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: pattern-matching} 4 | -------------------------------------------------------------------------------- /exercises/concept/ticket-please/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mpizenberg", 4 | "jiegillet" 5 | ], 6 | "contributors": [ 7 | "ceddlyburge" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/TicketPlease.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ], 19 | "editor": [ 20 | "src/TicketPleaseSupport.elm" 21 | ] 22 | }, 23 | "icon": "sieve", 24 | "blurb": "Learn about pattern matching by improving your ticketing system." 25 | } 26 | -------------------------------------------------------------------------------- /exercises/concept/ticket-please/src/TicketPlease.elm: -------------------------------------------------------------------------------- 1 | module TicketPlease exposing (..) 2 | 3 | import TicketPleaseSupport exposing (Status(..), Ticket(..), User(..)) 4 | 5 | 6 | emptyComment : ( User, String ) -> Bool 7 | emptyComment = 8 | Debug.todo "Please implement the function emptyComment" 9 | 10 | 11 | numberOfCreatorComments : Ticket -> Int 12 | numberOfCreatorComments = 13 | Debug.todo "Please implement the function numberOfCreatorComments" 14 | 15 | 16 | assignedToDevTeam : Ticket -> Bool 17 | assignedToDevTeam = 18 | Debug.todo "Please implement the function assignedToDevTeam" 19 | 20 | 21 | assignTicketTo : User -> Ticket -> Ticket 22 | assignTicketTo = 23 | Debug.todo "Please implement the function assignTicketTo" 24 | -------------------------------------------------------------------------------- /exercises/concept/ticket-please/src/TicketPleaseSupport.elm: -------------------------------------------------------------------------------- 1 | module TicketPleaseSupport exposing (Status(..), Ticket(..), User(..)) 2 | 3 | 4 | type Ticket 5 | = Ticket 6 | { status : Status 7 | , createdBy : ( User, Int ) 8 | , assignedTo : Maybe User 9 | , comments : List ( User, String ) 10 | } 11 | 12 | 13 | type Status 14 | = New 15 | | InProgress 16 | | Resolved 17 | | Closed 18 | | Archived 19 | 20 | 21 | type User 22 | = User String 23 | -------------------------------------------------------------------------------- /exercises/concept/tisbury-treasure-hunt/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | [a concise introduction to tuples][tuples] 4 | 5 | ## 3. Count Treasure Locations 6 | 7 | - You can use `Tuple.second` with `List.map` to get a list of all the second values from a list of tuples 8 | 9 | ## 4. Special Places 10 | 11 | - [simplifying code with ad-hoc tuples][ad-hoc-tuples] 12 | 13 | [tuples]: [https://www.bekk.christmas/post/2020/1/once-twice-three-times-a-value] 14 | [ad-hoc-tuples]: https://www.bekk.christmas/post/2020/7/simplify-your-code-with-ad-hoc-tuples 15 | -------------------------------------------------------------------------------- /exercises/concept/tisbury-treasure-hunt/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: tuples} 4 | -------------------------------------------------------------------------------- /exercises/concept/tisbury-treasure-hunt/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/TisburyTreasureHunt.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "forked_from": [ 20 | "python/tisbury-treasure-hunt" 21 | ], 22 | "blurb": "Learn usage of Tuples by designing a pirate treasure game" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/concept/tisbury-treasure-hunt/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Goal 4 | 5 | Introduce the student to tuples and how to work with them. 6 | 7 | ## Learning objectives 8 | 9 | - know how to write tuple type annotations 10 | - know how to create tuples 11 | - know how to destructure tuples 12 | 13 | ## Concepts 14 | 15 | - `tuples` 16 | 17 | ## Prerequisites 18 | 19 | - `basics-2` 20 | - `lists` 21 | -------------------------------------------------------------------------------- /exercises/concept/top-scorers/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: dict} 4 | -------------------------------------------------------------------------------- /exercises/concept/top-scorers/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg", 7 | "jiegillet" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/TopScorers.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "exemplar": [ 17 | ".meta/Exemplar.elm" 18 | ], 19 | "editor": [ 20 | "src/TopScorersSupport.elm" 21 | ] 22 | }, 23 | "icon": "football-match-reports", 24 | "blurb": "Learn usage of Dict by keeping track of how many goals players have scored." 25 | } 26 | -------------------------------------------------------------------------------- /exercises/concept/top-scorers/src/TopScorersSupport.elm: -------------------------------------------------------------------------------- 1 | module TopScorersSupport exposing (..) 2 | 3 | 4 | type alias PlayerName = 5 | String 6 | -------------------------------------------------------------------------------- /exercises/concept/tracks-on-tracks-on-tracks/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: lists} 4 | -------------------------------------------------------------------------------- /exercises/concept/tracks-on-tracks-on-tracks/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/TracksOnTracksOnTracks.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "forked_from": [ 20 | "fsharp/tracks-on-tracks-on-tracks" 21 | ], 22 | "blurb": "Learn usage of List while keeping track of programming languages to learn on Exercism" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/concept/tracks-on-tracks-on-tracks/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Learning objectives 4 | 5 | - Know of the existence of the `List` type. 6 | - Know that lists are immutable. 7 | - Know what head and tail refer to. 8 | - Know how to define an empty and non-empty list. 9 | - Know how to add an element to a list. 10 | - Know some common list functions (counting, reversing). 11 | - Know how to pattern match on lists. 12 | 13 | ## Out of scope 14 | 15 | - Iterating over lists. 16 | - Concatenating lists. 17 | - Recursion. 18 | - Higher-order list functions. 19 | - Memory and performance characteristics. 20 | 21 | ## Concepts 22 | 23 | - `lists` 24 | 25 | ## Prerequisites 26 | 27 | - `basics-2` 28 | -------------------------------------------------------------------------------- /exercises/concept/treasure-chest/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: generics} 4 | -------------------------------------------------------------------------------- /exercises/concept/treasure-chest/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module TreasureChest exposing (..) 2 | 3 | 4 | type TreasureChest treasure 5 | = TreasureChest String treasure 6 | 7 | 8 | getTreasure : String -> TreasureChest a -> Maybe a 9 | getTreasure passwordAttempt (TreasureChest password treasure) = 10 | if passwordAttempt == password then 11 | Just treasure 12 | 13 | else 14 | Nothing 15 | 16 | 17 | multiplyTreasure : (a -> List a) -> TreasureChest a -> TreasureChest (List a) 18 | multiplyTreasure multiplier (TreasureChest password treasure) = 19 | TreasureChest 20 | password 21 | (multiplier treasure) 22 | -------------------------------------------------------------------------------- /exercises/concept/treasure-chest/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge", 4 | "mpizenberg", 5 | "jiegillet" 6 | ], 7 | "files": { 8 | "solution": [ 9 | "src/TreasureChest.elm" 10 | ], 11 | "test": [ 12 | "tests/Tests.elm" 13 | ], 14 | "exemplar": [ 15 | ".meta/Exemplar.elm" 16 | ] 17 | }, 18 | "icon": "tisbury-treasure-hunt", 19 | "blurb": "Learn how to create and use Elm code that is generic by creating a Treasure Chest" 20 | } 21 | -------------------------------------------------------------------------------- /exercises/concept/treasure-chest/src/TreasureChest.elm: -------------------------------------------------------------------------------- 1 | module TreasureChest exposing (..) 2 | 3 | 4 | type TreasureChest 5 | = TODO 6 | 7 | 8 | getTreasure passwordAttempt = 9 | Debug.todo "Please implement getTreasure" 10 | 11 | 12 | multiplyTreasure multiplier treasureChest = 13 | Debug.todo "Please implement multiplyTreasure" 14 | -------------------------------------------------------------------------------- /exercises/concept/treasure-factory/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: phantom-types} 4 | -------------------------------------------------------------------------------- /exercises/concept/treasure-factory/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/TreasureFactory.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "icon": "tisbury-treasure-hunt", 20 | "blurb": "Learn the phantom types technique by creating treasure chests for your evil dungeons" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/concept/valentines-day/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | ## 1. Define the approval 4 | 5 | - [Custom Types][custom-types] shows how to define a new Custom Type. 6 | 7 | ## 4. Define the activity 8 | 9 | - [Custom Types][custom-types] shows how to define a new Custom Type with associated data 10 | 11 | ## 5. Rate the activity 12 | 13 | - The best way to execute logic based on the activity's value is to use [pattern matching][pattern-matching]. 14 | 15 | [custom-types]: https://guide.elm-lang.org/types/custom_types.html 16 | [pattern-matching]: https://guide.elm-lang.org/types/pattern_matching.html 17 | -------------------------------------------------------------------------------- /exercises/concept/valentines-day/.docs/introduction.md.tpl: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | %{concept: custom-types} 4 | -------------------------------------------------------------------------------- /exercises/concept/valentines-day/.meta/Exemplar.elm: -------------------------------------------------------------------------------- 1 | module ValentinesDay exposing (..) 2 | 3 | 4 | type Approval 5 | = Yes 6 | | No 7 | | Maybe 8 | 9 | 10 | type Cuisine 11 | = Korean 12 | | Turkish 13 | 14 | 15 | type Genre 16 | = Crime 17 | | Horror 18 | | Romance 19 | | Thriller 20 | 21 | 22 | type Activity 23 | = BoardGame 24 | | Chill 25 | | Movie Genre 26 | | Restaurant Cuisine 27 | 28 | 29 | rateActivity : Activity -> Approval 30 | rateActivity activity = 31 | case activity of 32 | Restaurant Korean -> 33 | Yes 34 | 35 | Restaurant Turkish -> 36 | Maybe 37 | 38 | Movie Romance -> 39 | Yes 40 | 41 | _ -> 42 | No 43 | -------------------------------------------------------------------------------- /exercises/concept/valentines-day/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "ceddlyburge" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/ValentinesDay.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "exemplar": [ 16 | ".meta/Exemplar.elm" 17 | ] 18 | }, 19 | "forked_from": [ 20 | "fsharp/valentines-day" 21 | ], 22 | "blurb": "Learn usage of Custom Types while deciding what to do for Valentines Day" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/concept/valentines-day/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Learning objectives 4 | 5 | - Know what Custom Types are. 6 | - Know how to define a Custom Type, with and without data. 7 | - Know how to pattern match on Custom Types. 8 | 9 | ## Out of scope 10 | 11 | - Opaque Types. 12 | - Phantom Types. 13 | 14 | ## Concepts 15 | 16 | - `custom-types` 17 | 18 | ## Prerequisites 19 | 20 | - `basics-2` 21 | -------------------------------------------------------------------------------- /exercises/concept/valentines-day/src/ValentinesDay.elm: -------------------------------------------------------------------------------- 1 | module ValentinesDay exposing (..) 2 | 3 | 4 | rateActivity activity = 5 | Debug.todo "implement this function and create a type annotation" 6 | -------------------------------------------------------------------------------- /exercises/practice/accumulate/.meta/src/Accumulate.example.elm: -------------------------------------------------------------------------------- 1 | module Accumulate exposing (accumulate) 2 | 3 | 4 | accumulate : (a -> b) -> List a -> List b 5 | accumulate = 6 | List.map 7 | -------------------------------------------------------------------------------- /exercises/practice/accumulate/src/Accumulate.elm: -------------------------------------------------------------------------------- 1 | module Accumulate exposing (accumulate) 2 | 3 | 4 | accumulate : (a -> b) -> List a -> List b 5 | accumulate func input = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "tuxagon" 4 | ], 5 | "contributors": [ 6 | "nathanielknight" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/Acronym.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/Acronym.example.elm" 17 | ] 18 | }, 19 | "blurb": "Convert a long phrase to its acronym.", 20 | "source": "Julien Vanier", 21 | "source_url": "https://github.com/monkbroc" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/acronym/.meta/src/Acronym.example.elm: -------------------------------------------------------------------------------- 1 | module Acronym exposing (abbreviate) 2 | 3 | import Regex exposing (Regex) 4 | import String 5 | 6 | 7 | abbreviate : String -> String 8 | abbreviate phrase = 9 | phrase 10 | |> Regex.split dashOrSpace 11 | |> List.map firstLetter 12 | |> String.concat 13 | 14 | 15 | firstLetter : String -> String 16 | firstLetter word = 17 | case String.uncons word of 18 | Just ( letter, _ ) -> 19 | String.toUpper <| String.fromChar letter 20 | 21 | Nothing -> 22 | "" 23 | 24 | 25 | dashOrSpace : Regex 26 | dashOrSpace = 27 | Maybe.withDefault Regex.never <| 28 | Regex.fromString "[ -]" 29 | -------------------------------------------------------------------------------- /exercises/practice/acronym/src/Acronym.elm: -------------------------------------------------------------------------------- 1 | module Acronym exposing (abbreviate) 2 | 3 | 4 | abbreviate : String -> String 5 | abbreviate phrase = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "mcmillhj" 4 | ], 5 | "contributors": [ 6 | "bobwhitelock", 7 | "nathanielknight", 8 | "tgecho", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/AllYourBase.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/AllYourBase.example.elm" 20 | ] 21 | }, 22 | "blurb": "Convert a number, represented as a sequence of digits in one base, to any other base." 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/all-your-base/src/AllYourBase.elm: -------------------------------------------------------------------------------- 1 | module AllYourBase exposing (rebase) 2 | 3 | 4 | rebase : Int -> List Int -> Int -> Maybe (List Int) 5 | rebase inBase digits outBase = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/allergies/.approaches/bitwise-and-case/snippet.txt: -------------------------------------------------------------------------------- 1 | toList : Int -> List Allergy 2 | toList score = 3 | [ 1, 2, 4, 8, 16, 32, 64, 128 ] 4 | |> List.filterMap ( \allergenInt -> intToAllergen (Bitwise.and score allergenInt)) 5 | -------------------------------------------------------------------------------- /exercises/practice/allergies/.approaches/bitwise-and-dict/snippet.txt: -------------------------------------------------------------------------------- 1 | allergies : Dict Int Allergy 2 | allergies = 3 | Dict.fromList [(1, Eggs), (2, Peanuts), (3, Shellfish), (4, Strawberries), (5, Tomatoes), (6, Chocolate), (7, Pollen), (8, Cats)] 4 | 5 | toList : Int -> List Allergy 6 | toList score = 7 | Dict.foldr (\key value list -> if Bitwise.and (2 ^ (key - 1)) score > 0 then (value :: list) else list) [] allergies 8 | -------------------------------------------------------------------------------- /exercises/practice/allergies/.approaches/bitwise-and-list/snippet.txt: -------------------------------------------------------------------------------- 1 | allergies = [ Eggs, Peanuts, Shellfish, Strawberries, Tomatoes, Chocolate, Pollen, Cats] 2 | 3 | toList : Int -> List Allergy 4 | toList score = 5 | allergies 6 | |> List.indexedMap (\i allergy -> ( 2 ^ i, allergy )) 7 | |> List.filter (\( allergyScore, _ ) -> Bitwise.and allergyScore score > 0) 8 | |> List.map Tuple.second 9 | -------------------------------------------------------------------------------- /exercises/practice/allergies/.approaches/bitwise-and-type-alias/snippet.txt: -------------------------------------------------------------------------------- 1 | allergiesAndScores = [AllergyAndScore Eggs 1, AllergyAndScore Peanuts 2, AllergyAndScore Shellfish 3, AllergyAndScore Strawberries 4, AllergyAndScore Tomatoes 5, AllergyAndScore Chocolate 6, AllergyAndScore Pollen 7, AllergyAndScore Cats 8] 2 | 3 | toList : Int -> List Allergy 4 | toList score = 5 | allergiesAndScores 6 | |> List.map (\{ bitPosition, allergy } -> ( 2 ^ (bitPosition - 1), allergy )) 7 | |> List.filter (\( s, _ ) -> Bitwise.and s score > 0) 8 | |> List.map Tuple.second 9 | -------------------------------------------------------------------------------- /exercises/practice/allergies/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "edgerunner", 7 | "kahgoh", 8 | "nathanielknight", 9 | "parkerl", 10 | "tuxagon" 11 | ], 12 | "files": { 13 | "solution": [ 14 | "src/Allergies.elm" 15 | ], 16 | "test": [ 17 | "tests/Tests.elm" 18 | ], 19 | "example": [ 20 | ".meta/src/Allergies.example.elm" 21 | ] 22 | }, 23 | "blurb": "Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.", 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/allergies/src/Allergies.elm: -------------------------------------------------------------------------------- 1 | module Allergies exposing (Allergy(..), isAllergicTo, toList) 2 | 3 | 4 | type Allergy 5 | = Eggs 6 | | Peanuts 7 | | Shellfish 8 | | Strawberries 9 | | Tomatoes 10 | | Chocolate 11 | | Pollen 12 | | Cats 13 | 14 | 15 | isAllergicTo : Allergy -> Int -> Bool 16 | isAllergicTo allergy score = 17 | Debug.todo "Please implement this function" 18 | 19 | 20 | toList : Int -> List Allergy 21 | toList score = 22 | Debug.todo "Please implement this function" 23 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "parkerl", 8 | "thomchop", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/Anagram.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/Anagram.example.elm" 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/.meta/src/Anagram.example.elm: -------------------------------------------------------------------------------- 1 | module Anagram exposing (detect) 2 | 3 | import String exposing (toList, toLower) 4 | 5 | 6 | detect : String -> List String -> List String 7 | detect word candidates = 8 | let 9 | original = 10 | toLower word 11 | 12 | ref = 13 | normalize word 14 | in 15 | List.filter (\w -> normalize w == ref && toLower w /= original) candidates 16 | 17 | 18 | normalize : String -> List Char 19 | normalize word = 20 | word |> toLower |> toList |> List.sort 21 | -------------------------------------------------------------------------------- /exercises/practice/anagram/src/Anagram.elm: -------------------------------------------------------------------------------- 1 | module Anagram exposing (detect) 2 | 3 | 4 | detect : String -> List String -> List String 5 | detect word candidates = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "CharlonTank" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/ArmstrongNumbers.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/ArmstrongNumbers.example.elm" 17 | ] 18 | }, 19 | "blurb": "Determine if a number is an Armstrong number.", 20 | "source": "Wikipedia", 21 | "source_url": "https://en.wikipedia.org/wiki/Narcissistic_number" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.meta/src/ArmstrongNumbers.example.elm: -------------------------------------------------------------------------------- 1 | module ArmstrongNumbers exposing (isArmstrongNumber) 2 | 3 | 4 | isArmstrongNumber : Int -> Bool 5 | isArmstrongNumber nb = 6 | let 7 | ( digits, nbDigits ) = 8 | digitsAndLength nb 9 | in 10 | nb == List.sum (List.map (\a -> a ^ nbDigits) digits) 11 | 12 | 13 | digitsAndLength : Int -> ( List Int, Int ) 14 | digitsAndLength nb = 15 | if nb < 10 then 16 | ( [ nb ], 1 ) 17 | 18 | else 19 | let 20 | ( digits, n ) = 21 | digitsAndLength (nb // 10) 22 | in 23 | ( modBy 10 nb :: digits, 1 + n ) 24 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/src/ArmstrongNumbers.elm: -------------------------------------------------------------------------------- 1 | module ArmstrongNumbers exposing (isArmstrongNumber) 2 | 3 | 4 | isArmstrongNumber : Int -> Bool 5 | isArmstrongNumber nb = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tuxagon" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/AtbashCipher.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/AtbashCipher.example.elm" 18 | ] 19 | }, 20 | "blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.", 21 | "source": "Wikipedia", 22 | "source_url": "https://en.wikipedia.org/wiki/Atbash" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/src/AtbashCipher.elm: -------------------------------------------------------------------------------- 1 | module AtbashCipher exposing (decode, encode) 2 | 3 | 4 | encode : String -> String 5 | encode plain = 6 | Debug.todo "Please implement this function" 7 | 8 | 9 | decode : String -> String 10 | decode cipher = 11 | Debug.todo "Please implement this function" 12 | -------------------------------------------------------------------------------- /exercises/practice/binary-search-tree/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/BinarySearchTree.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/BinarySearchTree.example.elm" 14 | ] 15 | }, 16 | "blurb": "Insert and search for numbers in a binary tree.", 17 | "source": "Josh Cheek" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/binary-search-tree/src/BinarySearchTree.elm: -------------------------------------------------------------------------------- 1 | module BinarySearchTree exposing (BinaryTree(..), makeTree, sort) 2 | 3 | 4 | type BinaryTree 5 | = Empty 6 | | Tree BinaryTree Int BinaryTree 7 | 8 | 9 | makeTree : List Int -> BinaryTree 10 | makeTree data = 11 | Debug.todo "Please implement makeTree" 12 | 13 | 14 | sort : List Int -> List Int 15 | sort data = 16 | Debug.todo "Please implement sort" 17 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "churchie317" 4 | ], 5 | "contributors": [ 6 | "michaelglass", 7 | "nathanielknight", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/BinarySearch.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/BinarySearch.example.elm" 19 | ] 20 | }, 21 | "blurb": "Implement a binary search algorithm.", 22 | "source": "Wikipedia", 23 | "source_url": "https://en.wikipedia.org/wiki/Binary_search_algorithm" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/binary-search/src/BinarySearch.elm: -------------------------------------------------------------------------------- 1 | module BinarySearch exposing (find) 2 | 3 | import Array exposing (Array) 4 | 5 | 6 | find : Int -> Array Int -> Maybe Int 7 | find target xs = 8 | Debug.todo "Please implement this function" 9 | -------------------------------------------------------------------------------- /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 | "parkerl" 4 | ], 5 | "contributors": [ 6 | "churchie317", 7 | "gilesbowkett", 8 | "kytrinyx", 9 | "leojpod", 10 | "nathanielknight", 11 | "tgecho", 12 | "thomchop", 13 | "tuxagon" 14 | ], 15 | "files": { 16 | "solution": [ 17 | "src/Bob.elm" 18 | ], 19 | "test": [ 20 | "tests/Tests.elm" 21 | ], 22 | "example": [ 23 | ".meta/src/Bob.example.elm" 24 | ] 25 | }, 26 | "blurb": "Bob is a lackadaisical teenager. In conversation, his responses are very limited.", 27 | "source": "Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial.", 28 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=06" 29 | } 30 | -------------------------------------------------------------------------------- /exercises/practice/bob/src/Bob.elm: -------------------------------------------------------------------------------- 1 | module Bob exposing (hey) 2 | 3 | 4 | hey : String -> String 5 | hey remark = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/bowling/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "leojpod" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge", 7 | "jiegillet" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/Bowling.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/Bowling.example2.elm", 18 | ".meta/src/Bowling.example3.elm", 19 | ".meta/src/Bowling.example.elm" 20 | ] 21 | }, 22 | "blurb": "Score a bowling game.", 23 | "source": "The Bowling Game Kata from UncleBob", 24 | "source_url": "https://web.archive.org/web/20221001111000/http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/bowling/src/Bowling.elm: -------------------------------------------------------------------------------- 1 | module Bowling exposing (Rolls, score) 2 | 3 | 4 | type alias Rolls = 5 | List Int 6 | 7 | 8 | score : Rolls -> Maybe Int 9 | score rolls = 10 | Debug.todo "implement this function" 11 | -------------------------------------------------------------------------------- /exercises/practice/circular-buffer/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/CircularBuffer.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/CircularBuffer.example.elm" 14 | ] 15 | }, 16 | "blurb": "A data structure that uses a single, fixed-size buffer as if it were connected end-to-end.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Circular_buffer" 19 | } 20 | -------------------------------------------------------------------------------- /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 | "mortenaa" 4 | ], 5 | "contributors": [ 6 | "kytrinyx", 7 | "nathanielknight", 8 | "tgecho", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/CollatzConjecture.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/CollatzConjecture.example.elm" 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/src/CollatzConjecture.example.elm: -------------------------------------------------------------------------------- 1 | module CollatzConjecture exposing (collatz) 2 | 3 | 4 | collatz : Int -> Result String Int 5 | collatz start = 6 | if start <= 0 then 7 | Err "Only positive integers are allowed" 8 | 9 | else 10 | Ok (collatzHelper 0 start) 11 | 12 | 13 | collatzHelper : Int -> Int -> Int 14 | collatzHelper steps start = 15 | if start == 1 then 16 | steps 17 | 18 | else if modBy 2 start == 0 then 19 | collatzHelper (1 + steps) (start // 2) 20 | 21 | else 22 | collatzHelper (1 + steps) (3 * start + 1) 23 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/src/CollatzConjecture.elm: -------------------------------------------------------------------------------- 1 | module CollatzConjecture exposing (collatz) 2 | 3 | 4 | collatz : Int -> Result String Int 5 | collatz start = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/complex-numbers/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/ComplexNumbers.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/ComplexNumbers.example.elm" 14 | ] 15 | }, 16 | "blurb": "Implement complex numbers.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Complex_number" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/custom-set/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Create a custom set type. 4 | 5 | Sometimes it is necessary to define a custom data structure of some type, like a set. 6 | In this exercise you will define your own set. 7 | How it works internally doesn't matter, as long as it behaves like a set of unique elements. 8 | -------------------------------------------------------------------------------- /exercises/practice/custom-set/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/CustomSet.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/CustomSet.example.elm" 17 | ] 18 | }, 19 | "blurb": "Create a custom set type." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/darts/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Darts.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Darts.example.elm" 14 | ] 15 | }, 16 | "blurb": "Calculate the points scored in a single toss of a Darts game.", 17 | "source": "Inspired by an exercise created by a professor Della Paolera in Argentina" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/darts/.meta/src/Darts.example.elm: -------------------------------------------------------------------------------- 1 | module Darts exposing (score) 2 | 3 | 4 | score : Float -> Float -> Int 5 | score x y = 6 | let 7 | distance = 8 | x * x + y * y 9 | in 10 | if distance > 100 then 11 | 0 12 | 13 | else if distance > 25 then 14 | 1 15 | 16 | else if distance > 1 then 17 | 5 18 | 19 | else 20 | 10 21 | -------------------------------------------------------------------------------- /exercises/practice/darts/src/Darts.elm: -------------------------------------------------------------------------------- 1 | module Darts exposing (score) 2 | 3 | 4 | score : Float -> Float -> Int 5 | score x y = 6 | Debug.todo "Please implement score" 7 | -------------------------------------------------------------------------------- /exercises/practice/diamond/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Diamond.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Diamond.example.elm" 14 | ] 15 | }, 16 | "blurb": "Given a letter, print a diamond starting with 'A' with the supplied letter at the widest point.", 17 | "source": "Seb Rose", 18 | "source_url": "https://web.archive.org/web/20220807163751/http://claysnow.co.uk/recycling-tests-in-tdd/" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/diamond/.meta/src/Diamond.example.elm: -------------------------------------------------------------------------------- 1 | module Diamond exposing (rows) 2 | 3 | import Char 4 | 5 | 6 | rows : Char -> String 7 | rows letter = 8 | let 9 | side = 10 | Char.toCode letter - aCode 11 | 12 | lines = 13 | List.range 0 side 14 | |> List.map 15 | (\i -> 16 | String.repeat (2 * i - 1) "_" 17 | |> String.pad (2 * i + 1) (Char.fromCode (aCode + i)) 18 | |> String.pad (2 * side + 1) '_' 19 | ) 20 | in 21 | (lines ++ (lines |> List.reverse |> List.drop 1)) 22 | |> String.join "\n" 23 | 24 | 25 | aCode : Int 26 | aCode = 27 | Char.toCode 'A' 28 | -------------------------------------------------------------------------------- /exercises/practice/diamond/src/Diamond.elm: -------------------------------------------------------------------------------- 1 | module Diamond exposing (rows) 2 | 3 | 4 | rows : Char -> String 5 | rows letter = 6 | Debug.todo "Please implement rows" 7 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "parkerl", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/DifferenceOfSquares.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/DifferenceOfSquares.example.elm" 19 | ] 20 | }, 21 | "blurb": "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.", 22 | "source": "Problem 6 at Project Euler", 23 | "source_url": "https://projecteuler.net/problem=6" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.meta/src/DifferenceOfSquares.example.elm: -------------------------------------------------------------------------------- 1 | module DifferenceOfSquares exposing (difference, squareOfSum, sumOfSquares) 2 | 3 | 4 | squareOfSum : Int -> Int 5 | squareOfSum n = 6 | let 7 | sum = 8 | n * (n + 1) // 2 9 | in 10 | sum * sum 11 | 12 | 13 | sumOfSquares : Int -> Int 14 | sumOfSquares n = 15 | List.sum (List.map (\m -> m * m) (List.range 0 n)) 16 | 17 | 18 | difference : Int -> Int 19 | difference n = 20 | squareOfSum n - sumOfSquares n 21 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/src/DifferenceOfSquares.elm: -------------------------------------------------------------------------------- 1 | module DifferenceOfSquares exposing (difference, squareOfSum, sumOfSquares) 2 | 3 | 4 | squareOfSum : Int -> Int 5 | squareOfSum n = 6 | Debug.todo "Please implement this function" 7 | 8 | 9 | sumOfSquares : Int -> Int 10 | sumOfSquares n = 11 | Debug.todo "Please implement this function" 12 | 13 | 14 | difference : Int -> Int 15 | difference n = 16 | Debug.todo "Please implement this function" 17 | -------------------------------------------------------------------------------- /exercises/practice/dnd-character/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge", 7 | "mpizenberg" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/DndCharacter.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/DndCharacter.example.elm" 18 | ] 19 | }, 20 | "blurb": "Randomly generate Dungeons & Dragons characters.", 21 | "source": "Simon Shine, Erik Schierboom", 22 | "source_url": "https://github.com/exercism/problem-specifications/issues/616#issuecomment-437358945" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/dnd-character/src/DndCharacter.elm: -------------------------------------------------------------------------------- 1 | module DndCharacter exposing (Character, ability, character, modifier) 2 | 3 | import Random exposing (Generator) 4 | 5 | 6 | type alias Character = 7 | { strength : Int 8 | , dexterity : Int 9 | , constitution : Int 10 | , intelligence : Int 11 | , wisdom : Int 12 | , charisma : Int 13 | , hitpoints : Int 14 | } 15 | 16 | 17 | modifier : Int -> Int 18 | modifier score = 19 | Debug.todo "Please implement modifier" 20 | 21 | 22 | ability : Generator Int 23 | ability = 24 | Random.lazy (\_ -> Debug.todo "Please implement ability") 25 | 26 | 27 | character : Generator Character 28 | character = 29 | Random.lazy (\_ -> Debug.todo "Please implement character") 30 | -------------------------------------------------------------------------------- /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 | "BNAndras" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge", 7 | "jiegillet" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/EliudsEggs.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/EliudsEggs.example.elm" 18 | ] 19 | }, 20 | "blurb": "Help Eliud count the number of eggs in her chicken coop by counting the number of 1 bits in a binary representation.", 21 | "source": "Christian Willner, Eric Willigers", 22 | "source_url": "https://forum.exercism.org/t/new-exercise-suggestion-pop-count/7632/5" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/.meta/src/EliudsEggs.example.elm: -------------------------------------------------------------------------------- 1 | module EliudsEggs exposing (eggCount) 2 | 3 | 4 | eggCount : Int -> Int 5 | eggCount n = 6 | doEggCount n 0 7 | 8 | 9 | doEggCount : Int -> Int -> Int 10 | doEggCount value eggs = 11 | if value == 0 then 12 | eggs 13 | 14 | else if modBy 2 value == 0 then 15 | doEggCount (value // 2) eggs 16 | 17 | else 18 | doEggCount (value // 2) (eggs + 1) 19 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/src/EliudsEggs.elm: -------------------------------------------------------------------------------- 1 | module EliudsEggs exposing (eggCount) 2 | 3 | 4 | eggCount : Int -> Int 5 | eggCount n = 6 | Debug.todo "implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/eliuds-eggs/tests/Tests.elm: -------------------------------------------------------------------------------- 1 | module Tests exposing (tests) 2 | 3 | import EliudsEggs exposing (eggCount) 4 | import Expect 5 | import Test exposing (Test, describe, skip, test) 6 | 7 | 8 | tests : Test 9 | tests = 10 | describe "Pop Count" 11 | [ test "0 eggs" <| 12 | \() -> Expect.equal 0 (eggCount 0) 13 | , skip <| 14 | test "1 egg" <| 15 | \() -> Expect.equal 1 (eggCount 16) 16 | , skip <| 17 | test "4 eggs" <| 18 | \() -> Expect.equal 4 (eggCount 89) 19 | , skip <| 20 | test "13 eggs" <| 21 | \() -> Expect.equal 13 (eggCount 2000000000) 22 | ] 23 | -------------------------------------------------------------------------------- /exercises/practice/etl/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tuxagon" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/Etl.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/Etl.example.elm" 18 | ] 19 | }, 20 | "blurb": "Change the data format for scoring a game to more easily add other languages.", 21 | "source": "Based on an exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 22 | "source_url": "https://turing.edu" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/etl/.meta/src/Etl.example.elm: -------------------------------------------------------------------------------- 1 | module Etl exposing (transform) 2 | 3 | import Dict exposing (Dict) 4 | 5 | 6 | transform : Dict Int (List String) -> Dict String Int 7 | transform input = 8 | Dict.foldl addLetters Dict.empty input 9 | 10 | 11 | addLetters : Int -> List String -> Dict String Int -> Dict String Int 12 | addLetters score letters output = 13 | letters 14 | |> List.map String.toLower 15 | |> List.foldl (\letter output_ -> Dict.insert letter score output_) output 16 | -------------------------------------------------------------------------------- /exercises/practice/etl/.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 | [78a7a9f9-4490-4a47-8ee9-5a38bb47d28f] 6 | description = "single letter" 7 | 8 | [60dbd000-451d-44c7-bdbb-97c73ac1f497] 9 | description = "single score with multiple letters" 10 | 11 | [f5c5de0c-301f-4fdd-a0e5-df97d4214f54] 12 | description = "multiple scores with multiple letters" 13 | 14 | [5db8ea89-ecb4-4dcd-902f-2b418cc87b9d] 15 | description = "multiple scores with differing numbers of letters" 16 | -------------------------------------------------------------------------------- /exercises/practice/etl/src/Etl.elm: -------------------------------------------------------------------------------- 1 | module Etl exposing (transform) 2 | 3 | import Dict exposing (Dict) 4 | 5 | 6 | transform : Dict Int (List String) -> Dict String Int 7 | transform input = 8 | Debug.todo "Please implement this function" 9 | -------------------------------------------------------------------------------- /exercises/practice/food-chain/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/FoodChain.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/FoodChain.example.elm" 14 | ] 15 | }, 16 | "blurb": "Generate the lyrics of the song 'I Know an Old Lady Who Swallowed a Fly'.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/food-chain/src/FoodChain.elm: -------------------------------------------------------------------------------- 1 | module FoodChain exposing (recite) 2 | 3 | 4 | recite : Int -> Int -> String 5 | recite startVerse endVerse = 6 | Debug.todo "Please implement recite" 7 | -------------------------------------------------------------------------------- /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/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jehoshua02" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tgecho", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/Gigasecond.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/Gigasecond.example.elm" 19 | ] 20 | }, 21 | "blurb": "Given a moment, determine the moment that would be after a gigasecond has passed.", 22 | "source": "Chapter 9 in Chris Pine's online Learn to Program tutorial.", 23 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=09" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/.meta/src/Gigasecond.example.elm: -------------------------------------------------------------------------------- 1 | module Gigasecond exposing (add) 2 | 3 | import Time 4 | 5 | 6 | add : Time.Posix -> Time.Posix 7 | add timestamp = 8 | timestamp 9 | |> Time.posixToMillis 10 | |> (+) gigasecond 11 | |> Time.millisToPosix 12 | 13 | 14 | gigasecond : Int 15 | gigasecond = 16 | 10 ^ 12 17 | -------------------------------------------------------------------------------- /exercises/practice/gigasecond/src/Gigasecond.elm: -------------------------------------------------------------------------------- 1 | module Gigasecond exposing (add) 2 | 3 | import Time 4 | 5 | 6 | add : Time.Posix -> Time.Posix 7 | add timestamp = 8 | Debug.todo "Please implement this function" 9 | -------------------------------------------------------------------------------- /exercises/practice/grade-school/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "leojpod", 8 | "nathanielknight", 9 | "parkerl", 10 | "SiriusStarr", 11 | "tuxagon" 12 | ], 13 | "files": { 14 | "solution": [ 15 | "src/GradeSchool.elm" 16 | ], 17 | "test": [ 18 | "tests/Tests.elm" 19 | ], 20 | "example": [ 21 | ".meta/src/GradeSchool.example.elm" 22 | ] 23 | }, 24 | "blurb": "Given students' names along with the grade that they are in, create a roster for the school.", 25 | "source": "A pairing session with Phil Battos at gSchool" 26 | } 27 | -------------------------------------------------------------------------------- /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 | "ErikSchierboom" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tgecho", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/Grains.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/Grains.example.elm" 19 | ] 20 | }, 21 | "blurb": "Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.", 22 | "source": "The CodeRanch Cattle Drive, Assignment 6", 23 | "source_url": "https://web.archive.org/web/20240908084142/https://coderanch.com/wiki/718824/Grains" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/grains/.meta/src/Grains.example.elm: -------------------------------------------------------------------------------- 1 | module Grains exposing (square) 2 | 3 | 4 | square : Int -> Maybe Int 5 | square n = 6 | if n < 1 then 7 | Nothing 8 | 9 | else 10 | Just <| 2 ^ (n - 1) 11 | -------------------------------------------------------------------------------- /exercises/practice/grains/src/Grains.elm: -------------------------------------------------------------------------------- 1 | module Grains exposing (square) 2 | 3 | 4 | square : Int -> Maybe Int 5 | square n = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Your body is made up of cells that contain DNA. 4 | Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells. 5 | In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime! 6 | 7 | When cells divide, their DNA replicates too. 8 | Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information. 9 | If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred. 10 | This is known as the "Hamming distance". 11 | 12 | The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :) 13 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "nathanielknight", 8 | "parkerl", 9 | "petemcfarlane", 10 | "tuxagon" 11 | ], 12 | "files": { 13 | "solution": [ 14 | "src/Hamming.elm" 15 | ], 16 | "test": [ 17 | "tests/Tests.elm" 18 | ], 19 | "example": [ 20 | ".meta/src/Hamming.example.elm" 21 | ] 22 | }, 23 | "blurb": "Calculate the Hamming distance between two DNA strands.", 24 | "source": "The Calculating Point Mutations problem at Rosalind", 25 | "source_url": "https://rosalind.info/problems/hamm/" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.meta/src/Hamming.example.elm: -------------------------------------------------------------------------------- 1 | module Hamming exposing (distance) 2 | 3 | import String exposing (length, toList) 4 | 5 | 6 | distance : String -> String -> Result String Int 7 | distance left right = 8 | if length left /= length right then 9 | Err "strands must be of equal length" 10 | 11 | else 12 | List.map2 (\l r -> l /= r) (toList left) (toList right) 13 | |> List.filter identity 14 | |> List.length 15 | |> Ok 16 | -------------------------------------------------------------------------------- /exercises/practice/hamming/src/Hamming.elm: -------------------------------------------------------------------------------- 1 | module Hamming exposing (distance) 2 | 3 | 4 | distance : String -> String -> Result String Int 5 | distance left right = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "kytrinyx" 4 | ], 5 | "contributors": [ 6 | "benreyn", 7 | "nathanielknight", 8 | "parkerl", 9 | "tgecho", 10 | "TrevorBramble", 11 | "tuxagon" 12 | ], 13 | "files": { 14 | "solution": [ 15 | "src/HelloWorld.elm" 16 | ], 17 | "test": [ 18 | "tests/Tests.elm" 19 | ], 20 | "example": [ 21 | ".meta/src/HelloWorld.example.elm" 22 | ] 23 | }, 24 | "blurb": "Exercism's classic introductory exercise. Just say \"Hello, World!\".", 25 | "source": "This is an exercise to introduce users to using Exercism", 26 | "source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.meta/src/HelloWorld.example.elm: -------------------------------------------------------------------------------- 1 | module HelloWorld exposing (helloWorld) 2 | 3 | 4 | helloWorld : String 5 | helloWorld = 6 | "Hello, World!" 7 | -------------------------------------------------------------------------------- /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/src/HelloWorld.elm: -------------------------------------------------------------------------------- 1 | module HelloWorld exposing (helloWorld) 2 | 3 | 4 | helloWorld = 5 | "Goodbye, Mars!" 6 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/tests/Tests.elm: -------------------------------------------------------------------------------- 1 | module Tests exposing (tests) 2 | 3 | import Expect 4 | import HelloWorld exposing (helloWorld) 5 | import Test exposing (..) 6 | 7 | 8 | tests : Test 9 | tests = 10 | test "Hello, World!" <| 11 | \() -> 12 | Expect.equal "Hello, World!" helloWorld 13 | -------------------------------------------------------------------------------- /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 | "anuragsoni" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "nathanielknight", 8 | "tgecho", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/Isogram.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/Isogram.example.elm" 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/src/Isogram.elm: -------------------------------------------------------------------------------- 1 | module Isogram exposing (isIsogram) 2 | 3 | 4 | isIsogram : String -> Bool 5 | isIsogram sentence = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/KindergartenGarden.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/KindergartenGarden.example.elm" 14 | ] 15 | }, 16 | "blurb": "Given a diagram, determine which plants each child in the kindergarten class is responsible for.", 17 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 18 | "source_url": "https://turing.edu" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/src/KindergartenGarden.elm: -------------------------------------------------------------------------------- 1 | module KindergartenGarden exposing (Plant(..), Student(..), plants) 2 | 3 | 4 | type Student 5 | = Alice 6 | | Bob 7 | | Charlie 8 | | David 9 | | Eve 10 | | Fred 11 | | Ginny 12 | | Harriet 13 | | Ileana 14 | | Joseph 15 | | Kincaid 16 | | Larry 17 | 18 | 19 | type Plant 20 | = Grass 21 | | Clover 22 | | Radish 23 | | Violet 24 | 25 | 26 | plants : String -> Student -> List Plant 27 | plants diagram student = 28 | Debug.todo "Please implement plants" 29 | -------------------------------------------------------------------------------- /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 | "kahgoh" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Knapsack.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Knapsack.example.elm" 14 | ] 15 | }, 16 | "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.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Knapsack_problem" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/knapsack/src/Knapsack.elm: -------------------------------------------------------------------------------- 1 | module Knapsack exposing (Item, maximumValue) 2 | 3 | 4 | type alias Item = 5 | { value : Int 6 | , weight : Int 7 | } 8 | 9 | 10 | maximumValue : Int -> List Item -> Int 11 | maximumValue capacity items = 12 | Debug.todo "Please implement maximumValue" 13 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tuxagon" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/LargestSeriesProduct.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/LargestSeriesProduct.example.elm" 18 | ] 19 | }, 20 | "blurb": "Given a string of digits, calculate the largest product for a contiguous substring of digits of length n.", 21 | "source": "A variation on Problem 8 at Project Euler", 22 | "source_url": "https://projecteuler.net/problem=8" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/largest-series-product/src/LargestSeriesProduct.elm: -------------------------------------------------------------------------------- 1 | module LargestSeriesProduct exposing (largestProduct) 2 | 3 | 4 | largestProduct : Int -> String -> Maybe Int 5 | largestProduct length series = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/leap/.approaches/case-expression/snippet.txt: -------------------------------------------------------------------------------- 1 | case (isDivisibleByFour, isDivisibleBy100, isDivisibleBy400) of 2 | (True, _, True) -> True 3 | (True, False, _) -> True 4 | _ -> False 5 | -------------------------------------------------------------------------------- /exercises/practice/leap/.approaches/if-expression/snippet.txt: -------------------------------------------------------------------------------- 1 | if divisibleBy 100 then 2 | divisibleBy 400 3 | 4 | else 5 | divisibleBy 4 6 | -------------------------------------------------------------------------------- /exercises/practice/leap/.approaches/logical-expression/snippet.txt: -------------------------------------------------------------------------------- 1 | isLeapYear : Int -> Bool 2 | isLeapYear year = 3 | let 4 | divisibleBy number = 5 | modBy number year == 0 6 | in 7 | divisibleBy 4 && (not (divisibleBy 100) || divisibleBy 400) 8 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "parkerl", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/Leap.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/Leap.example.elm" 19 | ] 20 | }, 21 | "blurb": "Determine whether a given year is a leap year.", 22 | "source": "CodeRanch Cattle Drive, Assignment 3", 23 | "source_url": "https://web.archive.org/web/20240907033714/https://coderanch.com/t/718816/Leap" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/leap/.meta/src/Leap.example.elm: -------------------------------------------------------------------------------- 1 | module Leap exposing (isLeapYear) 2 | 3 | 4 | isLeapYear : Int -> Bool 5 | isLeapYear year = 6 | modBy 4 year == 0 && (modBy 100 year /= 0 || modBy 400 year == 0) 7 | -------------------------------------------------------------------------------- /exercises/practice/leap/src/Leap.elm: -------------------------------------------------------------------------------- 1 | module Leap exposing (isLeapYear) 2 | 3 | 4 | isLeapYear : Int -> Bool 5 | isLeapYear year = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/list-ops/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jcshih" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tgecho", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/ListOps.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/ListOps.example.elm" 19 | ] 20 | }, 21 | "blurb": "Implement basic list operations." 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/luhn/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tuxagon" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "nathanielknight" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/Luhn.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/Luhn.example.elm" 18 | ] 19 | }, 20 | "blurb": "Given a number determine whether or not it is valid per the Luhn formula.", 21 | "source": "The Luhn Algorithm on Wikipedia", 22 | "source_url": "https://en.wikipedia.org/wiki/Luhn_algorithm" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/luhn/src/Luhn.elm: -------------------------------------------------------------------------------- 1 | module Luhn exposing (valid) 2 | 3 | 4 | valid : String -> Bool 5 | valid input = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "tuxagon" 4 | ], 5 | "contributors": [ 6 | "edgerunner", 7 | "jiegillet" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/MatchingBrackets.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/MatchingBrackets.example.elm" 18 | ] 19 | }, 20 | "blurb": "Make sure the brackets and braces all match.", 21 | "source": "Ginna Baker" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/matching-brackets/src/MatchingBrackets.elm: -------------------------------------------------------------------------------- 1 | module MatchingBrackets exposing (isPaired) 2 | 3 | 4 | isPaired : String -> Bool 5 | isPaired input = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/meetup/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Meetup.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Meetup.example.elm" 14 | ] 15 | }, 16 | "blurb": "Calculate the date of meetups.", 17 | "source": "Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month" 18 | } 19 | -------------------------------------------------------------------------------- /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 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Minesweeper.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Minesweeper.example.elm" 14 | ] 15 | }, 16 | "blurb": "Add the numbers to a minesweeper board." 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/src/Minesweeper.elm: -------------------------------------------------------------------------------- 1 | module Minesweeper exposing (annotate) 2 | 3 | 4 | annotate : String -> String 5 | annotate minefield = 6 | Debug.todo "Please implement annotate" 7 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "albronca", 7 | "nathanielknight", 8 | "NyuB", 9 | "parkerl", 10 | "tuxagon", 11 | "ulve" 12 | ], 13 | "files": { 14 | "solution": [ 15 | "src/NucleotideCount.elm" 16 | ], 17 | "test": [ 18 | "tests/Tests.elm" 19 | ], 20 | "example": [ 21 | ".meta/src/NucleotideCount.example.elm" 22 | ] 23 | }, 24 | "blurb": "Given a DNA string, compute how many times each nucleotide occurs in the string.", 25 | "source": "The Calculating DNA Nucleotides_problem at Rosalind", 26 | "source_url": "https://rosalind.info/problems/dna/" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/.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 | [3e5c30a8-87e2-4845-a815-a49671ade970] 6 | description = "empty strand" 7 | 8 | [a0ea42a6-06d9-4ac6-828c-7ccaccf98fec] 9 | description = "can count one nucleotide in single-character input" 10 | 11 | [eca0d565-ed8c-43e7-9033-6cefbf5115b5] 12 | description = "strand with repeated nucleotide" 13 | 14 | [40a45eac-c83f-4740-901a-20b22d15a39f] 15 | description = "strand with multiple nucleotides" 16 | 17 | [b4c47851-ee9e-4b0a-be70-a86e343bd851] 18 | description = "strand with invalid nucleotides" 19 | -------------------------------------------------------------------------------- /exercises/practice/nucleotide-count/src/NucleotideCount.elm: -------------------------------------------------------------------------------- 1 | module NucleotideCount exposing (nucleotideCounts) 2 | 3 | 4 | type alias NucleotideCounts = 5 | { a : Int 6 | , t : Int 7 | , c : Int 8 | , g : Int 9 | } 10 | 11 | 12 | nucleotideCounts : String -> Result String NucleotideCounts 13 | nucleotideCounts sequence = 14 | Debug.todo "Please implement this function" 15 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "bdukes", 7 | "duckmole", 8 | "liammccartney", 9 | "nathanielknight", 10 | "parkerl", 11 | "tuxagon" 12 | ], 13 | "files": { 14 | "solution": [ 15 | "src/Pangram.elm" 16 | ], 17 | "test": [ 18 | "tests/Tests.elm" 19 | ], 20 | "example": [ 21 | ".meta/src/Pangram.example.elm" 22 | ] 23 | }, 24 | "blurb": "Determine if a sentence is a pangram.", 25 | "source": "Wikipedia", 26 | "source_url": "https://en.wikipedia.org/wiki/Pangram" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/pangram/.meta/description.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma, 4 | "every letter") is a sentence using every letter of the alphabet at least once. 5 | The best known English pangram is: 6 | > The quick brown fox jumps over the lazy dog. 7 | 8 | The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case 9 | insensitive. Some input will contain non-ASCII symbols. 10 | -------------------------------------------------------------------------------- /exercises/practice/pangram/.meta/src/Pangram.example.elm: -------------------------------------------------------------------------------- 1 | module Pangram exposing (isPangram) 2 | 3 | import String exposing (contains, fromChar, toLower) 4 | 5 | 6 | isPangram : String -> Bool 7 | isPangram sentence = 8 | let 9 | normalized = 10 | toLower sentence 11 | in 12 | String.all (\c -> contains (fromChar c) normalized) alphabet 13 | 14 | 15 | alphabet : String 16 | alphabet = 17 | "abcdefghijklmnopqrstuvwxyz" 18 | -------------------------------------------------------------------------------- /exercises/practice/pangram/src/Pangram.elm: -------------------------------------------------------------------------------- 1 | module Pangram exposing (isPangram) 2 | 3 | 4 | isPangram : String -> Bool 5 | isPangram sentence = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "anuragsoni" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tgecho", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/PascalsTriangle.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/PascalsTriangle.example.elm" 19 | ] 20 | }, 21 | "blurb": "Compute Pascal's triangle up to a given number of rows.", 22 | "source": "Pascal's Triangle at Wolfram Math World", 23 | "source_url": "https://www.wolframalpha.com/input/?i=Pascal%27s+triangle" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/.meta/src/PascalsTriangle.example.elm: -------------------------------------------------------------------------------- 1 | module PascalsTriangle exposing (rows) 2 | 3 | import List 4 | 5 | 6 | nextRow : List Int -> List Int 7 | nextRow row = 8 | List.map2 (+) (0 :: row) (row ++ [ 0 ]) 9 | 10 | 11 | rows : Int -> List (List Int) 12 | rows n = 13 | let 14 | loop i row = 15 | if i == n then 16 | [] 17 | 18 | else 19 | row :: loop (i + 1) (nextRow row) 20 | in 21 | if n < 0 then 22 | [] 23 | 24 | else 25 | loop 0 [ 1 ] 26 | -------------------------------------------------------------------------------- /exercises/practice/pascals-triangle/src/PascalsTriangle.elm: -------------------------------------------------------------------------------- 1 | module PascalsTriangle exposing (rows) 2 | 3 | 4 | rows : Int -> List (List Int) 5 | rows n = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "mpizenberg", 7 | "mrattner", 8 | "nathanielknight", 9 | "parkerl", 10 | "Phippsaurus", 11 | "SiriusStarr", 12 | "tuxagon" 13 | ], 14 | "files": { 15 | "solution": [ 16 | "src/PhoneNumber.elm" 17 | ], 18 | "test": [ 19 | "tests/Tests.elm" 20 | ], 21 | "example": [ 22 | ".meta/src/PhoneNumber.example.elm" 23 | ] 24 | }, 25 | "blurb": "Clean up user-entered phone numbers so that they can be sent SMS messages.", 26 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 27 | "source_url": "https://turing.edu" 28 | } 29 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/src/PhoneNumber.elm: -------------------------------------------------------------------------------- 1 | module PhoneNumber exposing (getNumber) 2 | 3 | 4 | getNumber : String -> Maybe String 5 | getNumber phoneNumber = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/PigLatin.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/PigLatin.example.elm" 14 | ] 15 | }, 16 | "blurb": "Implement a program that translates from English to Pig Latin.", 17 | "source": "The Pig Latin exercise at Test First Teaching by Ultrasaurus", 18 | "source_url": "https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/pig-latin/src/PigLatin.elm: -------------------------------------------------------------------------------- 1 | module PigLatin exposing (translate) 2 | 3 | 4 | translate : String -> String 5 | translate input = 6 | Debug.todo "Please implement translate" 7 | -------------------------------------------------------------------------------- /exercises/practice/protein-translation/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "contributors": [ 6 | "jiegillet" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/ProteinTranslation.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/ProteinTranslation.example.elm" 17 | ] 18 | }, 19 | "blurb": "Translate RNA sequences into proteins.", 20 | "source": "Tyler Long" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/practice/protein-translation/src/ProteinTranslation.elm: -------------------------------------------------------------------------------- 1 | module ProteinTranslation exposing (Error(..), proteins) 2 | 3 | 4 | type Error 5 | = InvalidCodon 6 | 7 | 8 | proteins : String -> Result Error (List String) 9 | proteins strand = 10 | Debug.todo "Please implement proteins" 11 | -------------------------------------------------------------------------------- /exercises/practice/pythagorean-triplet/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which, 4 | 5 | ```text 6 | a² + b² = c² 7 | ``` 8 | 9 | and such that, 10 | 11 | ```text 12 | a < b < c 13 | ``` 14 | 15 | For example, 16 | 17 | ```text 18 | 3² + 4² = 5². 19 | ``` 20 | 21 | Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`. 22 | 23 | For example, with N = 1000, there is exactly one Pythagorean triplet for which `a + b + c = 1000`: `{200, 375, 425}`. 24 | -------------------------------------------------------------------------------- /exercises/practice/pythagorean-triplet/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "leojpod" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/PythagoreanTriplet.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/PythagoreanTriplet.example.elm" 17 | ] 18 | }, 19 | "blurb": "Given an integer N, find all Pythagorean triplets for which a + b + c = N.", 20 | "source": "A variation of Problem 9 from Project Euler", 21 | "source_url": "https://projecteuler.net/problem=9" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/pythagorean-triplet/src/PythagoreanTriplet.elm: -------------------------------------------------------------------------------- 1 | module PythagoreanTriplet exposing (triplets) 2 | 3 | 4 | type alias Triplet = 5 | ( Int, Int, Int ) 6 | 7 | 8 | triplets : Int -> List Triplet 9 | triplets n = 10 | Debug.todo "implement this function" 11 | -------------------------------------------------------------------------------- /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/src/Raindrops.example.elm: -------------------------------------------------------------------------------- 1 | module Raindrops exposing (raindrops) 2 | 3 | 4 | raindrops : Int -> String 5 | raindrops number = 6 | let 7 | drops = 8 | [ if modBy 3 number == 0 then 9 | "Pling" 10 | 11 | else 12 | "" 13 | , if modBy 5 number == 0 then 14 | "Plang" 15 | 16 | else 17 | "" 18 | , if modBy 7 number == 0 then 19 | "Plong" 20 | 21 | else 22 | "" 23 | ] 24 | 25 | result = 26 | String.concat drops 27 | in 28 | if result == "" then 29 | String.fromInt number 30 | 31 | else 32 | result 33 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/src/Raindrops.elm: -------------------------------------------------------------------------------- 1 | module Raindrops exposing (raindrops) 2 | 3 | 4 | raindrops : Int -> String 5 | raindrops number = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/relative-distance/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/RelativeDistance.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/RelativeDistance.example.elm" 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/src/RelativeDistance.elm: -------------------------------------------------------------------------------- 1 | module RelativeDistance exposing (degreeOfSeparation) 2 | 3 | import Dict exposing (Dict) 4 | 5 | 6 | degreeOfSeparation : Dict String (List String) -> String -> String -> Maybe Int 7 | degreeOfSeparation familyTree personA personB = 8 | Debug.todo "Please implement degreeOfSeparation" 9 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/ResistorColorDuo.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/ResistorColorDuo.example.elm" 14 | ] 15 | }, 16 | "blurb": "Convert color codes, as used on resistors, to a numeric value.", 17 | "source": "Maud de Vries, Erik Schierboom", 18 | "source_url": "https://github.com/exercism/problem-specifications/issues/1464" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-duo/src/ResistorColorDuo.elm: -------------------------------------------------------------------------------- 1 | module ResistorColorDuo exposing (Color(..), value) 2 | 3 | 4 | type Color 5 | = Black 6 | | Brown 7 | | Red 8 | | Orange 9 | | Yellow 10 | | Green 11 | | Blue 12 | | Violet 13 | | Grey 14 | | White 15 | 16 | 17 | value : List Color -> Int 18 | value colors = 19 | Debug.todo "Please implement value" 20 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color-trio/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/ResistorColorTrio.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/ResistorColorTrio.example.elm" 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/src/ResistorColorTrio.elm: -------------------------------------------------------------------------------- 1 | module ResistorColorTrio exposing (Color(..), label) 2 | 3 | 4 | type Color 5 | = Black 6 | | Brown 7 | | Red 8 | | Orange 9 | | Yellow 10 | | Green 11 | | Blue 12 | | Violet 13 | | Grey 14 | | White 15 | 16 | 17 | label : List Color -> String 18 | label colors = 19 | Debug.todo "Please implement label" 20 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/ResistorColor.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/ResistorColor.example.elm" 14 | ] 15 | }, 16 | "blurb": "Convert a resistor band's color to its numeric representation.", 17 | "source": "Maud de Vries, Erik Schierboom", 18 | "source_url": "https://github.com/exercism/problem-specifications/issues/1458" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/src/ResistorColor.elm: -------------------------------------------------------------------------------- 1 | module ResistorColor exposing (Color(..), colorCode, colors) 2 | 3 | 4 | type Color 5 | = Black 6 | | Brown 7 | | Red 8 | | Orange 9 | | Yellow 10 | | Green 11 | | Blue 12 | | Violet 13 | | Grey 14 | | White 15 | 16 | 17 | colorCode : Color -> Int 18 | colorCode color = 19 | Debug.todo "Please implement colorCode" 20 | 21 | 22 | colors : List Color 23 | colors = 24 | Debug.todo "Please implement colors" 25 | -------------------------------------------------------------------------------- /exercises/practice/rest-api/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/RestApi.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/RestApi.example.elm" 14 | ] 15 | }, 16 | "blurb": "Implement a RESTful API for tracking IOUs." 17 | } 18 | -------------------------------------------------------------------------------- /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 | "BNAndras" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/ReverseString.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/ReverseString.example.elm" 14 | ] 15 | }, 16 | "blurb": "Reverse a given string.", 17 | "source": "Introductory challenge to reverse an input string", 18 | "source_url": "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.meta/src/ReverseString.example.elm: -------------------------------------------------------------------------------- 1 | module ReverseString exposing (reverse) 2 | 3 | 4 | reverse : String -> String 5 | reverse str = 6 | String.reverse str 7 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/src/ReverseString.elm: -------------------------------------------------------------------------------- 1 | module ReverseString exposing (reverse) 2 | 3 | 4 | reverse : String -> String 5 | reverse str = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "nhawkes", 8 | "parkerl", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/RnaTranscription.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/RnaTranscription.example.elm" 20 | ] 21 | }, 22 | "blurb": "Given a DNA strand, return its RNA complement.", 23 | "source": "Hyperphysics", 24 | "source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/src/RnaTranscription.elm: -------------------------------------------------------------------------------- 1 | module RnaTranscription exposing (toRNA) 2 | 3 | 4 | toRNA : String -> Result String String 5 | toRNA dna = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/robot-simulator/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "michaelkpfeifer", 7 | "nathanielknight", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/RobotSimulator.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/RobotSimulator.example.elm" 19 | ] 20 | }, 21 | "blurb": "Write a robot simulator.", 22 | "source": "Inspired by an interview question at a famous company." 23 | } 24 | -------------------------------------------------------------------------------- /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 | "rebelwarrior" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "nathanielknight", 8 | "tgecho", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/RomanNumerals.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/RomanNumerals.example.elm" 20 | ] 21 | }, 22 | "blurb": "Convert modern Arabic numbers into Roman numerals.", 23 | "source": "The Roman Numeral Kata", 24 | "source_url": "https://codingdojo.org/kata/RomanNumerals/" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/roman-numerals/src/RomanNumerals.elm: -------------------------------------------------------------------------------- 1 | module RomanNumerals exposing (toRoman) 2 | 3 | 4 | toRoman : Int -> String 5 | toRoman number = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/RotationalCipher.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/RotationalCipher.example.elm" 14 | ] 15 | }, 16 | "blurb": "Create an implementation of the rotational cipher, also sometimes called the Caesar cipher.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Caesar_cipher" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/rotational-cipher/src/RotationalCipher.elm: -------------------------------------------------------------------------------- 1 | module RotationalCipher exposing (rotate) 2 | 3 | 4 | rotate : String -> Int -> String 5 | rotate text shiftKey = 6 | Debug.todo "Please implement rotate" 7 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "mrattner", 7 | "nathanielknight", 8 | "parkerl", 9 | "tuxagon", 10 | "ulve" 11 | ], 12 | "files": { 13 | "solution": [ 14 | "src/RunLengthEncoding.elm" 15 | ], 16 | "test": [ 17 | "tests/Tests.elm" 18 | ], 19 | "example": [ 20 | ".meta/src/RunLengthEncoding.example.elm" 21 | ] 22 | }, 23 | "blurb": "Implement run-length encoding and decoding.", 24 | "source": "Wikipedia", 25 | "source_url": "https://en.wikipedia.org/wiki/Run-length_encoding" 26 | } 27 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/src/RunLengthEncoding.elm: -------------------------------------------------------------------------------- 1 | module RunLengthEncoding exposing (decode, encode) 2 | 3 | 4 | encode : String -> String 5 | encode string = 6 | Debug.todo "Please implement this function" 7 | 8 | 9 | decode : String -> String 10 | decode string = 11 | Debug.todo "Please implement this function" 12 | -------------------------------------------------------------------------------- /exercises/practice/say/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "tuxagon", 8 | "jiegillet" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/Say.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/Say.example.elm" 19 | ] 20 | }, 21 | "blurb": "Given a number from 0 to 999,999,999,999, spell out that number in English.", 22 | "source": "A variation on the JavaRanch CattleDrive, Assignment 4", 23 | "source_url": "https://web.archive.org/web/20240907035912/https://coderanch.com/wiki/718804" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/say/src/Say.elm: -------------------------------------------------------------------------------- 1 | module Say exposing (SayError(..), say) 2 | 3 | 4 | type SayError 5 | = Negative 6 | | TooLarge 7 | 8 | 9 | say : Int -> Result SayError String 10 | say number = 11 | Debug.todo "Please implement this function" 12 | -------------------------------------------------------------------------------- /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 | "woylie" 4 | ], 5 | "contributors": [ 6 | "A5308Y", 7 | "nathanielknight", 8 | "tgecho", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/ScrabbleScore.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/ScrabbleScore.example.elm" 20 | ] 21 | }, 22 | "blurb": "Given a word, compute the Scrabble score for that word.", 23 | "source": "Inspired by the Extreme Startup game", 24 | "source_url": "https://github.com/rchatley/extreme_startup" 25 | } 26 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/src/ScrabbleScore.elm: -------------------------------------------------------------------------------- 1 | module ScrabbleScore exposing (scoreWord) 2 | 3 | 4 | scoreWord : String -> Int 5 | scoreWord x = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/SecretHandshake.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SecretHandshake.example.elm" 14 | ] 15 | }, 16 | "blurb": "Given a decimal number, convert it to the appropriate sequence of events for a secret handshake.", 17 | "source": "Bert, in Mary Poppins", 18 | "source_url": "https://www.imdb.com/title/tt0058331/quotes/?item=qt0437047" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/src/SecretHandshake.elm: -------------------------------------------------------------------------------- 1 | module SecretHandshake exposing (Command(..), commands) 2 | 3 | 4 | type Command 5 | = Wink 6 | | DoubleBlink 7 | | CloseYourEyes 8 | | Jump 9 | 10 | 11 | commands : Int -> List Command 12 | commands number = 13 | Debug.todo "Please implement commands" 14 | -------------------------------------------------------------------------------- /exercises/practice/series/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a string of digits, output all the contiguous substrings of length `n` in that string in the order that they appear. 4 | 5 | For example, the string "49142" has the following 3-digit series: 6 | 7 | - "491" 8 | - "914" 9 | - "142" 10 | 11 | And the following 4-digit series: 12 | 13 | - "4914" 14 | - "9142" 15 | 16 | And if you ask for a 6-digit series from a 5-digit string, you deserve whatever you get. 17 | 18 | Note that these series are only required to occupy _adjacent positions_ in the input; 19 | the digits need not be _numerically consecutive_. 20 | -------------------------------------------------------------------------------- /exercises/practice/series/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "parkerl", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/Series.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/Series.example.elm" 19 | ] 20 | }, 21 | "blurb": "Given a string of digits, output all the contiguous substrings of length `n` in that string.", 22 | "source": "A subset of the Problem 8 at Project Euler", 23 | "source_url": "https://projecteuler.net/problem=8" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/series/src/Series.elm: -------------------------------------------------------------------------------- 1 | module Series exposing (slices) 2 | 3 | 4 | slices : Int -> String -> Result String (List (List Int)) 5 | slices size input = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/sgf-parsing/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/SgfParsing.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SgfParsing.example.elm" 14 | ] 15 | }, 16 | "blurb": "Parsing a Smart Game Format string." 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/sgf-parsing/src/SgfParsing.elm: -------------------------------------------------------------------------------- 1 | module SgfParsing exposing (Tree(..), parse) 2 | 3 | import Dict exposing (Dict) 4 | 5 | 6 | type Tree 7 | = Node { properties : Dict String (List String), children : List Tree } 8 | 9 | 10 | parse : String -> Result String Tree 11 | parse input = 12 | Debug.todo "Please implement this function" 13 | -------------------------------------------------------------------------------- /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 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Sieve.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Sieve.example.elm" 14 | ] 15 | }, 16 | "blurb": "Use the Sieve of Eratosthenes to find all the primes from 2 up to a given number.", 17 | "source": "Sieve of Eratosthenes at Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/sieve/src/Sieve.elm: -------------------------------------------------------------------------------- 1 | module Sieve exposing (primes) 2 | 3 | 4 | primes : Int -> List Int 5 | primes limit = 6 | Debug.todo "Please implement primes" 7 | -------------------------------------------------------------------------------- /exercises/practice/simple-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/SimpleCipher.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SimpleCipher.example.elm" 14 | ] 15 | }, 16 | "blurb": "Implement a simple shift cipher like Caesar and a more secure substitution cipher.", 17 | "source": "Substitution Cipher at Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Substitution_cipher" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/simple-cipher/src/SimpleCipher.elm: -------------------------------------------------------------------------------- 1 | module SimpleCipher exposing (decode, encode, keyGen) 2 | 3 | import Random exposing (Generator) 4 | 5 | 6 | encode : String -> String -> String 7 | encode key plaintext = 8 | Debug.todo "Please implement encode" 9 | 10 | 11 | decode : String -> String -> String 12 | decode key ciphertext = 13 | Debug.todo "Please implement decode" 14 | 15 | 16 | keyGen : Generator String 17 | keyGen = 18 | Random.lazy (\_ -> Debug.todo "Please implement keyGen") 19 | -------------------------------------------------------------------------------- /exercises/practice/space-age/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "michaelglass", 7 | "nathanielknight", 8 | "nmbrgts", 9 | "parkerl", 10 | "tuxagon", 11 | "yurrriq" 12 | ], 13 | "files": { 14 | "solution": [ 15 | "src/SpaceAge.elm" 16 | ], 17 | "test": [ 18 | "tests/Tests.elm" 19 | ], 20 | "example": [ 21 | ".meta/src/SpaceAge.example.elm" 22 | ] 23 | }, 24 | "blurb": "Given an age in seconds, calculate how old someone is in terms of a given planet's solar years.", 25 | "source": "Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial.", 26 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=01" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/space-age/src/SpaceAge.elm: -------------------------------------------------------------------------------- 1 | module SpaceAge exposing (Planet(..), ageOn) 2 | 3 | 4 | type Planet 5 | = Mercury 6 | | Venus 7 | | Earth 8 | | Mars 9 | | Jupiter 10 | | Saturn 11 | | Uranus 12 | | Neptune 13 | 14 | 15 | ageOn : Planet -> Float -> Float 16 | ageOn planet seconds = 17 | Debug.todo "Please implement this function" 18 | -------------------------------------------------------------------------------- /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/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | In a small village near an ancient forest, there was a legend of a hidden treasure buried deep within the woods. 4 | Despite numerous attempts, no one had ever succeeded in finding it. 5 | This was about to change, however, thanks to a young explorer named Elara. 6 | She had discovered an old document containing instructions on how to locate the treasure. 7 | Using these instructions, Elara was able to draw a map that revealed the path to the treasure. 8 | 9 | To her surprise, the path followed a peculiar clockwise spiral. 10 | It was no wonder no one had been able to find the treasure before! 11 | With the map in hand, Elara embarks on her journey to uncover the hidden treasure. 12 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/SpiralMatrix.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SpiralMatrix.example.elm" 14 | ] 15 | }, 16 | "blurb": "Given the size, return a square matrix of numbers in spiral order.", 17 | "source": "Reddit r/dailyprogrammer challenge #320 [Easy] Spiral Ascension.", 18 | "source_url": "https://web.archive.org/web/20230607064729/https://old.reddit.com/r/dailyprogrammer/comments/6i60lr/20170619_challenge_320_easy_spiral_ascension/" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/spiral-matrix/src/SpiralMatrix.elm: -------------------------------------------------------------------------------- 1 | module SpiralMatrix exposing (spiralMatrix) 2 | 3 | 4 | spiralMatrix : Int -> List (List Int) 5 | spiralMatrix size = 6 | Debug.todo "Please implement spiralMatrix" 7 | -------------------------------------------------------------------------------- /exercises/practice/split-second-stopwatch/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You've always run for the thrill of it — no schedules, no timers, just the sound of your feet on the pavement. 4 | But now that you've joined a competitive running crew, things are getting serious. 5 | Training sessions are timed to the second, and every split second counts. 6 | To keep pace, you've picked up the _Split-Second Stopwatch_ — a sleek, high-tech gadget that's about to become your new best friend. 7 | -------------------------------------------------------------------------------- /exercises/practice/split-second-stopwatch/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/SplitSecondStopwatch.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SplitSecondStopwatch.example.elm" 14 | ] 15 | }, 16 | "blurb": "Keep track of time through a digital stopwatch.", 17 | "source": "Erik Schierboom", 18 | "source_url": "https://github.com/exercism/problem-specifications/pull/2547" 19 | } 20 | -------------------------------------------------------------------------------- /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 | "src/SquareRoot.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SquareRoot.example.elm" 14 | ] 15 | }, 16 | "blurb": "Given a natural radicand, return its square root.", 17 | "source": "wolf99", 18 | "source_url": "https://github.com/exercism/problem-specifications/pull/1582" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/square-root/src/SquareRoot.elm: -------------------------------------------------------------------------------- 1 | module SquareRoot exposing (squareRoot) 2 | 3 | 4 | squareRoot : Int -> Int 5 | squareRoot radicand = 6 | Debug.todo "Please implement squareRoot" 7 | -------------------------------------------------------------------------------- /exercises/practice/strain/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "parkerl", 8 | "tuxagon" 9 | ], 10 | "files": { 11 | "solution": [ 12 | "src/Strain.elm" 13 | ], 14 | "test": [ 15 | "tests/Tests.elm" 16 | ], 17 | "example": [ 18 | ".meta/src/Strain.example.elm" 19 | ] 20 | }, 21 | "blurb": "Implement the `keep` and `discard` operation on collections.", 22 | "source": "Conversation with James Edward Gray II", 23 | "source_url": "http://graysoftinc.com/" 24 | } 25 | -------------------------------------------------------------------------------- /exercises/practice/strain/.meta/src/Strain.example.elm: -------------------------------------------------------------------------------- 1 | module Strain exposing (discard, keep) 2 | 3 | import List 4 | 5 | 6 | keep : (a -> Bool) -> List a -> List a 7 | keep predicate list = 8 | List.foldr (consIf predicate) [] list 9 | 10 | 11 | discard : (a -> Bool) -> List a -> List a 12 | discard predicate list = 13 | List.foldr (consIf (\v -> not <| predicate v)) [] list 14 | 15 | 16 | consIf : (a -> Bool) -> a -> List a -> List a 17 | consIf predicate value list = 18 | if predicate value then 19 | value :: list 20 | 21 | else 22 | list 23 | -------------------------------------------------------------------------------- /exercises/practice/strain/src/Strain.elm: -------------------------------------------------------------------------------- 1 | module Strain exposing (discard, keep) 2 | 3 | 4 | keep : (a -> Bool) -> List a -> List a 5 | keep predicate list = 6 | Debug.todo "Please implement this function" 7 | 8 | 9 | discard : (a -> Bool) -> List a -> List a 10 | discard predicate list = 11 | Debug.todo "Please implement this function" 12 | -------------------------------------------------------------------------------- /exercises/practice/sublist/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "parkerl", 8 | "tuxagon", 9 | "ulve" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/Sublist.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/Sublist.example.elm" 20 | ] 21 | }, 22 | "blurb": "Write a function to determine if a list is a sublist of another list." 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/sublist/src/Sublist.elm: -------------------------------------------------------------------------------- 1 | module Sublist exposing (ListComparison(..), sublist) 2 | 3 | 4 | type ListComparison 5 | = Equal 6 | | Superlist 7 | | Sublist 8 | | Unequal 9 | 10 | 11 | sublist : List a -> List a -> ListComparison 12 | sublist alist blist = 13 | Debug.todo "Please implement this function" 14 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "michaelkpfeifer", 7 | "nathanielknight", 8 | "parkerl", 9 | "tuxagon" 10 | ], 11 | "files": { 12 | "solution": [ 13 | "src/SumOfMultiples.elm" 14 | ], 15 | "test": [ 16 | "tests/Tests.elm" 17 | ], 18 | "example": [ 19 | ".meta/src/SumOfMultiples.example.elm" 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/src/SumOfMultiples.example.elm: -------------------------------------------------------------------------------- 1 | module SumOfMultiples exposing (sumOfMultiples) 2 | 3 | 4 | sumOfMultiples : List Int -> Int -> Int 5 | sumOfMultiples divisors limit = 6 | List.sum (List.filter (inMultiples divisors) (List.range 1 (limit - 1))) 7 | 8 | 9 | inMultiples : List Int -> Int -> Bool 10 | inMultiples divisors candidate = 11 | List.any (\divisor -> modBy divisor candidate == 0) divisors 12 | -------------------------------------------------------------------------------- /exercises/practice/sum-of-multiples/src/SumOfMultiples.elm: -------------------------------------------------------------------------------- 1 | module SumOfMultiples exposing (sumOfMultiples) 2 | 3 | 4 | sumOfMultiples : List Int -> Int -> Int 5 | sumOfMultiples divisors limit = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/swift-scheduling/.docs/instructions.append.md: -------------------------------------------------------------------------------- 1 | # Instructions Append 2 | 3 | ```exercism/note 4 | `elm/time` is meant to display a time provided by the browser, not to manipulate dates and times. 5 | In real world applications, one would reach out to packages from the Elm community to manipulate dates and times, but since those are not accessible in the online editor, take this exercise as a challenge rather than as a practice of idiomatic Elm. 6 | ``` 7 | -------------------------------------------------------------------------------- /exercises/practice/swift-scheduling/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | This week, it is your turn to take notes in the department's planning meeting. 4 | In this meeting, your boss will set delivery dates for all open work items. 5 | Annoyingly, instead of specifying the _actual_ delivery dates, your boss will only _describe them_ in an abbreviated format. 6 | As many of your colleagues won't be familiar with this corporate lingo, you'll need to convert these delivery date descriptions to actual delivery dates. 7 | -------------------------------------------------------------------------------- /exercises/practice/swift-scheduling/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/SwiftScheduling.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/SwiftScheduling.example.elm" 14 | ] 15 | }, 16 | "blurb": "Convert delivery date descriptions to actual delivery dates.", 17 | "source": "Erik Schierboom", 18 | "source_url": "https://github.com/exercism/problem-specifications/pull/2536" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/swift-scheduling/src/SwiftScheduling.elm: -------------------------------------------------------------------------------- 1 | module SwiftScheduling exposing (deliveryDate) 2 | 3 | import Time exposing (Posix) 4 | 5 | 6 | deliveryDate : Posix -> String -> Posix 7 | deliveryDate meetingStart description = 8 | Debug.todo "Please implement deliveryDate" 9 | -------------------------------------------------------------------------------- /exercises/practice/transpose/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tuxagon" 4 | ], 5 | "contributors": [ 6 | "nathanielknight" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/Transpose.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/Transpose.example.elm" 17 | ] 18 | }, 19 | "blurb": "Take input text and output it transposed.", 20 | "source": "Reddit r/dailyprogrammer challenge #270 [Easy].", 21 | "source_url": "https://web.archive.org/web/20230630051421/https://old.reddit.com/r/dailyprogrammer/comments/4msu2x/challenge_270_easy_transpose_the_input_text/" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/transpose/src/Transpose.elm: -------------------------------------------------------------------------------- 1 | module Transpose exposing (transpose) 2 | 3 | 4 | transpose : List String -> List String 5 | transpose lines = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/triangle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "Emiluren", 7 | "lpil", 8 | "nathanielknight", 9 | "parkerl", 10 | "tuxagon", 11 | "ulve" 12 | ], 13 | "files": { 14 | "solution": [ 15 | "src/Triangle.elm" 16 | ], 17 | "test": [ 18 | "tests/Tests.elm" 19 | ], 20 | "example": [ 21 | ".meta/src/Triangle.example.elm" 22 | ] 23 | }, 24 | "blurb": "Determine if a triangle is equilateral, isosceles, or scalene.", 25 | "source": "The Ruby Koans triangle project, parts 1 & 2", 26 | "source_url": "https://web.archive.org/web/20220831105330/http://rubykoans.com" 27 | } 28 | -------------------------------------------------------------------------------- /exercises/practice/triangle/.meta/src/Triangle.example.elm: -------------------------------------------------------------------------------- 1 | module Triangle exposing (Triangle(..), triangleKind) 2 | 3 | import Set 4 | 5 | 6 | type Triangle 7 | = Equilateral 8 | | Isosceles 9 | | Scalene 10 | 11 | 12 | triangleKind : number -> number -> number -> Result String Triangle 13 | triangleKind x y z = 14 | if x <= 0 || y <= 0 || z <= 0 then 15 | Err "Invalid lengths" 16 | 17 | else if x + y <= z || x + z <= y || y + z <= x then 18 | Err "Violates inequality" 19 | 20 | else 21 | case Set.size (Set.fromList [ x, y, z ]) of 22 | 1 -> 23 | Ok Equilateral 24 | 25 | 2 -> 26 | Ok Isosceles 27 | 28 | _ -> 29 | Ok Scalene 30 | -------------------------------------------------------------------------------- /exercises/practice/triangle/src/Triangle.elm: -------------------------------------------------------------------------------- 1 | module Triangle exposing (Triangle(..), triangleKind) 2 | 3 | 4 | type Triangle 5 | = Equilateral 6 | | Isosceles 7 | | Scalene 8 | 9 | 10 | triangleKind : number -> number -> number -> Result String Triangle 11 | triangleKind x y z = 12 | Debug.todo "Please implement this function" 13 | -------------------------------------------------------------------------------- /exercises/practice/twelve-days/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "tuxagon" 4 | ], 5 | "contributors": [ 6 | "nathanielknight", 7 | "rebelwarrior" 8 | ], 9 | "files": { 10 | "solution": [ 11 | "src/TwelveDays.elm" 12 | ], 13 | "test": [ 14 | "tests/Tests.elm" 15 | ], 16 | "example": [ 17 | ".meta/src/TwelveDays.example.elm" 18 | ] 19 | }, 20 | "blurb": "Output the lyrics to 'The Twelve Days of Christmas'.", 21 | "source": "Wikipedia", 22 | "source_url": "https://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_(song)" 23 | } 24 | -------------------------------------------------------------------------------- /exercises/practice/twelve-days/src/TwelveDays.elm: -------------------------------------------------------------------------------- 1 | module TwelveDays exposing (recite) 2 | 3 | 4 | recite : Int -> Int -> List String 5 | recite start stop = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/two-bucket/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "contributors": [ 6 | "ceddlyburge" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/TwoBucket.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/TwoBucket.example.elm" 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/src/TwoBucket.elm: -------------------------------------------------------------------------------- 1 | module TwoBucket exposing (BucketNumber(..), measure) 2 | 3 | 4 | type BucketNumber 5 | = One 6 | | Two 7 | 8 | 9 | type alias State = 10 | { moves : Int, bucketOne : Int, bucketTwo : Int } 11 | 12 | 13 | measure : Int -> Int -> Int -> BucketNumber -> Maybe State 14 | measure bucketOneSize bucketTwoSize goal startBucket = 15 | Debug.todo "Please implement measure" 16 | -------------------------------------------------------------------------------- /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/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "benreyn" 4 | ], 5 | "contributors": [ 6 | "tuxagon" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/TwoFer.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/TwoFer.example.elm" 17 | ] 18 | }, 19 | "blurb": "Create a sentence of the form \"One for X, one for me.\".", 20 | "source_url": "https://github.com/exercism/problem-specifications/issues/757" 21 | } 22 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/src/TwoFer.example.elm: -------------------------------------------------------------------------------- 1 | module TwoFer exposing (twoFer) 2 | 3 | 4 | twoFer : Maybe String -> String 5 | twoFer name = 6 | "One for " 7 | ++ Maybe.withDefault "you" name 8 | ++ ", one for me." 9 | -------------------------------------------------------------------------------- /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/src/TwoFer.elm: -------------------------------------------------------------------------------- 1 | module TwoFer exposing (twoFer) 2 | 3 | 4 | twoFer : Maybe String -> String 5 | twoFer name = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/tests/Tests.elm: -------------------------------------------------------------------------------- 1 | module Tests exposing (tests) 2 | 3 | import Expect 4 | import Test exposing (..) 5 | import TwoFer exposing (twoFer) 6 | 7 | 8 | tests : Test 9 | tests = 10 | describe "Two-fer" 11 | [ test "No name given" <| 12 | \() -> 13 | Expect.equal "One for you, one for me." (twoFer Nothing) 14 | , skip <| 15 | test "A name given" <| 16 | \() -> 17 | Expect.equal "One for Alice, one for me." (twoFer (Just "Alice")) 18 | , skip <| 19 | test "Another name given" <| 20 | \() -> 21 | Expect.equal "One for Bob, one for me." (twoFer (Just "Bob")) 22 | ] 23 | -------------------------------------------------------------------------------- /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 | "tgecho" 4 | ], 5 | "contributors": [ 6 | "jiegillet", 7 | "michaelkpfeifer", 8 | "mpizenberg", 9 | "nathanielknight", 10 | "NobbZ", 11 | "parkerl", 12 | "rebelwarrior", 13 | "tuxagon" 14 | ], 15 | "files": { 16 | "solution": [ 17 | "src/WordCount.elm" 18 | ], 19 | "test": [ 20 | "tests/Tests.elm" 21 | ], 22 | "example": [ 23 | ".meta/src/WordCount.example.elm" 24 | ] 25 | }, 26 | "blurb": "Given a phrase, count the occurrences of each word in that phrase.", 27 | "source": "This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour." 28 | } 29 | -------------------------------------------------------------------------------- /exercises/practice/word-count/src/WordCount.elm: -------------------------------------------------------------------------------- 1 | module WordCount exposing (wordCount) 2 | 3 | import Dict exposing (Dict) 4 | 5 | 6 | wordCount : String -> Dict String Int 7 | wordCount sentence = 8 | Debug.todo "Please implement this function" 9 | -------------------------------------------------------------------------------- /exercises/practice/wordy/.docs/instructions.append.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | This is a perfect opportunity to learn `elm/parser` ([docs](https://package.elm-lang.org/packages/elm/parser/latest/))! -------------------------------------------------------------------------------- /exercises/practice/wordy/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "SiriusStarr" 4 | ], 5 | "contributors": [ 6 | "mpizenberg" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "src/Wordy.elm" 11 | ], 12 | "test": [ 13 | "tests/Tests.elm" 14 | ], 15 | "example": [ 16 | ".meta/src/Wordy.example.elm" 17 | ] 18 | }, 19 | "blurb": "Parse and evaluate simple math word problems returning the answer as an integer.", 20 | "source": "Inspired by one of the generated questions in the Extreme Startup game.", 21 | "source_url": "https://github.com/rchatley/extreme_startup" 22 | } 23 | -------------------------------------------------------------------------------- /exercises/practice/wordy/src/Wordy.elm: -------------------------------------------------------------------------------- 1 | module Wordy exposing (answer) 2 | 3 | 4 | answer : String -> Maybe Int 5 | answer problem = 6 | Debug.todo "Please implement this function" 7 | -------------------------------------------------------------------------------- /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 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/Yacht.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/Yacht.example.elm" 14 | ] 15 | }, 16 | "blurb": "Score a single throw of dice in the game Yacht.", 17 | "source": "James Kilfiger, using Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Yacht_(dice_game)" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/yacht/src/Yacht.elm: -------------------------------------------------------------------------------- 1 | module Yacht exposing (Category(..), score) 2 | 3 | 4 | type Category 5 | = Ones 6 | | Twos 7 | | Threes 8 | | Fours 9 | | Fives 10 | | Sixes 11 | | FullHouse 12 | | FourOfAKind 13 | | LittleStraight 14 | | BigStraight 15 | | Choice 16 | | Yacht 17 | 18 | 19 | score : List Int -> Category -> Int 20 | score dice category = 21 | Debug.todo "Please implement score" 22 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jiegillet" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "src/ZebraPuzzle.elm" 8 | ], 9 | "test": [ 10 | "tests/Tests.elm" 11 | ], 12 | "example": [ 13 | ".meta/src/ZebraPuzzle.example.elm" 14 | ] 15 | }, 16 | "blurb": "Solve the zebra puzzle.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Zebra_Puzzle" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/.meta/tests.toml: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file. 2 | # 3 | # Regenerating this file via `configlet sync` will: 4 | # - Recreate every `description` key/value pair 5 | # - Recreate every `reimplements` key/value pair, where they exist in problem-specifications 6 | # - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) 7 | # - Preserve any other key/value pair 8 | # 9 | # As user-added comments (using the # character) will be removed when this file 10 | # is regenerated, comments can be added via a `comment` key. 11 | 12 | [16efb4e4-8ad7-4d5e-ba96-e5537b66fd42] 13 | description = "resident who drinks water" 14 | 15 | [084d5b8b-24e2-40e6-b008-c800da8cd257] 16 | description = "resident who owns zebra" 17 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/src/ZebraPuzzle.elm: -------------------------------------------------------------------------------- 1 | module ZebraPuzzle exposing (Nationality(..), drinksWater, ownsZebra) 2 | 3 | 4 | type Nationality 5 | = Japanese 6 | | Norwegian 7 | | TODO 8 | 9 | 10 | drinksWater : Maybe Nationality 11 | drinksWater = 12 | Debug.todo "Please implement drinksWater" 13 | 14 | 15 | ownsZebra : Maybe Nationality 16 | ownsZebra = 17 | Debug.todo "Please implement ownsZebra" 18 | -------------------------------------------------------------------------------- /exercises/practice/zebra-puzzle/tests/Tests.elm: -------------------------------------------------------------------------------- 1 | module Tests exposing (tests) 2 | 3 | import Expect 4 | import Test exposing (Test, describe, skip, test) 5 | import ZebraPuzzle 6 | 7 | 8 | tests : Test 9 | tests = 10 | describe "ZebraPuzzle" 11 | [ test "resident who drinks water" <| 12 | \() -> 13 | ZebraPuzzle.drinksWater 14 | |> Expect.equal (Just ZebraPuzzle.Norwegian) 15 | , skip <| 16 | test "resident who owns zebra" <| 17 | \() -> 18 | ZebraPuzzle.ownsZebra 19 | |> Expect.equal (Just ZebraPuzzle.Japanese) 20 | ] 21 | -------------------------------------------------------------------------------- /exercises/shared/.docs/help.md: -------------------------------------------------------------------------------- 1 | # Help 2 | 3 | Online Resources 4 | 5 | - [Minimal guide to Elm syntax](https://elm-lang.org/docs/syntax). 6 | - The [Package Documentation](https://package.elm-lang.org/) (similar to npm.org) has documentation for all Elm packages, including [Core packages (String, Boolean and so on)](https://package.elm-lang.org/packages/elm/core/latest) 7 | - [Style guide](https://elm-lang.org/docs/style-guide) (and [elm-format](https://github.com/avh4/elm-format) can be used to autoformat) 8 | 9 | Help from a Human 10 | 11 | - [Discourse](https://discourse.elm-lang.org/) 12 | - [Stack Overflow](https://stackoverflow.com/questions/tagged/elm) 13 | - [Slack](elmlang.slack.com) 14 | -------------------------------------------------------------------------------- /exercises/shared/.docs/tests.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | Run the command `elm-test` from within the exercise directory to run the tests. 4 | 5 | This assumes that you have already followed the installation instructions for the Elm track. 6 | -------------------------------------------------------------------------------- /template/src/Exercise.elm: -------------------------------------------------------------------------------- 1 | module