-\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
- newgame.state.c_iflag = 0;\r
- newgame.state.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