-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaketest.cpp
More file actions
68 lines (60 loc) · 1.08 KB
/
maketest.cpp
File metadata and controls
68 lines (60 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* Timothy Player
* MakeTest
* Description:
* Makes test case to be sorted for ToolSort
* this includes having like a color and then some
* Corresponding Colors So I randomly take a color
* and a level then put it on an array
* */
#include <cstdio>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
char lvl,r,g,b,tmp, normalizedLVL;
char key[4];
string rgb = "wrygb";
//So this makes a test file for tool sort pretty simple code imo
for (int i = 0; i < 10; ++i)
{
lvl = rand()%10;
tmp = rgb[rand()%5];
switch (tmp)
{
case 'w':
r = 0xFF;
g = 0xFF;
b = 0xFF;
break;
case 'r':
r = 0xFF;
g = 0;
b = 0;
break;
case 'b':
r = 0;
g = 0;
b = 0xFF;
break;
case 'y':
r = 0xFF;
g = 0xFF;
b = 0;
break;
case 'g':
r = 0;
g = 0xFF;
b = 0;
break;
}
key[3] = lvl;
key[2] = r;
key[1] = g;
key[0] = b;
//To check the level ranges we have to offset 0x01 with the char '0'
fwrite(key,1,4,stdout);
printf("%c",tmp);
}
return 0;
}