diff --git a/elm/.gitignore b/elm/.gitignore deleted file mode 100644 index d9100021..00000000 --- a/elm/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -elm-stuff -# elm-repl generated files -repl-temp-* -*.src -src/index.html diff --git a/elm/README.md b/elm/README.md deleted file mode 100644 index 30aa4660..00000000 --- a/elm/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Gilded Rose (elm) - -To run tests, enter `elm-test` - -### Installing `elm-test` - -https://github.com/elm-explorations/test diff --git a/elm/elm.json b/elm/elm.json deleted file mode 100644 index 5c475c39..00000000 --- a/elm/elm.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "type": "application", - "source-directories": [ - "src" - ], - "elm-version": "0.19.1", - "dependencies": { - "direct": { - "elm/browser": "1.0.2", - "elm/core": "1.0.4", - "elm/html": "1.0.0" - }, - "indirect": { - "elm/json": "1.1.3", - "elm/time": "1.0.0", - "elm/url": "1.0.0", - "elm/virtual-dom": "1.0.2" - } - }, - "test-dependencies": { - "direct": { - "elm-explorations/test": "1.2.2" - }, - "indirect": { - "elm/random": "1.0.0" - } - } -} diff --git a/elm/src/GildedRose.elm b/elm/src/GildedRose.elm deleted file mode 100644 index bf97c94a..00000000 --- a/elm/src/GildedRose.elm +++ /dev/null @@ -1,53 +0,0 @@ -module GildedRose exposing (Item, update_quality) - - -type alias Item = - { name : String - , sell_by : Int - , quality : Int - } - - -update_quality : List Item -> List Item -update_quality items = - List.map - (\item -> - if item.name == "Aged Brie" || item.name == "Backstage passes to a TAFKAL80ETC concert" then - if item.quality < 50 then - if item.name == "Backstage passes to a TAFKAL80ETC concert" then - if item.sell_by < 0 then - { item | sell_by = item.sell_by - 1, quality = 0 } - - else if item.sell_by < 6 then - { item | sell_by = item.sell_by - 1, quality = item.quality + 3 } - - else if item.sell_by < 11 then - { item | sell_by = item.sell_by - 1, quality = item.quality + 2 } - - else - { item | sell_by = item.sell_by - 1, quality = item.quality + 1 } - - else - { item | sell_by = item.sell_by - 1, quality = item.quality + 1 } - - else - { item | sell_by = item.sell_by } - - else if item.name /= "Aged Brie" && item.name /= "Sulfuras, Hand of Ragnaros" then - if item.sell_by < 0 && item.quality > 0 then - if item.quality >= 2 then - { item | sell_by = item.sell_by - 1, quality = item.quality - 2 } - - else - { item | sell_by = item.sell_by - 1, quality = 0 } - - else if item.quality >= 1 then - { item | sell_by = item.sell_by - 1, quality = item.quality - 1 } - - else - { item | sell_by = item.sell_by - 1, quality = 0 } - - else - item - ) - items diff --git a/elm/src/Main.elm b/elm/src/Main.elm deleted file mode 100644 index bb225f23..00000000 --- a/elm/src/Main.elm +++ /dev/null @@ -1,7 +0,0 @@ -module Main exposing (main) - -import Html exposing (..) - - -main = - text "Gilded Rose" diff --git a/elm/tests/GildedRoseTest.elm b/elm/tests/GildedRoseTest.elm deleted file mode 100644 index 2a2cff01..00000000 --- a/elm/tests/GildedRoseTest.elm +++ /dev/null @@ -1,18 +0,0 @@ -module GildedRoseTest exposing (..) - -import Expect exposing (Expectation) -import Fuzz exposing (Fuzzer, int, list, string) -import GildedRose exposing (..) -import Test exposing (..) - - -suite : Test -suite = - test "example test" - (\_ -> - let - foo = - Item "foo" 10 30 - in - Expect.equal foo.name "fixme" - )