From 711d24f20e30022d239bda4e4fcf5b658a8d6a3d Mon Sep 17 00:00:00 2001 From: Joe Lukas Kalb Date: Tue, 6 Feb 2024 19:31:49 +0100 Subject: [PATCH] dimesions --- src/main/c/labyrinth.c | 5 +++++ src/main/c/labyrinth.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index 1d70380..997f1b7 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -21,6 +21,11 @@ unsigned short get_natural_number(char text[]){ return result; } +void dimesions(unsigned short *len_x, unsigned short *len_y){ + *len_x = get_natural_number("Bitte gib die x-Laenge des Labyrinthes an:\n"); + *len_y = get_natural_number("Bitte gib die y-Laenge des Labyrinthes an:\n"); +} + void turn_direction_right(Direction *direction){ switch (*direction) { case N: diff --git a/src/main/c/labyrinth.h b/src/main/c/labyrinth.h index 593d111..4494394 100644 --- a/src/main/c/labyrinth.h +++ b/src/main/c/labyrinth.h @@ -10,5 +10,6 @@ void init_field(Field_State** field, unsigned short len_x, unsigned short len_y) short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Direction direction, unsigned short len_x, unsigned short len_y); void show_solution(Field_State** field, unsigned short len_x, unsigned short len_y); unsigned short get_natural_number(char text[]); +void dimesions(unsigned short *len_x, unsigned short *len_y); #endif // TEST_H