#include <stdlib.h>\r
#include <time.h>\r
-#include <sys/ioctl.h>\r
-#include <sys/termio.h>\r
\r
void randomize(void) {\r
srand((int)time(NULL));\r
}\r
-\r
-\r
-int max(int a, int b) {\r
- if (a > b) return a;\r
- return b;\r
-}\r
-\r
-int min(int a, int b) {\r
- if (a < b) return a;\r
- return b;\r
-}\r
-\r
-int getch(void) {\r
- char chbuf[1];\r
- struct termio oldstate, newstate;\r
- ioctl(0,TCGETA,&oldstate);\r
- newstate = oldstate;\r
- newstate.c_iflag = 0;\r
- newstate.c_lflag = 0;\r
- ioctl(0,TCSETA,&newstate);\r
- read(0, &chbuf, 1);\r
- ioctl(0,TCSETA,&oldstate);\r
-}
\ No newline at end of file