initial commit
This commit is contained in:
28
c/darts/src/darts.h
Normal file
28
c/darts/src/darts.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef DARTS_H
|
||||
#define DARTS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <float.h>
|
||||
|
||||
typedef struct {
|
||||
float x, y;
|
||||
} coordinate_t;
|
||||
|
||||
typedef struct {
|
||||
float radius;
|
||||
int score;
|
||||
} score_t;
|
||||
|
||||
// to allow float comparisons we consider 2 floats are equal if
|
||||
// their difference is below this value.
|
||||
// Use: avoid the '<' & '>' which may be wrong.
|
||||
#define MIN_FLOAT_EQUAL FLT_EPSILON
|
||||
|
||||
extern unsigned score(coordinate_t);
|
||||
|
||||
#ifdef TESTALL
|
||||
#undef TEST_IGNORE
|
||||
#define TEST_IGNORE() {}
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user