-
Notifications
You must be signed in to change notification settings - Fork 0
/
GildedRoseTextTests.c
47 lines (40 loc) · 1.41 KB
/
GildedRoseTextTests.c
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
47
#include <stdio.h>
#include "GildedRose.h"
#include "GildedRose_Internal.h"
int
print_item(Item *item)
{
return printf("%s, %d, %d\n", item->name, item->sellIn, item->quality);
}
int main()
{
Item items[12];
int last = 0;
int day;
int index;
init_item(items + last++, "+5 Dexterity Vest", 10, 20);
init_item(items + last++, "Aged Brie", 2, 0);
init_item(items + last++, "Aged Brie", 2, 40);
init_item(items + last++, "Aged Brie", 10, 0);
init_item(items + last++, "Aged Brie", 10, 40);
init_item(items + last++, "Elixir of the Mongoose", 5, 7);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", 0, 80);
init_item(items + last++, "Sulfuras, Hand of Ragnaros", -1, 80);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 15, 20);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 10, 49);
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 5, 49);
// this Conjured item doesn't yet work properly
init_item(items + last++, "Conjured Mana Cake", 3, 6);
puts("OMGHAI!");
for (day = 0; day <= 50; day++)
{
printf("-------- day %d --------\n", day);
printf("name, sellIn, quality\n");
for(index = 0; index < last; index++) {
print_item(items + index);
}
printf("\n");
update_quality(items, last);
}
return 0;
}