#define TTHREE #define global #include "iteach1.h" /* The main program contains the error messages, which correspond to those in the Mac program. Factor sets the tick size for timing. A file is read in if specified, and the appropriate headings and copyright messages are printed. The teach subroutine is then entered */ void main(short argc,char **argv) { #ifdef MAC argc = ccommand(&argv); #else textmode(3); #endif factor = CLK_TCK; init(); /* Set up variables and time */ if (argc == 2) { /* If a file was specified, open it */ openDo(argc,argv); } clrscr(); gotoxy(16,8); /* prog indicates whether MT2 (prog=1) or MT3(prog=2 or 4) is executing*/ if (prog == '2' || prog == '4') puts("MacTeach 3, Version 2.1: Learning Loglan Affixes"); else puts ("MacTeach 2, Version 2.1: Learning Loglan Words"); gotoxy(11,10); puts ("Copyright(C) 1986-94 by the Loglan Institute, Inc."); gotoxy(30,11); puts("All rights reserved."); gotoxy(19,13); puts ("Programmed in C by Robert A. McIvor"); gotoxy(27,15); puts ("Based on a FORTH program by"); gotoxy(24,16); puts ("James Cooke Brown & Glen B. Haydon"); gotoxy(26,18); puts ("Press any key to continue."); getche(); if(inpfile) display(); doTeach(argc,argv); /* Begin the teaching session */ } void doSeek(void) /* This routine is used to look up a word or word fragment. All primitives, affixes or English equivalents containing the string entered will be displayed. Unlike the Mac program, no selection of prim, affix, or translation is required */ { short i; char istring[10]; if (!testIn()) return; puts("Enter search string"); gets(istring); for (i=0; i "); if (doTime() < 0) { /*Measure time to first keystroke*/ SysBeep(PAR); /*If threshold exceeded, equivalent to error*/ ++tmouts; demote(n); statdo(ticks); goto show; /*Display answer*/ } gets(instring); /* Get the response */ } else gets(instring); /* Get the response from review (Next,Halt)*/ if (!strlen(instring)) { /*No answer is an error*/ demote(n); goto show; } if (reviewflag) goto show; /*Show answer for review*/ statdo(ticks); /* update the statistics */ switch(curflag) { /*Check the answer for correctness*/ case 0: strcpy(istring,flasharray[n].trans); mycomp(istring,instring) ? promote(n) : demote(n); break; case 1: case 2: strcmp(instring,flasharray[n].prim)? demote(n):promote(n); break; case 3: strcmp(instring,flasharray[n].affix)? demote(n):promote(n); break; } show: switch(curflag) { /*Show the answer fields*/ case 1: show4(n); show5(n); break; case 3: case 0: case 2: show4(n); show5(n); show611(n); show7(n); break; } gotoxy(20,1); printf("Press RETURN to continue, X or Q to end %s\n", reviewflag ? "review." : "test. "); return screenchr(); /*Get the return response*/ }