-
Notifications
You must be signed in to change notification settings - Fork 0
/
texttest_fixtures.go
46 lines (40 loc) · 974 Bytes
/
texttest_fixtures.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"fmt"
"os"
"strconv"
"github.com/myugen/go-gildedrose-kata/gildedrose"
)
func main() {
fmt.Println("OMGHAI!")
var items = []*gildedrose.Item{
{"+5 Dexterity Vest", 10, 20},
{"Aged Brie", 2, 0},
{"Elixir of the Mongoose", 5, 7},
{"Sulfuras, Hand of Ragnaros", 0, 80},
{"Sulfuras, Hand of Ragnaros", -1, 80},
{"Backstage passes to a TAFKAL80ETC concert", 15, 20},
{"Backstage passes to a TAFKAL80ETC concert", 10, 49},
{"Backstage passes to a TAFKAL80ETC concert", 5, 49},
{"Conjured Mana Cake", 3, 6}, // <-- :O
}
days := 2
var err error
if len(os.Args) > 1 {
days, err = strconv.Atoi(os.Args[1])
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
days++
}
for day := 0; day < days; day++ {
fmt.Printf("-------- day %d --------\n", day)
fmt.Println("name, sellIn, quality")
for i := 0; i < len(items); i++ {
fmt.Println(items[i])
}
fmt.Println("")
gildedrose.UpdateQuality(items)
}
}