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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
| #include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
int rezhim=1,rivenj=1,chas=30,chas1=0,min=0,sec=0,NoCorect=0,Corect=0;
String slitera,skey;
TTrainForm *TrainForm;
//---------------------------------------------------------------------------
__fastcall TTrainForm::TTrainForm(TComponent* Owner)
: TForm(Owner)
{
}
//Ниже представлена функция, которая случайным образом выбирает английскую букву, которая будет падать
String EngWord(){
int rr; String ll;
randomize;
rr=random(26);
switch(rr){
case 0: return ll='q';
case 1: return ll='w';
case 2: return ll='e';
case 3: return ll='r';
case 4: return ll='t';
case 5: return ll='y';
case 6: return ll='u';
case 7: return ll='i';
case 8: return ll='o';
case 9: return ll='p';
case 10: return ll='a';
case 11: return ll='s';
case 12: return ll='d';
case 13: return ll='f';
case 14: return ll='g';
case 15: return ll='h';
case 16: return ll='j';
case 17: return ll='k';
case 18: return ll='l';
case 19: return ll='z';
case 20: return ll='x';
case 21: return ll='c';
case 22: return ll='v';
case 23: return ll='b';
case 24: return ll='n';
case 25: return ll='m';
}
};
//Ниже представлена функция, которая случайным образом выбирает украинскую букву, которая будет падать
String UkrWord(){
int rr; String ll;
randomize;
rr=random(32);
switch(rr){
case 0: return ll='й';
case 1: return ll='ц';
case 2: return ll='у';
case 3: return ll='к';
case 4: return ll='е';
case 5: return ll='н';
case 6: return ll='г';
case 7: return ll='ш';
case 8: return ll='щ';
case 9: return ll='з';
case 10: return ll='х';
case 11: return ll='ї';
case 12: return ll='ф';
case 13: return ll='і';
case 14: return ll='в';
case 15: return ll='а';
case 16: return ll='п';
case 17: return ll='р';
case 18: return ll='о';
case 19: return ll='л';
case 20: return ll='д';
case 21: return ll='ж';
case 22: return ll='є';
case 23: return ll='я';
case 24: return ll='ч';
case 25: return ll='с';
case 26: return ll='м';
case 27: return ll='и';
case 28: return ll='т';
case 29: return ll='ь';
case 30: return ll='б';
case 31: return ll='ю';
}
};
//Ниже представлена функция, которая случайным образом выбирает русскую букву, которая будет падать
String RusWord(){
int rr; String ll;
randomize;
rr=random(33);
switch(rr){
case 0: return ll='й';
case 1: return ll='ц';
case 2: return ll='у';
case 3: return ll='к';
case 4: return ll='е';
case 5: return ll='н';
case 6: return ll='г';
case 7: return ll='ш';
case 8: return ll='щ';
case 9: return ll='з';
case 10: return ll='х';
case 11: return ll='ъ';
case 12: return ll='ф';
case 13: return ll='ы';
case 14: return ll='в';
case 15: return ll='а';
case 16: return ll='п';
case 17: return ll='р';
case 18: return ll='о';
case 19: return ll='л';
case 20: return ll='д';
case 21: return ll='ж';
case 22: return ll='э';
case 23: return ll='я';
case 24: return ll='ч';
case 25: return ll='с';
case 26: return ll='м';
case 27: return ll='и';
case 28: return ll='т';
case 29: return ll='ь';
case 30: return ll='б';
case 31: return ll='ю';
case 32: return ll='ё';
}
};
void __fastcall TTrainForm::N5Click(TObject *Sender)
{
TrainForm->Close();
}
//---------------------------------------------------------------------------
void __fastcall TTrainForm::N6Click(TObject *Sender)
{
Application->MessageBoxA("Программа Клавиатурный Тренажер","Про Программу...",MB_OK);
}
//Во время запуска программы будут скрыты все компоненты--------------------
void __fastcall TTrainForm::FormCreate(TObject *Sender)
{
Timer1->Enabled=false;
Timer2->Enabled=false;
Options->Hide();
TrainUkr->Hide();
TrainRus->Hide();
TrainEng->Hide();
PTimer->Hide();
}
//Считывает данные, которые задал пользователь на вкладке Опции----------------------
void __fastcall TTrainForm::Button1Click(TObject *Sender)
{
if (ukrainian->Checked==true)
rezhim=2; else
if (russian->Checked==true)
rezhim=3; else rezhim=1;
if (prof->Checked==true)
rivenj=2; else rivenj=1;
chas=StrToInt(time->Text);
Options->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TTrainForm::N7Click(TObject *Sender)
{
Application->MessageBoxA("Программу разработал студент ІІІ курса Факультета информатики Сорока Э.И.","Про Автора...",MB_OK);
}
//После выбора Файл->Тренажер выполняется следующее----------------------------
void __fastcall TTrainForm::N4Click(TObject *Sender)
{
TrainUkr->Hide();
TrainRus->Hide();
TrainEng->Hide();
Options->Hide();
Application->MessageBoxA("Натисніть Enter, чтобы начать тренировку"," Внимание!",MB_OK);
PTimer->Show(); sec=0; min=0; Timer1->Enabled=true;
Timer2->Enabled=true;
Pravilno->Caption=0; Corect=0;
NePravilno->Caption=0; NoCorect=0;
if (rezhim==1) {
TrainUkr->Hide();
TrainRus->Hide();
Options->Hide();
LiteraEng->Top=8;
}
if (rezhim==2){
LiteraUkr->Top=8;
TrainRus->Hide();
TrainEng->Hide();
Options->Hide();
}
if (rezhim==3){ LiteraRus->Top=8;
TrainUkr->Hide();
TrainEng->Hide();
Options->Hide();
}
if (rivenj==1) Timer2->Interval=11; else Timer2->Interval=4;
sec=0; min=0; chas1=0;
//-----Ниже оформленный процесс падения украинской буквы
//-----и подсветка падающей буквы на виртуальной клавиатуре
if (rezhim==2){
TrainUkr->Show();
LiteraUkr->Show();
int LeftRan;
Randomize;
LeftRan=random(623)+8;
LiteraUkr->Left=LeftRan;
slitera=UkrWord();
LiteraUkr->Caption=slitera;
if (slitera=='й') q1->Font->Color=clRed; else q1->Font->Color=clBlack;
if (slitera=='ц') w1->Font->Color=clRed; else w1->Font->Color=clBlack;
if (slitera=='у') e1->Font->Color=clRed; else e1->Font->Color=clBlack;
if (slitera=='к') r1->Font->Color=clRed; else r1->Font->Color=clBlack;
if (slitera=='е') t1->Font->Color=clRed; else t1->Font->Color=clBlack;
if (slitera=='н') y1->Font->Color=clRed; else y1->Font->Color=clBlack;
if (slitera=='г') u1->Font->Color=clRed; else u1->Font->Color=clBlack;
if (slitera=='ш') i1->Font->Color=clRed; else i1->Font->Color=clBlack;
if (slitera=='щ') o1->Font->Color=clRed; else o1->Font->Color=clBlack;
if (slitera=='з') p1->Font->Color=clRed; else p1->Font->Color=clBlack;
if (slitera=='х') p11->Font->Color=clRed; else p11->Font->Color=clBlack;
if (slitera=='ї') p111->Font->Color=clRed; else p111->Font->Color=clBlack;
if (slitera=='ф') a1->Font->Color=clRed; else a1->Font->Color=clBlack;
if (slitera=='і') s1->Font->Color=clRed; else s1->Font->Color=clBlack;
if (slitera=='в') d1->Font->Color=clRed; else d1->Font->Color=clBlack;
if (slitera=='а') f1->Font->Color=clRed; else f1->Font->Color=clBlack;
if (slitera=='п') g1->Font->Color=clRed; else g1->Font->Color=clBlack;
if (slitera=='р') h1->Font->Color=clRed; else h1->Font->Color=clBlack;
if (slitera=='о') j1->Font->Color=clRed; else j1->Font->Color=clBlack;
if (slitera=='л') k1->Font->Color=clRed; else k1->Font->Color=clBlack;
if (slitera=='д') l1->Font->Color=clRed; else l1->Font->Color=clBlack;
if (slitera=='ж') l11->Font->Color=clRed; else l11->Font->Color=clBlack;
if (slitera=='є') l111->Font->Color=clRed; else l111->Font->Color=clBlack;
if (slitera=='я') z1->Font->Color=clRed; else z1->Font->Color=clBlack;
if (slitera=='ч') x1->Font->Color=clRed; else x1->Font->Color=clBlack;
if (slitera=='с') c1->Font->Color=clRed; else c1->Font->Color=clBlack;
if (slitera=='м') v1->Font->Color=clRed; else v1->Font->Color=clBlack;
if (slitera=='и') b1->Font->Color=clRed; else b1->Font->Color=clBlack;
if (slitera=='т') n11->Font->Color=clRed; else n11->Font->Color=clBlack;
if (slitera=='ь') m1->Font->Color=clRed; else m1->Font->Color=clBlack;
if (slitera=='б') m11->Font->Color=clRed; else m11->Font->Color=clBlack;
if (slitera=='ю') m111->Font->Color=clRed; else m111->Font->Color=clBlack;
};
//-----Ниже оформленный процесс падения русской буквы
//-----и подсветка падающей буквы на виртуальной клавиатуре
if (rezhim==3){
TrainRus->Show();
LiteraRus->Show();
int LeftRan;
Randomize;
LeftRan=random(623)+8;
LiteraRus->Left=LeftRan;
slitera=RusWord();
LiteraRus->Caption=slitera;
if (slitera=='й') q2->Font->Color=clRed; else q2->Font->Color=clBlack;
if (slitera=='ц') w2->Font->Color=clRed; else w2->Font->Color=clBlack;
if (slitera=='у') e2->Font->Color=clRed; else e2->Font->Color=clBlack;
if (slitera=='к') r2->Font->Color=clRed; else r2->Font->Color=clBlack;
if (slitera=='е') t2->Font->Color=clRed; else t2->Font->Color=clBlack;
if (slitera=='н') y2->Font->Color=clRed; else y2->Font->Color=clBlack;
if (slitera=='г') u2->Font->Color=clRed; else u2->Font->Color=clBlack;
if (slitera=='ш') i2->Font->Color=clRed; else i2->Font->Color=clBlack;
if (slitera=='щ') o2->Font->Color=clRed; else o2->Font->Color=clBlack;
if (slitera=='з') p2->Font->Color=clRed; else p2->Font->Color=clBlack;
if (slitera=='х') p22->Font->Color=clRed; else p22->Font->Color=clBlack;
if (slitera=='ъ') p222->Font->Color=clRed; else p222->Font->Color=clBlack;
if (slitera=='ф') a2->Font->Color=clRed; else a2->Font->Color=clBlack;
if (slitera=='ы') s2->Font->Color=clRed; else s2->Font->Color=clBlack;
if (slitera=='в') d2->Font->Color=clRed; else d2->Font->Color=clBlack;
if (slitera=='а') f2->Font->Color=clRed; else f2->Font->Color=clBlack;
if (slitera=='п') g2->Font->Color=clRed; else g2->Font->Color=clBlack;
if (slitera=='р') h2->Font->Color=clRed; else h2->Font->Color=clBlack;
if (slitera=='о') j2->Font->Color=clRed; else j2->Font->Color=clBlack;
if (slitera=='л') k2->Font->Color=clRed; else k2->Font->Color=clBlack;
if (slitera=='д') l2->Font->Color=clRed; else l2->Font->Color=clBlack;
if (slitera=='ж') l22->Font->Color=clRed; else l22->Font->Color=clBlack;
if (slitera=='э') l222->Font->Color=clRed; else l222->Font->Color=clBlack;
if (slitera=='я') z2->Font->Color=clRed; else z2->Font->Color=clBlack;
if (slitera=='ч') x2->Font->Color=clRed; else x2->Font->Color=clBlack;
if (slitera=='с') c2->Font->Color=clRed; else c2->Font->Color=clBlack;
if (slitera=='м') v2->Font->Color=clRed; else v2->Font->Color=clBlack;
if (slitera=='и') b2->Font->Color=clRed; else b2->Font->Color=clBlack;
if (slitera=='т') n22->Font->Color=clRed; else n22->Font->Color=clBlack;
if (slitera=='ь') m2->Font->Color=clRed; else m2->Font->Color=clBlack;
if (slitera=='б') m22->Font->Color=clRed; else m22->Font->Color=clBlack;
if (slitera=='ю') m222->Font->Color=clRed; else m222->Font->Color=clBlack;
if (slitera=='ё') ee->Font->Color=clRed; else ee->Font->Color=clBlack;
}
//-----Ниже оформленный процесс падения английской буквы
//-----и подсветка падающей буквы на виртуальной клавиатуре
if (rezhim==1) {
TrainEng->Show();
LiteraEng->Show();
int LeftRan;
Randomize;
LeftRan=random(623)+8;
LiteraEng->Left=LeftRan;
slitera=EngWord();
LiteraEng->Caption=slitera;
if (slitera=='q') q->Font->Color=clRed; else q->Font->Color=clBlack;
if (slitera=='w') w->Font->Color=clRed; else w->Font->Color=clBlack;
if (slitera=='e') e->Font->Color=clRed; else e->Font->Color=clBlack;
if (slitera=='r') r->Font->Color=clRed; else r->Font->Color=clBlack;
if (slitera=='t') t->Font->Color=clRed; else t->Font->Color=clBlack;
if (slitera=='y') y->Font->Color=clRed; else y->Font->Color=clBlack;
if (slitera=='u') u->Font->Color=clRed; else u->Font->Color=clBlack;
if (slitera=='i') i->Font->Color=clRed; else i->Font->Color=clBlack;
if (slitera=='o') o->Font->Color=clRed; else o->Font->Color=clBlack;
if (slitera=='p') p->Font->Color=clRed; else p->Font->Color=clBlack;
if (slitera=='a') a->Font->Color=clRed; else a->Font->Color=clBlack;
if (slitera=='s') s->Font->Color=clRed; else s->Font->Color=clBlack;
if (slitera=='d') d->Font->Color=clRed; else d->Font->Color=clBlack;
if (slitera=='f') f->Font->Color=clRed; else f->Font->Color=clBlack;
if (slitera=='g') g->Font->Color=clRed; else g->Font->Color=clBlack;
if (slitera=='h') h->Font->Color=clRed; else h->Font->Color=clBlack;
if (slitera=='j') j->Font->Color=clRed; else j->Font->Color=clBlack;
if (slitera=='k') k->Font->Color=clRed; else k->Font->Color=clBlack;
if (slitera=='l') l->Font->Color=clRed; else l->Font->Color=clBlack;
if (slitera=='z') z->Font->Color=clRed; else z->Font->Color=clBlack;
if (slitera=='x') x->Font->Color=clRed; else x->Font->Color=clBlack;
if (slitera=='c') c->Font->Color=clRed; else c->Font->Color=clBlack;
if (slitera=='v') v->Font->Color=clRed; else v->Font->Color=clBlack;
if (slitera=='b') b->Font->Color=clRed; else b->Font->Color=clBlack;
if (slitera=='n') n->Font->Color=clRed; else n->Font->Color=clBlack;
if (slitera=='m') m->Font->Color=clRed; else m->Font->Color=clBlack;
}
}
//Открываются Опции клавиатурного тренажера------------------------------------------
void __fastcall TTrainForm::N3Click(TObject *Sender)
{
Timer1->Enabled=false;
Timer2->Enabled=false;
PTimer->Hide();
TrainUkr->Hide();
TrainRus->Hide();
TrainEng->Hide();
Options->Show();
}
//--------------------------------
void __fastcall TTrainForm::Timer1Timer(TObject *Sender)
{
if (sec==59){ min++; sec=-1;
}
sec++; chas1++;
int nul=0;
if (sec<10) timersec->Caption=IntToStr(nul)+IntToStr(sec); else timersec->Caption=IntToStr(sec);
if (min<10) timermin->Caption=IntToStr(nul)+IntToStr(min); else timermin->Caption=IntToStr(min);
}
//-------------------------
void __fastcall TTrainForm::Timer2Timer(TObject *Sender)
{
//-----
if (rezhim==1){
LiteraEng->Top=(LiteraEng->Top)+1;
if (LiteraEng->Top>225) {
if (LiteraEng->Top!=255+1)
NoCorect++;
NePravilno->Caption=IntToStr(NoCorect);
if (rezhim==1) slitera=EngWord();
LiteraEng->Top=8;
Randomize;
int lran;
lran=random(623)+8;
LiteraEng->Left=lran;
LiteraEng->Caption=slitera; LiteraEng->Show(); }
}
if (rezhim==2){
LiteraUkr->Top=(LiteraUkr->Top)+1;
if (LiteraUkr->Top>225) {
if (LiteraUkr->Top!=255+1)
NoCorect++;
NePravilno->Caption=IntToStr(NoCorect);
slitera=UkrWord();
LiteraUkr->Top=8;
Randomize;
int lran;
lran=random(623)+8;
LiteraUkr->Left=lran;
LiteraUkr->Caption=slitera; LiteraUkr->Show(); }
}
if (rezhim==3){
LiteraRus->Top=(LiteraRus->Top)+1;
if (LiteraRus->Top>225) {
if (LiteraRus->Top!=255+1)
NoCorect++;
NePravilno->Caption=IntToStr(NoCorect);
slitera=RusWord();
LiteraRus->Top=8;
Randomize;
int lran;
lran=random(623)+8;
LiteraRus->Left=lran;
LiteraRus->Caption=slitera; LiteraRus->Show(); }
}
//-----
if (rezhim==1) {
if (slitera=='q') q->Font->Color=clRed; else q->Font->Color=clBlack;
if (slitera=='w') w->Font->Color=clRed; else w->Font->Color=clBlack;
if (slitera=='e') e->Font->Color=clRed; else e->Font->Color=clBlack;
if (slitera=='r') r->Font->Color=clRed; else r->Font->Color=clBlack;
if (slitera=='t') t->Font->Color=clRed; else t->Font->Color=clBlack;
if (slitera=='y') y->Font->Color=clRed; else y->Font->Color=clBlack;
if (slitera=='u') u->Font->Color=clRed; else u->Font->Color=clBlack;
if (slitera=='i') i->Font->Color=clRed; else i->Font->Color=clBlack;
if (slitera=='o') o->Font->Color=clRed; else o->Font->Color=clBlack;
if (slitera=='p') p->Font->Color=clRed; else p->Font->Color=clBlack;
if (slitera=='a') a->Font->Color=clRed; else a->Font->Color=clBlack;
if (slitera=='s') s->Font->Color=clRed; else s->Font->Color=clBlack;
if (slitera=='d') d->Font->Color=clRed; else d->Font->Color=clBlack;
if (slitera=='f') f->Font->Color=clRed; else f->Font->Color=clBlack;
if (slitera=='g') g->Font->Color=clRed; else g->Font->Color=clBlack;
if (slitera=='h') h->Font->Color=clRed; else h->Font->Color=clBlack;
if (slitera=='j') j->Font->Color=clRed; else j->Font->Color=clBlack;
if (slitera=='k') k->Font->Color=clRed; else k->Font->Color=clBlack;
if (slitera=='l') l->Font->Color=clRed; else l->Font->Color=clBlack;
if (slitera=='z') z->Font->Color=clRed; else z->Font->Color=clBlack;
if (slitera=='x') x->Font->Color=clRed; else x->Font->Color=clBlack;
if (slitera=='c') c->Font->Color=clRed; else c->Font->Color=clBlack;
if (slitera=='v') v->Font->Color=clRed; else v->Font->Color=clBlack;
if (slitera=='b') b->Font->Color=clRed; else b->Font->Color=clBlack;
if (slitera=='n') n->Font->Color=clRed; else n->Font->Color=clBlack;
if (slitera=='m') m->Font->Color=clRed; else m->Font->Color=clBlack;
}
if (rezhim==2) {
if (slitera=='й') q1->Font->Color=clRed; else q1->Font->Color=clBlack;
if (slitera=='ц') w1->Font->Color=clRed; else w1->Font->Color=clBlack;
if (slitera=='у') e1->Font->Color=clRed; else e1->Font->Color=clBlack;
if (slitera=='к') r1->Font->Color=clRed; else r1->Font->Color=clBlack;
if (slitera=='е') t1->Font->Color=clRed; else t1->Font->Color=clBlack;
if (slitera=='н') y1->Font->Color=clRed; else y1->Font->Color=clBlack;
if (slitera=='г') u1->Font->Color=clRed; else u1->Font->Color=clBlack;
if (slitera=='ш') i1->Font->Color=clRed; else i1->Font->Color=clBlack;
if (slitera=='щ') o1->Font->Color=clRed; else o1->Font->Color=clBlack;
if (slitera=='з') p1->Font->Color=clRed; else p1->Font->Color=clBlack;
if (slitera=='х') p11->Font->Color=clRed; else p11->Font->Color=clBlack;
if (slitera=='ї') p111->Font->Color=clRed; else p111->Font->Color=clBlack;
if (slitera=='ф') a1->Font->Color=clRed; else a1->Font->Color=clBlack;
if (slitera=='і') s1->Font->Color=clRed; else s1->Font->Color=clBlack;
if (slitera=='в') d1->Font->Color=clRed; else d1->Font->Color=clBlack;
if (slitera=='а') f1->Font->Color=clRed; else f1->Font->Color=clBlack;
if (slitera=='п') g1->Font->Color=clRed; else g1->Font->Color=clBlack;
if (slitera=='р') h1->Font->Color=clRed; else h1->Font->Color=clBlack;
if (slitera=='о') j1->Font->Color=clRed; else j1->Font->Color=clBlack;
if (slitera=='л') k1->Font->Color=clRed; else k1->Font->Color=clBlack;
if (slitera=='д') l1->Font->Color=clRed; else l1->Font->Color=clBlack;
if (slitera=='ж') l11->Font->Color=clRed; else l11->Font->Color=clBlack;
if (slitera=='є') l111->Font->Color=clRed; else l111->Font->Color=clBlack;
if (slitera=='я') z1->Font->Color=clRed; else z1->Font->Color=clBlack;
if (slitera=='ч') x1->Font->Color=clRed; else x1->Font->Color=clBlack;
if (slitera=='с') c1->Font->Color=clRed; else c1->Font->Color=clBlack;
if (slitera=='м') v1->Font->Color=clRed; else v1->Font->Color=clBlack;
if (slitera=='и') b1->Font->Color=clRed; else b1->Font->Color=clBlack;
if (slitera=='т') n11->Font->Color=clRed; else n11->Font->Color=clBlack;
if (slitera=='ь') m1->Font->Color=clRed; else m1->Font->Color=clBlack;
if (slitera=='б') m11->Font->Color=clRed; else m11->Font->Color=clBlack;
if (slitera=='ю') m111->Font->Color=clRed; else m111->Font->Color=clBlack;
}
if (rezhim==3) {
if (slitera=='й') q2->Font->Color=clRed; else q2->Font->Color=clBlack;
if (slitera=='ц') w2->Font->Color=clRed; else w2->Font->Color=clBlack;
if (slitera=='у') e2->Font->Color=clRed; else e2->Font->Color=clBlack;
if (slitera=='к') r2->Font->Color=clRed; else r2->Font->Color=clBlack;
if (slitera=='е') t2->Font->Color=clRed; else t2->Font->Color=clBlack;
if (slitera=='н') y2->Font->Color=clRed; else y2->Font->Color=clBlack;
if (slitera=='г') u2->Font->Color=clRed; else u2->Font->Color=clBlack;
if (slitera=='ш') i2->Font->Color=clRed; else i2->Font->Color=clBlack;
if (slitera=='щ') o2->Font->Color=clRed; else o2->Font->Color=clBlack;
if (slitera=='з') p2->Font->Color=clRed; else p2->Font->Color=clBlack;
if (slitera=='х') p22->Font->Color=clRed; else p22->Font->Color=clBlack;
if (slitera=='ъ') p222->Font->Color=clRed; else p222->Font->Color=clBlack;
if (slitera=='ф') a2->Font->Color=clRed; else a2->Font->Color=clBlack;
if (slitera=='ы') s2->Font->Color=clRed; else s2->Font->Color=clBlack;
if (slitera=='в') d2->Font->Color=clRed; else d2->Font->Color=clBlack;
if (slitera=='а') f2->Font->Color=clRed; else f2->Font->Color=clBlack;
if (slitera=='п') g2->Font->Color=clRed; else g2->Font->Color=clBlack;
if (slitera=='р') h2->Font->Color=clRed; else h2->Font->Color=clBlack;
if (slitera=='о') j2->Font->Color=clRed; else j2->Font->Color=clBlack;
if (slitera=='л') k2->Font->Color=clRed; else k2->Font->Color=clBlack;
if (slitera=='д') l2->Font->Color=clRed; else l2->Font->Color=clBlack;
if (slitera=='ж') l22->Font->Color=clRed; else l22->Font->Color=clBlack;
if (slitera=='э') l222->Font->Color=clRed; else l222->Font->Color=clBlack;
if (slitera=='я') z2->Font->Color=clRed; else z2->Font->Color=clBlack;
if (slitera=='ч') x2->Font->Color=clRed; else x2->Font->Color=clBlack;
if (slitera=='с') c2->Font->Color=clRed; else c2->Font->Color=clBlack;
if (slitera=='м') v2->Font->Color=clRed; else v2->Font->Color=clBlack;
if (slitera=='и') b2->Font->Color=clRed; else b2->Font->Color=clBlack;
if (slitera=='т') n22->Font->Color=clRed; else n22->Font->Color=clBlack;
if (slitera=='ь') m2->Font->Color=clRed; else m2->Font->Color=clBlack;
if (slitera=='б') m22->Font->Color=clRed; else m22->Font->Color=clBlack;
if (slitera=='ю') m222->Font->Color=clRed; else m222->Font->Color=clBlack;
if (slitera=='ё') ee->Font->Color=clRed; else ee->Font->Color=clBlack;
}
//-----
if ((chas1==chas)&&(chas!=0)){
Timer2->Enabled=false; Timer1->Enabled=false;
if (rezhim==1) LiteraEng->Hide();
if (rezhim==2) LiteraUkr->Hide();
if (rezhim==3) LiteraRus->Hide();
Form2->Show();
Form2->NePravilno->Caption=IntToStr(NoCorect);
Form2->Pravilno->Caption=IntToStr(Corect);
Form2->All->Caption=IntToStr(Corect+NoCorect);
if (NoCorect!=0){
float kk;
kk=(float)Corect/(float)NoCorect;
Form2->Koef->Caption=FloatToStr(kk);
}
else
Form2->Koef->Caption=IntToStr(Corect);
}
}
void __fastcall TTrainForm::FormKeyPress(TObject *Sender, char &Key)
{
skey=Key;
if (skey==slitera){
if (rezhim==1) slitera=EngWord();
if (rezhim==2) slitera=UkrWord();
if (rezhim==3) slitera=RusWord();
Corect++;
if (rezhim==1){
LiteraEng->Hide(); LiteraEng->Top=255;
}
if (rezhim==2){
LiteraUkr->Hide(); LiteraUkr->Top=255;
}
if (rezhim==3){
LiteraRus->Hide(); LiteraRus->Top=255;
}
Pravilno->Caption=IntToStr(Corect);
} else {
NoCorect++; NePravilno->Caption=IntToStr(NoCorect);
}
}
//
void __fastcall TTrainForm::N8Click(TObject *Sender)
{
TrainForm->Hide();
Form3->Show();
} |