#ifndef BASE_H
#define BASE_H

void init_all(int nP);
void destroy_all();

int ln_baseN(int n, int b);
int notLN(int n, int b);
int convex_seg(int x1, int x2, double theta);
double to_double(int n);
int pw(int x, int n);
double distance_pt(int x1, int x2, int y1, int y2);
int max(int a, int b);
int min(int a, int b);
int mfax(double a, double b);
int mfin(double a, double b);

double norm(ptf p);
double distance(ptf p1, ptf p2);
ptf normalize(ptf p);
double dot(ptf p1, ptf p2);
ptf add(ptf p1, ptf p2);

double getTotalRemainingDistance(level* lvl, path* pth, int nPl);

path* getPath(level* lvl);
void printPath(path* pth);
void printLvl(level* lvl);
void freePath(path* p);

#endif