/*____________________________________________________________________________
by Martin Robinson
collection of function and macro
______________________________________________________________________________
todo:

preprocessor________________________________________________________________*/

#pragma once
#ifndef _MACRO
#define _MACRO

#include "heap.h"
#include "stack.h"
#include "tile.h"

/*NULL________________________________________________________________________
in C, -1 is a bad return value, used in case of faillure
will make the code more readable to give this value
a proper name.
Why keep -1 as return value when 0 can do it better.
Answer : when working with index, 0 is already used;
*/
#define is(TEST) (TEST!=-1?1:0)
#define isnot(TEST) (TEST==-1?1:0)


/*most basic macro____________________________________________________________
*/
#define min(A,B) (A<B?A:B)
#define max(A,B) (A>B?A:B)

/*ARRAY_______________________________________________________________________
array iterator
iterator it=0;
do{
...
}while(iterate(it));
____________________________________________________________________________*/
//typedef int iterator;
//#define iterate(IT,SIZE) (++IT<SIZE)


#endif

