mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-16 10:55:09 +00:00
gilded rose in Ada
This commit is contained in:
1 parent
3906ee2b8d
commit
f4a171464f
12 files changed
+663
No files matched your search
@@ -0,0 +1,72 @@
|
||||
with Ada.Text_IO;
|
||||
use Ada.Text_IO;
|
||||
|
||||
with Items;
|
||||
use Items;
|
||||
|
||||
with Ada.Strings.Unbounded;
|
||||
use Ada.Strings.Unbounded;
|
||||
|
||||
with Gilded_Rose;
|
||||
use Gilded_Rose;
|
||||
|
||||
procedure Program is
|
||||
Things : Item_Vecs.Vector;
|
||||
begin
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("+5 Dexterity Vest"),
|
||||
Sell_In => 10,
|
||||
Quality => 20));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Aged Brie"),
|
||||
Sell_In => 2,
|
||||
Quality => 0));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Elixir of the Mongoose"),
|
||||
Sell_In => 5,
|
||||
Quality => 7));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Sulfuras, Hand of Ragnaros"),
|
||||
Sell_In => 0,
|
||||
Quality => 80));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Sulfuras, Hand of Ragnaros"),
|
||||
Sell_In => -1,
|
||||
Quality => 80));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
|
||||
Sell_In => 15,
|
||||
Quality => 20));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
|
||||
Sell_In => 10,
|
||||
Quality => 49));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
|
||||
Sell_In => 5,
|
||||
Quality => 49));
|
||||
-- this conjured item does not work properly yet
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Conjured Mana Cake"),
|
||||
Sell_In => 3,
|
||||
Quality => 6));
|
||||
|
||||
|
||||
declare
|
||||
App : Gilded_Rose.Gilded_Rose := (Items => Things);
|
||||
begin
|
||||
Put_Line("OMGHAI!");
|
||||
|
||||
for I in 0 .. 30 loop
|
||||
Put_Line("-------- day" & Integer'Image(I) & " --------");
|
||||
Put_Line("name, sellIn, quality");
|
||||
|
||||
for Each of App.Items loop
|
||||
Put_Line(To_String(Each));
|
||||
end loop;
|
||||
Put_Line("");
|
||||
|
||||
Update_Quality(App);
|
||||
end loop;
|
||||
end;
|
||||
end;
|
||||
Reference in new issue
Block a user