Subversion Repositories Kolibri OS

Rev

Rev 7142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7142 Rev 7185
Line 1... Line 1...
1
#include 
1
#include 
2
#include 
2
#include 
3
#ifndef KOS32
-
 
4
#include 
3
#include 
5
#else
4
 
6
#include 
-
 
7
#endif
-
 
8
#ifndef WINDOWS
5
#ifndef WINDOWS
-
 
6
#ifndef KOS32
9
#include 
7
#include 
10
#include 
8
#include 
11
#include 
9
#include 
12
#endif
10
#endif
-
 
11
#endif
Line 13... Line 12...
13
 
12
 
14
void randomize(void) {
-
 
15
#ifndef KOS32
13
void randomize(void) {
16
	srand((int)time(NULL));
-
 
17
#else
-
 
18
	srand(get_tick_count());
-
 
19
#endif
14
	srand((int)time(NULL));
Line 20... Line 15...
20
}
15
}
21
 
16
 
22
///#ifndef WINDOWS
17
#if !defined(KOS32) && !defined(__TINYC__)
23
int max(int a, int b) {
18
int max(int a, int b) {
24
	if (a > b) return a;
19
	if (a > b) return a;
Line 25... Line 20...
25
	return b;
20
	return b;
26
}
21
}
27
 
22
 
28
int min(int a, int b) {
23
int min(int a, int b) {
-
 
24
	if (a < b) return a;
-
 
25
	return b;
29
	if (a < b) return a;
26
}
-
 
27
#endif
30
	return b;
28
 
31
}
29
#ifndef WINDOWS
32
#ifndef WINDOWS
30
#ifndef KOS32
33
int // 
31
int // 
34
getch// 
32
getch// 
Line 44... Line 42...
44
	read(0, &chbuf, 1);
42
	read(0, &chbuf, 1);
45
	tcsetattr(0, TCSANOW, &oldstate);
43
	tcsetattr(0, TCSANOW, &oldstate);
46
        return chbuf[0];
44
        return chbuf[0];
47
}
45
}
48
#endif
46
#endif
49
47
#endif
-
 
48
50
49