GildedRose-Refactoring-Kata/scheme/texttest-feature.scm
2018-12-03 21:03:48 +01:00

33 lines
1.2 KiB
Scheme

(include "gilded-rose.scm")
(display "OMGHAI!")
(newline)
(let ((items (list (make-item "+5 Dexterity Vest" 10 20)
(make-item "Aged Brie" 2 0)
(make-item "Elixir of the Mongoose" 5 7)
(make-item "Sulfuras, Hand of Ragnaros" 0 80)
(make-item "Sulfuras, Hand of Ragnaros" -1 80)
(make-item "Backstage passes to a TAFKAL80ETC concert" 15 20)
(make-item "Backstage passes to a TAFKAL80ETC concert" 10 49)
(make-item "Backstage passes to a TAFKAL80ETC concert" 5 49)
;; this conjured item does not work properly yet
(make-item "Conjured Mana Cake" 3 6)))
(days 2))
(define (loop day)
(cond ((< day days)
(display (string-append "-------- day " (number->string day) " --------"))
(newline)
(display "name, sell-in, quality")
(newline)
(for-each
(lambda (item)
(display (item-to-string item))
(newline))
items)
(newline)
(update-quality items)
(loop (+ day 1)))))
(loop 0))