Refactor days

This commit is contained in:
Denys 2025-05-11 18:57:44 +12:00
parent 1313648b66
commit 32edb8321c

View File

@ -6,9 +6,9 @@ fun main(args: Array<String>) {
val app = App(GildedRose(ItemRepository.items)) val app = App(GildedRose(ItemRepository.items))
var days = 2 val days = when {
if (args.size > 0) { args.isNotEmpty() -> Integer.parseInt(args[0]) + 1
days = Integer.parseInt(args[0]) + 1 else -> 2
} }
app.printGlideRoseTable(days) app.printGlideRoseTable(days)