mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-17 23:41:27 +00:00
Delete elm directory
This commit is contained in:
parent
211acb4b31
commit
9d595bdfe0
5
elm/.gitignore
vendored
5
elm/.gitignore
vendored
@ -1,5 +0,0 @@
|
|||||||
elm-stuff
|
|
||||||
# elm-repl generated files
|
|
||||||
repl-temp-*
|
|
||||||
*.src
|
|
||||||
src/index.html
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
# Gilded Rose (elm)
|
|
||||||
|
|
||||||
To run tests, enter `elm-test`
|
|
||||||
|
|
||||||
### Installing `elm-test`
|
|
||||||
|
|
||||||
https://github.com/elm-explorations/test
|
|
||||||
28
elm/elm.json
28
elm/elm.json
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
module Main exposing (main)
|
|
||||||
|
|
||||||
import Html exposing (..)
|
|
||||||
|
|
||||||
|
|
||||||
main =
|
|
||||||
text "Gilded Rose"
|
|
||||||
@ -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"
|
|
||||||
)
|
|
||||||
Loading…
Reference in New Issue
Block a user