diff --git a/game1_input.txt b/game1_input.txt index 2f9f701..eb4ab3a 100644 --- a/game1_input.txt +++ b/game1_input.txt @@ -63,6 +63,7 @@ tiger tiger tiger thunderstorm +list-resources draw draw draw @@ -111,6 +112,7 @@ draw draw draw draw +list-resources build? build steamboat build fireplace diff --git a/game1_output.txt b/game1_output.txt index 98421a4..0ab4313 100644 --- a/game1_output.txt +++ b/game1_output.txt @@ -1,4 +1,5 @@ OK +EMPTY wood wood wood @@ -47,6 +48,54 @@ metal metal metal metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +metal +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +plastic +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood +wood axe ballon club diff --git a/src/edu/kit/informatik/ui/command/ListResources.java b/src/edu/kit/informatik/ui/command/ListResources.java index d395db7..a23b471 100644 --- a/src/edu/kit/informatik/ui/command/ListResources.java +++ b/src/edu/kit/informatik/ui/command/ListResources.java @@ -16,7 +16,7 @@ public class ListResources extends Command { if (resources.isEmpty()) { Terminal.printLine("EMPTY"); } else { - resources.forEach(Terminal::printLine); + resources.descendingIterator().forEachRemaining(Terminal::printLine); } }