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