URL
https://opencores.org/ocsvn/z3/z3/trunk
Subversion Repositories z3
[/] [z3/] [trunk/] [utils/] [touchgenerator.c] - Rev 2
Compare with Previous | Blame | View Log
#include <stdio.h> #include <stdlib.h> int touch[][3]={ { 'z', 200, 850 }, { 'x', 300, 850 }, { 'c', 400, 850 }, { 'v', 450, 850 }, { 'b', 550, 850 }, { 'n', 640, 850 }, { 'm', 720, 850 }, { ',', 800, 850 }, { 'a', 150, 800 }, { 's', 250, 800 }, { 'd', 320, 800 }, { 'f', 410, 800 }, { 'g', 500, 800 }, { 'h', 600, 800 }, { 'j', 700, 800 }, { 'k', 780, 800 }, { 'l', 850, 800 }, { 'q', 150, 750 }, { 'w', 200, 750 }, { 'e', 300, 750 }, { 'r', 400, 750 }, { 't', 450, 750 }, { 'y', 550, 750 }, { 'u', 650, 750 }, { 'i', 700, 750 }, { 'o', 800, 750 }, { 'p', 900, 750 }, { ' ', 500, 900 }, { 'Z', 200, 850 }, { 'X', 300, 850 }, { 'C', 400, 850 }, { 'V', 450, 850 }, { 'B', 550, 850 }, { 'N', 640, 850 }, { 'M', 720, 850 }, { 'A', 150, 800 }, { 'S', 250, 800 }, { 'D', 320, 800 }, { 'F', 410, 800 }, { 'G', 500, 800 }, { 'H', 600, 800 }, { 'J', 700, 800 }, { 'K', 780, 800 }, { 'L', 850, 800 }, { 'Q', 150, 750 }, { 'W', 200, 750 }, { 'E', 300, 750 }, { 'R', 400, 750 }, { 'T', 450, 750 }, { 'Y', 550, 750 }, { 'U', 650, 750 }, { 'I', 700, 750 }, { 'O', 800, 750 }, { 'P', 900, 750 }, { '\n',800, 900 } }; int main(int argc, char **argv) { FILE *f=fopen("script2.txt", "r"); while (!feof(f)) { char line[1024]; fgets(line, sizeof(line), f); int c=0; while (line[c]) { int x,y; int z=1023; int i; for (i=0; i<sizeof(touch)/sizeof(touch[0]); i++) { if (line[c]==touch[i][0]) { x=touch[i][1]; y=touch[i][2]; break; } } if (i==sizeof(touch)/sizeof(touch[0])) { printf("Couldn't find char %d(%c)\n", line[c], line[c]); exit(1); } for (i=0; i<10; i++) { printf("%d %d %d\n", x, y, z); } z=0; for (i=0; i<20; i++) { printf("%d %d %d\n", x, y, z); } z=1023; for (i=0; i<10; i++) { printf("%d %d %d\n", x, y, z); } c++; } } fclose(f); return 0; }