diff --git a/src/c/labyrinth.c b/src/c/labyrinth.c index cb15a6b..a5feb45 100644 --- a/src/c/labyrinth.c +++ b/src/c/labyrinth.c @@ -15,12 +15,15 @@ int printlabyrinth(lab laby, int hoehe, int breite){ } printf("\n"); } + printf("\n"); return 0; } int wegsuchen(lab laby, int y, int x, int ziely, int zielx){ + laby[y][x] = 'X'; + if(x == zielx && y == ziely){ return 0; } diff --git a/test/c/test_labyrinth.c b/test/c/test_labyrinth.c index 0f05551..6f93168 100644 --- a/test/c/test_labyrinth.c +++ b/test/c/test_labyrinth.c @@ -68,6 +68,27 @@ void test_LabyrinthAmZiel2(void){ TEST_ASSERT_EQUAL_INT(-1, result); +} + +void test_LabyrinthMarkiert(void){ + + char result; + int input = 1; + int hoehe = 3; + int breite = 3; + lab laby = { + {'0', '1', '1'}, + {'1', '1', '1'}, + {'1', '1', '1'}, + }; + + + wegsuchen(laby, 0, 0, 0, 0); + result = laby[0][0]; + printlabyrinth(laby, hoehe, breite); + TEST_ASSERT_EQUAL_CHAR('X', result); + + } #endif // TEST \ No newline at end of file