-
Notifications
You must be signed in to change notification settings - Fork 0
/
evaluation.pde
70 lines (67 loc) · 1.63 KB
/
evaluation.pde
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
/************************
Replace ambigous letters
***********************/
char evaluateLetter(char letter){
if (ambigousLetters.contains(str(letter))){
switch (letter) {
case 'E' :
letter = 'F';
ambigFlag = true;
break;
case 'O' :
letter = 'C';
ambigFlag = true;
break;
case 'R' :
letter = 'P';
ambigFlag = true;
break;
case 'B' :
letter = '\b';
SpecialCharacter = "UC3,8,99,-3,0,0,-8,3,0,-99,-3,4.5,99,3,0"; // for a better E
ambigFlag = true;
break;
case '?' :
letter = '.';
ambigFlag = true;
break;
case '!' :
letter = '.';
ambigFlag = true;
break;
case 'T' :
letter = '\b';
SpecialCharacter = "UC2,0,99,0,8";
//plotPosition(-1,0);
ambigFlag = true;
break;
case 'U' :
letter = 'J';
ambigFlag = true;
break;
case 'Q' :
letter = 'O';
ambigFlag = true;
break;
}
}
return letter;
}
char evaluateAmbigLetter(char letter){
if (ambigousLetters.contains(str(letter))){
ambigFlag = false;
plotletterAmbig(letter);
} else if (letter == '\n') {
println("Now making a linefeed");
plotNewline();
plotLetterPosition(0,0.2); // reduce linefeed distance
} else if (letter == '\r') {
plotLabel(str(letter));
} else if (letter == '\t') {
println("Now making a turn");
plotSwitchDirection();
} else {
plotLabel(" ");
}
return letter;
}