Projekt/snake_main.c
int x_offset_from_dir(Direction dir){
      if(dir == 'L' || dir == 'R'){
        return (dir == 'L') ? -SPEED : SPEED; // L = - and R = +
      }else{
        return 0;
      }
    }
/*helper that calculates how much x should be updated depending on the direction*/
helper that calculates how much x should be updated depending on the direction
helper that calculates how much x should be updated depending on the direction
int x_offset_from_dir(Direction dir){
      if(dir == 'L' || dir == 'R'){
        return (dir == 'L') ? -SPEED : SPEED; 
      }else{
        return 0;
      }
    }
int x_offset_from_dir ( Direction dir ) { if ( dir == ' ' || dir == ' ' ) { return ( dir == ' ' ) ? - SPEED : SPEED ; } else { return 0 ; } }
helper that calculates how much x should be updated depending on the direction
helper that calculates how much x should be updated depending on the direction
// L = - and R = +