xref: /original-bsd/usr.bin/learn/learn/whatnow.c (revision 9cf5e8d3)
1 #ifndef lint
2 static char sccsid[] = "@(#)whatnow.c	4.2	(Berkeley)	04/25/83";
3 #endif not lint
4 
5 #include "stdio.h"
6 #include "lrnref.h"
7 
8 extern	char	togo[];
9 extern	int	review;
10 
11 whatnow()
12 {
13 	if (again) {
14 		if (!review)
15 			printf("\nOK.  That was lesson %s.\n\n", todo);
16 		fflush(stdout);
17 		strcpy(level, togo);
18 		return;
19 	}
20 	if (skip) {
21 		printf("\nOK.  That was lesson %s.\n", todo);
22 		printf("Skipping to next lesson.\n\n");
23 		fflush(stdout);
24 		strcpy(level, todo);
25 		skip = 0;
26 		return;
27 	}
28 	if (todo == 0) {
29 		more=0;
30 		return;
31 	}
32 	if (didok) {
33 		strcpy(level,todo);
34 		if (speed<=9) speed++;
35 	}
36 	else {
37 		speed -= 4;
38 		/* the 4 above means that 4 right, one wrong leave
39 		    you with the same speed. */
40 		if (speed <0) speed=0;
41 	}
42 	if (wrong) {
43 		speed -= 2;
44 		if (speed <0 ) speed = 0;
45 	}
46 	if (didok && more) {
47 		printf("\nGood.  That was lesson %s.\n\n",level);
48 		fflush(stdout);
49 	}
50 }
51