You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
563 B
33 lines
563 B
#include "labyrinth.h"
|
|
|
|
#include "global.h"
|
|
|
|
#include "stdio.h"
|
|
#include "stdlib.h"
|
|
|
|
void turn_direction_right(Direction *direction){
|
|
switch (*direction) {
|
|
case N:
|
|
*direction = E;
|
|
break;
|
|
case E:
|
|
*direction = S;
|
|
break;
|
|
case S:
|
|
*direction = W;
|
|
break;
|
|
case W:
|
|
*direction = N;
|
|
break;
|
|
}
|
|
}
|
|
|
|
void lab_move(unsigned short *x, unsigned short *y, Direction direction){
|
|
|
|
if (direction == N){
|
|
*x = 0;
|
|
return;
|
|
}
|
|
|
|
}
|
|
|