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