From ff173f7340cf1bf213b0e3ac9c870f7ea27b4950 Mon Sep 17 00:00:00 2001 From: Ronja Awe Date: Thu, 2 Feb 2023 15:26:45 +0100 Subject: [PATCH] =?UTF-8?q?weiteres=20labyrinzh=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c/labyrinth.c | 15 +++++++++++++++ test/c/test_labyrinth.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/c/labyrinth.c b/src/c/labyrinth.c index 10998d1..d2996ea 100644 --- a/src/c/labyrinth.c +++ b/src/c/labyrinth.c @@ -97,6 +97,21 @@ void labyrinthauswahl(int auswahl){ int breite = 6; printlabyrinth(laby, hoehe, breite); break; + case 2: + lab laby2 = { + {'0', '0', '0', '0', '1', '0', '1', '1', '0'}, + {'1', '0', '1', '0', '0', '1', '1', '1', '0'}, + {'1', '0', '1', '1', '0', '0', '1', '1', '0'}, + {'0', '0', '0', '1', '1', '0', '1', '0', '1'}, + {'0', '1', '0', '1', '0', '0', '1', '0', '1'}, + {'0', '1', '0', '1', '0', '1', '0', '0', '0'}, + {'0', '1', '0', '1', '0', '0', '0', '1', '0'}, + + }; + hoehe = 7; + breite = 9; + printlabyrinth(laby2, hoehe, breite); + break; default: break; diff --git a/test/c/test_labyrinth.c b/test/c/test_labyrinth.c index cf05752..8a9cf5d 100644 --- a/test/c/test_labyrinth.c +++ b/test/c/test_labyrinth.c @@ -310,4 +310,41 @@ void test_LabyrinthAuswahl(void){ } + +void test_LabyrinthAuswahl2(void){ + + bool result; + int input = 1; + int hoehe = 7; + int breite = 9; + int schritte = 19; + int versuche = 0; + int auswahl = 2; + + + + lab laby = { + {'0', '0', '0', '0', '1', '0', '1', '1', '0'}, + {'1', '0', '1', '0', '0', '1', '1', '1', '0'}, + {'1', '0', '1', '1', '0', '0', '1', '1', '0'}, + {'0', '0', '0', '1', '1', '0', '1', '0', '1'}, + {'0', '1', '0', '1', '0', '0', '1', '0', '1'}, + {'0', '1', '0', '1', '0', '1', '0', '0', '0'}, + {'0', '1', '0', '1', '0', '0', '0', '1', '0'}, + }; + + labyrinthauswahl(auswahl); + //printlabyrinth(laby, hoehe, breite); //hier in die funktion die print frage machen + wegsuchen(laby, &result, 0, 0, 6, 8); + + userInput_ExpectAndReturn(5); + userInput_ExpectAndReturn(8); + userInput_ExpectAndReturn(10); + userInput_ExpectAndReturn(schritte); + + labyrinthschritte(laby, hoehe, breite, schritte, versuche); //die gleiche funktion nur mit dem if vergleich und userinput + TEST_ASSERT_EQUAL_INT(1, result); + +} + #endif // TEST \ No newline at end of file