Skip to content
Snippets Groups Projects
Commit ac5519a1 authored by Janos's avatar Janos
Browse files

Korrektur der Vorbedingung

parent b527e9db
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ struct Car* init_car(int speed,int width,int height,int pred_pos,int pred_width, ...@@ -74,7 +74,7 @@ struct Car* init_car(int speed,int width,int height,int pred_pos,int pred_width,
} }
// Vorbedinung: // Vorbedinung:
// 0 < speed < 10, 0 < width < 500, 0 < height < 100, // 0 < |speed| < 10, 0 < width < 500, 0 < height < 100,
// 0 <= start_pos <= 900 // 0 <= start_pos <= 900
// Nachbedingung: Initialisierte LinkedList von Autos, abhängig von den Parametern // Nachbedingung: Initialisierte LinkedList von Autos, abhängig von den Parametern
...@@ -218,8 +218,9 @@ void free_car(struct Row *n){ ...@@ -218,8 +218,9 @@ void free_car(struct Row *n){
// Bestimmt, ob es eine Kollision des Spielers mit einem Auto/Boot gibt // Bestimmt, ob es eine Kollision des Spielers mit einem Auto/Boot gibt
// Funktion wird nur aufgerufem, wenn der Spieler in der gleichen Reihe mit dem Auto oder Boot ist // Funktion wird nur aufgerufem, wenn der Spieler in der gleichen Reihe mit dem Auto oder Boot ist
// Im positiven Fall wird true zurück gegeben
// Vorbedingung: Spieler ist in der gleichen Reihe, wie das Fahrzeug
// Nachbedingung: Gibt true zurück, wenn sich der Spieler und das Auto überschneiden, sonst false
bool kollision(int x_pos,int width){ bool kollision(int x_pos,int width){
for(int j = 0;j<3;j++){ for(int j = 0;j<3;j++){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment