Projekt/snake_main.c
bool user_turning_180_degrees(Direction dir){
      switch (snake.facing_direction){
      case 'U':
        return dir == 'D';
        
      case 'D':
        return dir == 'U';

      case 'L':
        return dir == 'R';
        
      case 'R':
        return dir == 'L';
    
      default:
        return false;
      }
    }
/*helper that calculates if the user is trying to turn left when going right or up when going down etc. (180 degrees)*/
helper that calculates if the user is trying to turn left when going right or up when going down etc.
helper that calculates if the user is trying to turn left when going right or up when going down etc .
bool user_turning_180_degrees(Direction dir){
      switch (snake.facing_direction){
      case 'U':
        return dir == 'D';
      case 'D':
        return dir == 'U';
      case 'L':
        return dir == 'R';
      case 'R':
        return dir == 'L';
      default:
        return false;
      }
    }
bool user_turning_180_degrees ( Direction dir ) { switch ( snake . facing_direction ) { case ' ' : return dir == ' ' ; case ' ' : return dir == ' ' ; case ' ' : return dir == ' ' ; case ' ' : return dir == ' ' ; default : return false ; } }
helper that calculates if the user is trying to turn left when going right or up when going down etc.
helper that calculates if the user is trying to turn left when going right or up when going down etc .