OpenCores
URL https://opencores.org/ocsvn/z3/z3/trunk

Subversion Repositories z3

[/] [z3/] [trunk/] [utils/] [touchgenerator.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 charcole
#include <stdio.h>
2
#include <stdlib.h>
3
 
4
int touch[][3]={
5
        { 'z', 200, 850 },
6
        { 'x', 300, 850 },
7
        { 'c', 400, 850 },
8
        { 'v', 450, 850 },
9
        { 'b', 550, 850 },
10
        { 'n', 640, 850 },
11
        { 'm', 720, 850 },
12
        { ',', 800, 850 },
13
        { 'a', 150, 800 },
14
        { 's', 250, 800 },
15
        { 'd', 320, 800 },
16
        { 'f', 410, 800 },
17
        { 'g', 500, 800 },
18
        { 'h', 600, 800 },
19
        { 'j', 700, 800 },
20
        { 'k', 780, 800 },
21
        { 'l', 850, 800 },
22
        { 'q', 150, 750 },
23
        { 'w', 200, 750 },
24
        { 'e', 300, 750 },
25
        { 'r', 400, 750 },
26
        { 't', 450, 750 },
27
        { 'y', 550, 750 },
28
        { 'u', 650, 750 },
29
        { 'i', 700, 750 },
30
        { 'o', 800, 750 },
31
        { 'p', 900, 750 },
32
        { ' ', 500, 900 },
33
        { 'Z', 200, 850 },
34
        { 'X', 300, 850 },
35
        { 'C', 400, 850 },
36
        { 'V', 450, 850 },
37
        { 'B', 550, 850 },
38
        { 'N', 640, 850 },
39
        { 'M', 720, 850 },
40
        { 'A', 150, 800 },
41
        { 'S', 250, 800 },
42
        { 'D', 320, 800 },
43
        { 'F', 410, 800 },
44
        { 'G', 500, 800 },
45
        { 'H', 600, 800 },
46
        { 'J', 700, 800 },
47
        { 'K', 780, 800 },
48
        { 'L', 850, 800 },
49
        { 'Q', 150, 750 },
50
        { 'W', 200, 750 },
51
        { 'E', 300, 750 },
52
        { 'R', 400, 750 },
53
        { 'T', 450, 750 },
54
        { 'Y', 550, 750 },
55
        { 'U', 650, 750 },
56
        { 'I', 700, 750 },
57
        { 'O', 800, 750 },
58
        { 'P', 900, 750 },
59
        { '\n',800, 900 }
60
};
61
 
62
int main(int argc, char **argv)
63
{
64
        FILE *f=fopen("script2.txt", "r");
65
        while (!feof(f))
66
        {
67
                char line[1024];
68
                fgets(line, sizeof(line), f);
69
                int c=0;
70
                while (line[c])
71
                {
72
                        int x,y;
73
                        int z=1023;
74
                        int i;
75
                        for (i=0; i<sizeof(touch)/sizeof(touch[0]); i++)
76
                        {
77
                                if (line[c]==touch[i][0])
78
                                {
79
                                        x=touch[i][1];
80
                                        y=touch[i][2];
81
                                        break;
82
                                }
83
                        }
84
                        if (i==sizeof(touch)/sizeof(touch[0]))
85
                        {
86
                                printf("Couldn't find char %d(%c)\n", line[c], line[c]);
87
                                exit(1);
88
                        }
89
                        for (i=0; i<10; i++)
90
                        {
91
                                printf("%d %d %d\n", x, y, z);
92
                        }
93
                        z=0;
94
                        for (i=0; i<20; i++)
95
                        {
96
                                printf("%d %d %d\n", x, y, z);
97
                        }
98
                        z=1023;
99
                        for (i=0; i<10; i++)
100
                        {
101
                                printf("%d %d %d\n", x, y, z);
102
                        }
103
                        c++;
104
                }
105
        }
106
        fclose(f);
107
        return 0;
108
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.