This commit is contained in:
Lukian LEIZOUR 2023-11-20 10:24:31 +01:00
parent 50ea8f2735
commit aa5045a797
4 changed files with 41 additions and 10 deletions

View file

@ -58,8 +58,9 @@ void drawRectangle(int x, int y, int lenght, int height)
void drawMenu(char *options[], int lenght) {
int max = strlen(options[0]);
int i;
for (int i = 0; i < lenght; i++) {
for (i = 0; i < lenght; i++) {
if (strlen(options[i]) > max) {
max = strlen(options[i]);
}
@ -72,7 +73,7 @@ void drawMenu(char *options[], int lenght) {
drawRectangle((columns - max - 4) / 2, 2, max + 4, lenght + 4);
for (int i = 0; i < lenght; i++) {
for (i = 0; i < lenght; i++) {
goToCoords((columns - max - 4) / 2 + 2, 4 + i);
printf("%s", options[i]);
}
@ -174,4 +175,4 @@ void menu()
default:
break;
}
}
}