Verbessert findPossiblePositions rechtsfrei untenfrei.

This commit is contained in:
LukVal54 2025-11-02 14:57:33 +01:00
parent d5882589c0
commit 7d48b1d990

View File

@ -1,3 +1,4 @@
//Bearbeitet von Lukas Wörner, 02.11.25
#include "game.h"
#include <time.h>
#include <stdlib.h>
@ -95,6 +96,10 @@ int findPossiblePositions(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN]
}
}
else
{
rechtsfrei = 0;
}
//nach unten prüfen
if(searchFieldLen - i >= wordlen)
{
@ -107,6 +112,10 @@ int findPossiblePositions(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN]
}
}
}
else
{
untenfrei = 0;
}
if(rechtsfrei) //Positions array wird mit gültigen Positionen und Richtung befüllt.
{
positions[positionamount].x = k;