-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.c
79 lines (57 loc) · 1008 Bytes
/
Main.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
71
72
73
74
75
76
77
78
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "save_word.h"
#include "random_char.h"
#include "wrongchar.h"
#include "newchar.h"
#include "ramji.h"
//#include "Practice.h"
#define MAX_WORD 100
#define NUM_WORDS 10
int main(int argc, char const *argv[])
{
int msec = 0, trigger = 100; /* 100ms*/
clock_t before = clock();
float number=0,WPM;
printf("\033[1;31m");
int n;
//char alphabet='a';
while(1){
printf("Enter \n 1) Easy \n 2) Difficult \n 3) Show Scoreboard \n 4) Efficiency \n ");
printf("\033[0;32m");
scanf("%d",&n);
switch(n)
{
case 2:
{
do {
clock_t difference = clock() - before;
msec = difference * 1000 / CLOCKS_PER_SEC;
number++;
wrongchar();
saver();//infile newchar.h
} while ( msec < trigger );
WPM=number/0.16;
printf("YOUR WPM IS %f",WPM);
break;
}
case 1:
{
random_char();
break;
}
case 3:
{
reportcard();
break;
}
case 4:
{
efficincy();
break;
}
}
}
}