-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforsthaus.c
71 lines (61 loc) · 1.47 KB
/
forsthaus.c
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
68
69
70
#include <stdio.h>
#include <unistd.h>
#include <term.h>
#include <termios.h>
#define yrt(ch,d,f,s,e)\
case ch: \
fprintf(stdout,"i 1 0 %d %d %d %d\n",d,f,s,e); break
#define art(ch,d,f,s,e)\
case ch: \
fprintf(stdout,"i 2 0 %d %d %d %d\n",d,f,s,e); break
#define qrt(ch,d,f,s,e)\
case ch: \
fprintf(stdout,"i 3 0 %d %d %d %d\n",d,f,s,e); break
int main(void){
int p;
int c;
static struct termios oldt, newt;
p = 1;
tcgetattr( STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~(ICANON | ECHO);
tcsetattr( STDIN_FILENO, TCSANOW, &newt);
while((c=getchar())!= 27) {
switch(c) {
yrt('z',1,2,1100,1200);
yrt('x',3,2,110,110);
yrt('c',4,1,800,600);
yrt('v',4,1,600,800);
yrt('b',1,3,700,750);
yrt('n',4,3,720,720);
yrt('m',1,3,750,750);
yrt(',',3,3,790,790);
yrt('.',6,1,400,300);
yrt('/',8,3,60,66);
art('a',1,2,110,120);
art('s',3,2,110,110);
art('d',4,1,800,600);
art('f',4,1,600,800);
art('g',1,3,700,750);
art('h',4,3,720,720);
art('j',1,3,750,750);
art('k',3,3,790,790);
art('l',6,1,400,300);
art(';',8,3,60,66);
qrt('q',1,2,1100,1200);
qrt('w',3,2,110,110);
qrt('e',4,1,800,600);
qrt('r',4,1,600,800);
qrt('t',1,3,700,750);
qrt('y',4,3,720,720);
qrt('u',1,3,750,750);
qrt('i',3,3,790,790);
qrt('o',6,1,400,300);
qrt('p',8,3,60,66);
}
// fflush( csound_pointer );
fflush(stdout);
}
tcsetattr( STDIN_FILENO, TCSANOW, &oldt);
return 0;
}