From 0063ef3b487347ee86cf8252b9abfe2a5d558450 Mon Sep 17 00:00:00 2001 From: Matt Decker Date: Sun, 26 Jun 2022 09:15:04 -0500 Subject: [PATCH] Delete dart directory --- dart/.gitignore | 6 --- dart/bin/main.dart | 35 ----------------- dart/lib/gilded_rose.dart | 68 --------------------------------- dart/pubspec.yaml | 9 ----- dart/test/gilded_rose_test.dart | 13 ------- 5 files changed, 131 deletions(-) delete mode 100644 dart/.gitignore delete mode 100644 dart/bin/main.dart delete mode 100644 dart/lib/gilded_rose.dart delete mode 100644 dart/pubspec.yaml delete mode 100644 dart/test/gilded_rose_test.dart diff --git a/dart/.gitignore b/dart/.gitignore deleted file mode 100644 index 33d0df0e..00000000 --- a/dart/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Files and directories created by pub -.packages -.pub/ -packages -pubspec.lock # (Remove this pattern if you wish to check in your lock file) -.idea \ No newline at end of file diff --git a/dart/bin/main.dart b/dart/bin/main.dart deleted file mode 100644 index 240994c5..00000000 --- a/dart/bin/main.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:gilded_rose/gilded_rose.dart'; - -main(List args) { - print("OMGHAI!"); - - var items = [ - new Item("+5 Dexterity Vest", 10, 20), - new Item("Aged Brie", 2, 0), - new Item("Elixir of the Mongoose", 5, 7), - new Item("Sulfuras, Hand of Ragnaros", 0, 80), - new Item("Sulfuras, Hand of Ragnaros", -1, 80), - new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), - new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), - new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), - // this conjured item does not work properly yet - new Item("Conjured Mana Cake", 3, 6) - ]; - - GildedRose app = new GildedRose(items); - - int days = 2; - if (args.length > 0) { - days = int.parse(args[0]) + 1; - } - - for (int i = 0; i < days; i++) { - print("-------- day $i --------"); - print("name, sellIn, quality"); - for (var item in items) { - print(item); - } - print(''); - app.updateQuality(); - } -} diff --git a/dart/lib/gilded_rose.dart b/dart/lib/gilded_rose.dart deleted file mode 100644 index 94857b32..00000000 --- a/dart/lib/gilded_rose.dart +++ /dev/null @@ -1,68 +0,0 @@ -class GildedRose { - List items; - - GildedRose(this.items); - - void updateQuality() { - for (int i = 0; i < items.length; i++) { - if (items[i].name != "Aged Brie" && - items[i].name != "Backstage passes to a TAFKAL80ETC concert") { - if (items[i].quality > 0) { - if (items[i].name != "Sulfuras, Hand of Ragnaros") { - items[i].quality = items[i].quality - 1; - } - } - } else { - if (items[i].quality < 50) { - items[i].quality = items[i].quality + 1; - - if (items[i].name == "Backstage passes to a TAFKAL80ETC concert") { - if (items[i].sellIn < 11) { - if (items[i].quality < 50) { - items[i].quality = items[i].quality + 1; - } - } - - if (items[i].sellIn < 6) { - if (items[i].quality < 50) { - items[i].quality = items[i].quality + 1; - } - } - } - } - } - - if (items[i].name != "Sulfuras, Hand of Ragnaros") { - items[i].sellIn = items[i].sellIn - 1; - } - - if (items[i].sellIn < 0) { - if (items[i].name != "Aged Brie") { - if (items[i].name != "Backstage passes to a TAFKAL80ETC concert") { - if (items[i].quality > 0) { - if (items[i].name != "Sulfuras, Hand of Ragnaros") { - items[i].quality = items[i].quality - 1; - } - } - } else { - items[i].quality = items[i].quality - items[i].quality; - } - } else { - if (items[i].quality < 50) { - items[i].quality = items[i].quality + 1; - } - } - } - } - } -} - -class Item { - String name; - int sellIn; - int quality; - - Item(this.name, this.sellIn, this.quality); - - String toString() => '$name, $sellIn, $quality'; -} diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml deleted file mode 100644 index ce8365c9..00000000 --- a/dart/pubspec.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: gilded_rose -version: 0.0.1 -description: A simple console application. - -environment: - sdk: '>=2.10.0 <3.0.0' - -dev_dependencies: - test: ^1.16.8 diff --git a/dart/test/gilded_rose_test.dart b/dart/test/gilded_rose_test.dart deleted file mode 100644 index 69e4a489..00000000 --- a/dart/test/gilded_rose_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:test/test.dart'; -import 'package:gilded_rose/gilded_rose.dart'; - -main() { - test('foo', () { - var item = new Item('foo', 0, 0); - var items = [item]; - - GildedRose app = new GildedRose(items); - app.updateQuality(); - expect("fixme", app.items[0].name); - }); -}