

DECLARE SUB SPEAK (phr$)
DECLARE SUB SPEAKER (pa$)
DECLARE SUB REMOTE ()
DECLARE SUB modemsettings ()
DECLARE SUB diskgr ()
DECLARE SUB RS232 ()
DECLARE SUB FILELIST (SUFFIX$)
DECLARE SUB COPYOS ()
DECLARE SUB PROCTEXT (text$)
DECLARE SUB CRTSCREEN (X!, y!)
DECLARE SUB UPDPROMPT ()
DECLARE SUB tablet (X!, y!)
DECLARE SUB SHOWCUBE (X!, y!, C!)
DECLARE SUB CLICKNOISE ()
DECLARE SUB CUBE (MX!, MY!)
DECLARE SUB MOVEWINDOW (h!, v!)
DECLARE SUB mousejoy ()
DECLARE SUB HEKEY (HX!, HV!, RCH$)
DECLARE SUB HEBLOC (HH!, VV!, ch$)
DECLARE SUB scroll ()
DECLARE SUB WORDLEARN (pa$, OUTPA$)


'DEFINT A-Z
DECLARE SUB MOUSE (which)
DECLARE SUB UDCUR ()
DECLARE SUB BOX (X!, y!, C!)
DECLARE SUB PLACE (CUC!)
DECLARE SUB PRSCREEN ()
DECLARE SUB CHARACTER (X!, y!, ch$, C!, SIZE!)

'=============== MOUSE STUFF ==============


DIM SHARED mouser$, MOUSELEFTBUTTON, MouseRightButton, MOUSEXPOS, MOUSEYPOS, AX%, bx%, cx%, dx%, BU
COMMON SHARED jx, jy, jx1, jy1, X, y, C, BC, X1, Y1, CURTPX, MX, MY
COMMON SHARED MSPLACE, LMX1, LMY1, blkcol
COMMON SHARED MESS$, ctx$, ke$, text$, TXT$
 COMMON SHARED OPP$, CR$, root$
 COMMON SHARED lt$
 COMMON SHARED hebrewkeyboard
 COMMON SHARED youread$
 COMMON SHARED showtrail
 COMMON SHARED mspresent
 ' time$ qbasic real time clock variable ##:##:## hr mn se
 COMMON SHARED oppv, ctxvar
 COMMON SHARED swth
 COMMON SHARED shht

  ' ROOT$ = "c:\qbasic\"
  OPEN "root.dat" FOR INPUT AS #1
   LINE INPUT #1, root$
  CLOSE #1
  mspresent = 0' mouse disabled

IF mspresent = 1 THEN MOUSE 0


DATA 55,89,E5,8B,5E,0C,8B,07,50,8B,5E,0A,8B,07,50,8B
DATA 5E,08,8B,0F,8B,5E,06,8B,17,5B,58,1E,07,CD,33,53
DATA 8B,5E,0C,89,07,58,8B,5E,0A,89,07,8B,5E,08,89,0F
DATA 8B,5E,06,89,17,5D,CA,08,00


REM
REM
REM
REM contact the programming team at yahoo // < Adam_Raccoon@Yahoo.com >
   
   
    DATA 205, 5, 203  : ' int 5  retf  'Machine-language code
                                       'for printing screen.

CLS
 swth = 620
 shht = 400
 MSPLACE = 1
 HNS = 0
 REM STANDS FOR HEBREW NUMBER SYSTEM
REM  ALEPH 1



REM  MICROSOFT    COLOR COMPUTER    COM PORT           PRINTER TELYTYPE
REM
REM  QBASIC        WINDOWS          PORT 1  PORT 2      VIRTUAL PORT
REM
REM   DOS            GUI            RS232   AUX         CARDMODEM
REM
REM




REM  THIS GETS CONFUSING I'D GET SOME PAPER A SHARPENED PENCIL AND
    'PUT SOME COFFEE ON .
    '
    ' WHAT YOU HAVE HERE CODED IN QBASIC IS A MULTI LEVEL LOWER MEMORY -
    '  OPPERATING SYSTEM
    '
    '   WHAT DOES THAT MEAN ????
    '
    '   IT MEANS THAT THIS
    '
    '   < C:\EMM386.EXE  >
    '   < DIR     TIME                        >
    '   < SHELL                               >
    '   < TYPE    COPY       MEM              >   DOS
    '   <                                     >
    '   <                  *******.BAT        >
    '
    '      the stable dos environment
    '
    '
    '    and this ....
    '
    '   <  GUI DATABASE FONTS               >
    '   <   UPPER MEMORY                    >
    '   <    TASK ORENTED DRIVES            >
    '   <    objects                        >
    '   <    time sharrng                   >     coco windows
    '   <      macros                       >
    '
    '        good presentation
    '
    '
    '
    '
    '
    '
    '   and the CoCo ???
    '
    '   coco clone of Basic similar to the TRS - 80 CoCo2
    '   - Extended dos
    '   - Modem rs232
    '   - the sound speech cart
    '   - Extended Graffix
    '
    '
    '
    '   have been integrated into Qbasic ????
    '
    '   stop wasting time try to test projects writing long lines of code
    '    use the multi - level opperating system that does it all
    '
    '
    '
    '     Yes ! this is the Color Computer windows your parents never had ..
    '
    '

     ' you need vga to use this
     '  if your using a tandy 1000 get a vga card thats compatable with
     '   tandys weird video addressing
     '
     '


    SHELL "TYPE C:\RSLOGO.TX1"
    SLEEP 1

    SCREEN 12


      youread$ = "OK"

 
  REM begin

    IF mspresent = 1 THEN MOUSE (1)
     PRINT MOUSEXPOS, MOUSEYPOS

       osexit = 0' set to off
   CLS
  
   ON ERROR GOTO textmissing:
   REM build prompt
   OPEN "cocowt.txt" FOR INPUT AS #1
       
       
        INPUT #1, LINE0$
        INPUT #1, LINE1$
        INPUT #1, LINE2$
        INPUT #1, LINE3$
        INPUT #1, LINE4$
        INPUT #1, LINE5$

    

   CLOSE #1
  
   CR$ = CHR$(13)

   TX = 20: TY = 100
   CRTX = 10: CRTY = 180
   v = 1
   h = 43
   C = 0: NT = 8 * 40 + 9
   'PAINT (1, 1), 7
   BC = 7
   X = 8 * 40
   y = 1




      DO
     
      TXT$ = "EXTENDED COLOR BASIC " + CR$ + "OK" + CR$ + text$ + OPP$

      CALL CRTSCREEN(CRTX, CRTY)

      CALL UPDPROMPT




'KE$ = INKEY$
mousect = mousect + 1
IF mousect > 20 THEN

 IF mspresent = 1 THEN CALL MOUSE(3)

 mousect = 0
END IF


BU = MOUSELEFTBUTTON


CALL tablet(TX, TY)


   REM ### this is where the hebrew keyboard is

   IF hebrewkeyboard = 1 THEN CALL HEKEY(HX, HV, RCH$)
 
 
  blkcol = blkcol + 1: IF blkcol > 16 THEN blkcol = 0

      IF ke$ = CHR$(13) THEN adt$ = text$: CALL PROCTEXT(text$): GOSUB adtext: text$ = ""

      IF ke$ = CHR$(27) THEN osexit = 1


 

 GRN = 2

 IF showtrail = 1 THEN

 COLOR GRN
 LOCATE 18, 1: PRINT LINE0$; STRING$(40 - LEN(LINE0$), " ")
 LOCATE 19, 1: PRINT LINE1$; STRING$(40 - LEN(LINE1$), " ")
 LOCATE 20, 1: PRINT LINE2$; STRING$(40 - LEN(LINE2$), " ")
 LOCATE 21, 1: PRINT LINE3$; STRING$(40 - LEN(LINE3$), " ")
 LOCATE 22, 1: PRINT LINE4$; STRING$(40 - LEN(LINE4$), " ")
 LOCATE 23, 1: PRINT LINE5$; STRING$(40 - LEN(LINE5$), " ")
 
 LOCATE 25, 1:  PRINT text$; OPP$: COLOR GRN
 END IF

  IF youread$ <> "" THEN adt$ = youread$: GOSUB adtext: youread$ = ""


LOOP UNTIL osexit = 1' set to one to exit loop
      SCREEN 0
      COLOR 8, 2

      CLS
     
       dly = 0
       DO
     
       LOCATE 1, 1
     
       PRINT " exiting CoCo gui "
       PRINT " getting CoCo Extended Basic "
       PRINT " Please Wait ...      "; OPP$

       CALL UPDPROMPT
       IF ke$ = "Q" THEN END

       IF lx$ <> (lt$) THEN lx$ = lt$: dly = dly + 1

       LOOP UNTIL dly >= 5
textmissing:
       PRINT " Building os past ..."

      
       CLOSE #1

       OPEN "cocowt.txt" FOR OUTPUT AS #1
        PRINT #1, LINE0$
        PRINT #1, LINE1$
        PRINT #1, LINE2$
        PRINT #1, LINE3$
        PRINT #1, LINE4$
        PRINT #1, LINE5$



       CLOSE #1

       RUN "c:\qbasic\qbmenu.bas"





adtext:

      LINE0$ = LINE1$
      LINE1$ = LINE2$
      LINE2$ = LINE3$
      LINE3$ = LINE4$
      LINE4$ = LINE5$
      LINE5$ = adt$
      adt$ = ""

      'BASICTRAIL$ = LINE3$ + CR$ + LINE4$ + CR$ + LINE5$ + CR$
      

      RETURN

SUB BOX (X, y, C)

   LINE (X - 1, y - 1)-(X + 8, y + 10), C, B

END SUB

SUB CHARACTER (X, y, ch$, C, SIZE)

 MX = MOUSEXPOS
 MY = MOUSEYPOS

  IF BU = -1 AND MX > (X) AND MY > (y) AND MX < (X + 10) AND MY < (y + 10) THEN text$ = text$ + ch$



 DRAW "BM 0,0S4BR" + STR$(X) + "BD" + STR$(y) + "C" + STR$(C)
 DRAW "S" + STR$(SIZE)



SELECT CASE (ch$)
 CASE IS = ";'"
  DRAW "D3R2L2U3R6D8"
 CASE IS = ","
  DRAW "BD8R1U6D1R4D4F2"


 CASE IS = "."
  DRAW "R2D8U4E4"
  
 CASE IS = "A"
  DRAW "BD2D6R3U8L2R2D8R2U8"
 CASE IS = "B"
  DRAW "BR3R2D8L4"
 CASE IS = "C"
  DRAW "BR2R2D8R1L4"
 CASE IS = "D"
  DRAW "BR2R3D8U2L1D1L1D1"
 CASE IS = "E"
  DRAW "R6D4L2D1L1D3U6"
 CASE IS = "F"
  DRAW "R6D8L6"
 CASE IS = "G"
  DRAW "R2D8L2R2U1R2D1R2U8"
 CASE IS = "H"
  DRAW "BR3R2D2"
 CASE IS = "I"
  DRAW "BF1R2BD2D4"
 CASE IS = "J"
  DRAW "ND8R6D8"

 CASE IS = "K"
  DRAW "D1R6D6L4D1"

 CASE IS = "L"
  DRAW "R6D9"
  'LINE (x, y)-(x + 6, y), C
  'LINE -(x + 6, y + 9), C
 CASE IS = "M"
  DRAW "BD2F3E3G3F3L6"
 CASE IS = "N"
  DRAW "R6D7L4BD1BL2U6"

 CASE IS = "O"
  DRAW "R6D8L6U8"

  'LINE (x, y)-(x + 6, y + 8), C, B
 CASE IS = "P"
  DRAW "D3U3R6D8L6"

 CASE IS = "Q"
 CASE IS = "R"
 DRAW "BR2R4D4"

 CASE IS = "S"
  DRAW "R6L2D8"
 CASE IS = "T"
  DRAW "BD2D4BU6F6BU2U4"
 CASE IS = "U"
  DRAW "BR3R3L1D8"
 CASE IS = "V"
  DRAW "BD8U6BU2R6D8"

 CASE IS = "W"

 CASE IS = "X"

  DRAW "D5F3E3U5L6"
 CASE IS = "Y"
  DRAW "BD1D7R5U8G3"
 CASE IS = "Z"
  DRAW "BD2BR2R4L2D6"


END SELECT


 DRAW "S4"
END SUB

SUB CLICKNOISE



  FOR S = 400 TO 380 STEP -2

  SOUND 100 + S, .05

  NEXT S

END SUB

SUB COPYOS

INPUT "DRIVE TO COPY TO"; d$


SHELL "COPY C:QBwin01.BAS " + d$ + ":"



END SUB

SUB CRTSCREEN (X, y)
               GRN = 2

               HSIZE = 240
               VSIZE = 100

 IF BU = -1 AND MX >= (X) AND MY >= (y) AND MX <= (X + 10) AND MY <= (y + 10) THEN CALL MOVEWINDOW(X, y)

 IF POINT(X + 2, y + 2) <> (GRN) THEN LINE (X, y)-(X + HSIZE, y + VSIZE), GRN, BF

 LINE (X, y)-(X + 10, y + 10), 2, BF
 LINE (X - 2, y - 2)-(X + HSIZE, y + VSIZE), 7, B
 
 
 
 
  txx = 2
  tyy = 1
  ll = LEN(TXT$)
  FOR scrup = 1 TO (ll)
   ch$ = MID$(TXT$, scrup, 1)
    txx = txx + 1: IF txx > 30 THEN txx = 1: tyy = tyy + 1: IF tyy > 20 THEN tyy = 1
    TX = (txx * 8) + X: TY = (tyy * 8) + y
    LINE (TX, TY)-(TX + 8, TY + 8), GRN, BF
    ch$ = UCASE$(ch$)
    SELECT CASE (ch$)
    CASE IS = "0"
    LINE (TX + 1, TY + 1)-(TX + 5, TY + 5), 1, B
     LINE (TX + 5, TY + 1)-(TX + 1, TY + 5), 1
    CASE IS = "1"
     LINE (TX + 3, TY + 1)-(TX + 3, TY + 5), 1
     LINE (TX + 1, TY + 5)-(TX + 5, TY + 5), 1
    CASE IS = "2"
     LINE (TX + 1, TY + 2)-(TX + 2, TY + 1), 1
      LINE -(TX + 4, TY + 1), 1
       LINE -(TX + 3, TY + 3), 1
        LINE -(TX + 1, TY + 5), 1
         LINE -(TX + 5, TY + 5), 1
    CASE IS = "3"
     LINE (TX + 1, TY + 1)-(TX + 2, TY + 1), 1
      LINE -(TX + 5, TY + 1), 1
       LINE -(TX + 3, TY + 3), 1
        LINE -(TX + 5, TY + 3), 1
       LINE -(TX + 5, TY + 6), 1
      LINE -(TX + 1, TY + 5), 1
    CASE IS = "4"
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 3), 1
      LINE -(TX + 5, TY + 3), 1
       LINE (TX + 5, TY + 1)-(TX + 5, TY + 5), 1
    CASE IS = "5"
     LINE (TX + 5, TY + 1)-(TX + 1, TY + 1), 1
      LINE -(TX + 1, TY + 3), 1
       LINE -(TX + 3, TY + 3), 1
        LINE -(TX + 5, TY + 5), 1
         LINE -(TX + 1, TY + 5), 1
    CASE IS = "6"
      LINE (TX + 5, TY + 1)-(TX + 1, TY + 1), 1
       LINE -(TX + 1, TY + 3), 1
        LINE -(TX + 5, TY + 3), 1
         LINE -(TX + 5, TY + 5), 1
          LINE -(TX + 1, TY + 5), 1
           LINE -(TX + 1, TY + 3), 1
    CASE IS = "7"
      LINE (TX + 1, TY + 1)-(TX + 5, TY + 1), 1
       LINE -(TX + 1, TY + 5), 1
    CASE IS = "8"
      LINE (TX + 1, TY + 1)-(TX + 5, TY + 5), 1, B
       LINE (TX + 1, TY + 3)-(TX + 5, TY + 3), 1
    CASE IS = "9"
      LINE (TX + 1, TY + 1)-(TX + 5, TY + 5), 1, B
       LINE (TX + 1, TY + 3)-(TX + 5, TY + 3), 1
        LINE (TX + 1, TY + 4)-(TX + 1, TY + 5), 0
    CASE IS = "A"
      LINE (TX + 3, TY + 1)-(TX, TY + 3), 1: LINE -(TX + 6, TY + 3), 1
       LINE -(TX + 3, TY + 1), 1
        LINE (TX, TY + 3)-(TX, TY + 5), 1
         LINE (TX + 6, TY + 3)-(TX + 6, TY + 5), 1

    CASE IS = "B"
     LINE (TX + 1, TY + 1)-(TX + 3, TY + 3), 1, B
      LINE (TX + 1, TY + 3)-(TX + 5, TY + 5), 1, B
    CASE IS = "C"
     LINE (TX + 5, TY + 1)-(TX + 1, TY + 1), 1
      LINE -(TX + 1, TY + 5), 1
       LINE -(TX + 5, TY + 5), 1

    CASE IS = "D"
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
       CIRCLE (TX + 4, TY + 3), 3, 1, , , .5
    CASE IS = "E"
     LINE (TX + 1, TY + 1)-(TX + 4, TY + 1), 1
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
     LINE (TX + 1, TY + 3)-(TX + 3, TY + 3), 1
     LINE (TX + 1, TY + 5)-(TX + 5, TY + 5), 1
    CASE IS = "F"
     LINE (TX + 1, TY + 1)-(TX + 4, TY + 1), 1
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
     LINE (TX + 1, TY + 3)-(TX + 3, TY + 3), 1
     'LINE (tx + 1, ty + 5)-(tx + 5, ty + 5), 1
    CASE IS = "G"
       LINE (TX, TY)-(TX, TY + 1), 0
       DRAW "c1r5l5d4r5u2l2"

    CASE IS = "H"
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
     LINE (TX + 1, TY + 4)-(TX + 4, TY + 3), 1
     LINE (TX + 6, TY + 1)-(TX + 6, TY + 5), 1
    CASE IS = "I"
     LINE (TX + 1, TY + 1)-(TX + 4, TY + 1), 1
      LINE (TX + 2, TY + 1)-(TX + 2, TY + 5), 1
       LINE (TX + 1, TY + 5)-(TX + 4, TY + 5), 1
    CASE IS = "J"
     LINE (TX + 4, TY + 1)-(TX + 4, TY + 1), 1
      DRAW "c1d4l4u2"
    CASE IS = "K"
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
     LINE (TX + 1, TY + 3)-(TX + 5, TY + 1), 1
     LINE (TX + 2, TY + 2)-(TX + 5, TY + 5), 1

  
    CASE IS = "L"
     LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
     LINE (TX + 1, TY + 5)-(TX + 5, TY + 5), 1
    CASE IS = "M"
     LINE (TX, TY + 5)-(TX, TY + 5), 1
      DRAW "u5r2d5u5r2d5"
    CASE IS = "N"
     LINE (TX + 1, TY + 5)-(TX + 1, TY + 1)
      LINE -(TX + 5, TY + 5), 1
       LINE -(TX + 5, TY + 1), 1


    CASE IS = "O"
     LINE (TX + 1, TY + 1)-(TX + 5, TY + 5), 1, B
    CASE IS = "P"
     LINE (TX + 4, TY + 3)-(TX + 1, TY + 1), 1, B
     LINE -(TX + 1, TY + 5), 1
    CASE IS = "Q"
     CIRCLE (TX + 2, TY + 3), 2, 1
      LINE (TX + 2, TY + 3)-(TX + 4, TY + 6), 1
     


  
    CASE IS = "R"
     LINE (TX + 1, TY + 1)-(TX + 4, TY + 3), 1, B
     LINE (TX + 1, TY + 3)-(TX + 1, TY + 5), 1
     LINE (TX + 3, TY + 3)-(TX + 5, TY + 5), 1
    CASE IS = "S"
     LINE (TX + 4, TY + 1)-(TX + 4, TY + 1), 1
      DRAW "l4d2r4d3l4"
    CASE IS = "T"
     LINE (TX + 1, TY + 1)-(TX + 5, TY + 1), 1
      LINE (TX + 3, TY + 1)-(TX + 3, TY + 5), 1
    CASE IS = "U"
    LINE (TX + 1, TY + 1)-(TX + 1, TY + 5), 1
     LINE -(TX + 4, TY + 5), 1
      LINE -(TX + 4, TY + 1), 1
    CASE IS = "V"
     LINE (TX + 1, TY + 1)-(TX + 3, TY + 5), 1
      LINE -(TX + 5, TY + 1), 1

    CASE IS = "W"
     LINE (TX, TY + 1)-(TX, TY + 5), 1
      LINE -(TX + 2, TY + 1), 1
     LINE -(TX + 4, TY + 5), 1
      LINE -(TX + 5, TY + 1), 1
    CASE IS = "X"
    LINE (TX, TY)-(TX + 5, TY + 5), 1
    LINE (TX + 5, TY)-(TX, TY + 5), 1
  
    CASE IS = "Y"
    LINE (TX, TY)-(TX + 3, TY + 3), 1
    LINE -(TX + 4, TY + 1), 1
     LINE (TX + 3, TY + 3)-(TX + 3, TY + 5), 1
    CASE IS = "Z"
     LINE (TX + 1, TY + 1)-(TX + 4, TY + 1), 1
      LINE -(TX + 1, TY + 5), 1
       LINE -(TX + 5, TY + 5), 1


    CASE IS = ":"
    PSET (TX + 3, TY + 1), 1
    PSET (TX + 3, TY + 5), 1


    ' rem function stuff ###
   
    CASE IS = CHR$(13)
    tyy = tyy + 1
    txx = 0
    CASE IS = CHR$(32)
    txx = txx + 1
   
    LINE (TX + 1, TY + 1)-(TX + 5, TY + 5), GRN, BF

   
    
    CASE IS = CHR$(219)
    LINE (TX + 1, TY + 1)-(TX + 5, TY + 5), 1, BF


    END SELECT

  NEXT scrup
    TX = TX + 8
    SELECT CASE (cur0)
    CASE IS = 0
    LINE (TX + 1, TY + 5)-(TX + 5, TY + 5), 0

    CASE IS = 1
    LINE (TX + 1, TY + 5)-(TX + 5, TY + 5), 1
   


    END SELECT
    cur0 = cur0 + 1: IF cur0 > 1 THEN cur0 = 0



END SUB

SUB CUBE (MX, MY)

   CALL SHOWCUBE(MX, MY, 7)



   IF MX <> (LMX1) OR MY <> (LMY1) THEN

   CALL SHOWCUBE(LMX1, LMY1, 0)
   LMX1 = MX
   LMY1 = MY

   END IF



END SUB

SUB diskgr



LINE (150, 10)-(420, 190), 0, BF





END SUB

SUB FILELIST (SUFFIX$)

REM
REM
REM SHOWFILE
 NAME$ = SUFFIX$


 PRINT "#########"
 PRINT "# LIST  #"
 PRINT "#########"
  PRINT NAME$
IF NAME$ <> "" THEN
OPEN NAME$ FOR INPUT AS #1
 DO
 INPUT #1, a$
 PRINT a$


 v = v + 1
 IF v > 22 THEN v = 0: SLEEP

 LOOP UNTIL EOF(1)


CLOSE #1

 SLEEP
END IF
CLS
END SUB

SUB HEBLOC (HH, VV, ch$)

'LOCATE VV, HH: PRINT CH$;
WDTH = 10
HEIGHT = 10
X = HH * WDTH
y = VV * HEIGHT
SIZE = 4: C = 7
LINE (X, y)-(X + WDTH, y + HEIGHT), 0, BF
CALL CHARACTER(X, y, ch$, C, SIZE)



END SUB

SUB HEKEY (HX, HV, RCH$)
  'KE$ = INKEY$
  IF BU = -1 AND MX > (HX) AND MX < (HX + 5) AND MY > (HV) AND MY < (HV + 5) THEN CALL MOVEWINDOW(HX, HV)

 
 
  h = HX
  v = HV
  hsi = 250: vsi = 150
 
 
 
  LINE (h, v)-(h + hsi, v + vsi), 7, B
LINE (h - 2, v - 2)-(h + hsi + 2, v + vsi + 2), 7, B

  LINE (h, v)-(h + 5, v + 5), blkcol, BF

   X = h + 30
   y = v + 1
   SIZE = 5
   C = 7

   CALL CHARACTER(X, y, "E", C, SIZE)
   CALL CHARACTER(X + 10, y, "R", C, SIZE)
   CALL CHARACTER(X + 20, y, "T", C, SIZE)
   CALL CHARACTER(X + 30, y, "Y", C, SIZE)
   CALL CHARACTER(X + 40, y, "U", C, SIZE)
   CALL CHARACTER(X + 50, y, "I", C, SIZE)
   CALL CHARACTER(X + 60, y, "O", C, SIZE)
   CALL CHARACTER(X + 70, y, "P", C, SIZE)
   CALL CHARACTER(X - 10, y + 20, "A", C, SIZE)
   CALL CHARACTER(X, y + 20, "S", C, SIZE)
   CALL CHARACTER(X + 10, y + 20, "D", C, SIZE)
   CALL CHARACTER(X + 20, y + 20, "F", C, SIZE)
   CALL CHARACTER(X + 30, y + 20, "G", C, SIZE)
   CALL CHARACTER(X + 40, y + 20, "H", C, SIZE)
   CALL CHARACTER(X + 50, y + 20, "J", C, SIZE)
   CALL CHARACTER(X + 60, y + 20, "K", C, SIZE)
   CALL CHARACTER(X + 70, y + 20, "L", C, SIZE)
   CALL CHARACTER(X + 80, y + 20, ";", C, SIZE)
   CALL CHARACTER(X, y + 40, "Z", C, SIZE)
   CALL CHARACTER(X + 10, y + 40, "X", C, SIZE)
   CALL CHARACTER(X + 20, y + 40, "C", C, SIZE)
   CALL CHARACTER(X + 30, y + 40, "V", C, SIZE)
   CALL CHARACTER(X + 40, y + 40, "B", C, SIZE)
   CALL CHARACTER(X + 50, y + 40, "N", C, SIZE)
   CALL CHARACTER(X + 60, y + 40, "M", C, SIZE)
   CALL CHARACTER(X + 70, y + 40, ",", C, SIZE)
   CALL CHARACTER(X + 80, y + 40, ".", C, SIZE)









































   MX = MOUSEXPOS: MY = MOUSEYPOS



END SUB

SUB intro

REM
REM  graphical intro to game
REM   nintendo 8-bit style graphics










END SUB

SUB modemsettings

REM self explanatory
REM   change the baud parity port ect
REM





END SUB

'DEFINT A-Z
SUB MOUSE (which)
'0 = Mouse Init
'1 = Mouse Driver
'2 = Mouse Put
'3 = Mouse Status
'4 = Mouse Hide
'5 = Mouse Show
IF which = 0 THEN
  mouser$ = SPACE$(57)
  FOR i% = 1 TO 57
    READ a$
    h$ = CHR$(VAL("&H" + a$))
    MID$(mouser$, i%, 1) = h$
  NEXT i%
  AX% = 0
  bx% = 0
  cx% = 0
  dx% = 0
  MOUSE 1
  MouseInit% = AX%
  MOUSE 5
END IF
IF which = 1 THEN
  DEF SEG = VARSEG(mouser$)
  mouser% = SADD(mouser$)
  CALL Absolute(AX%, bx%, cx%, dx%, mouser%)
END IF
IF which = 2 THEN
  AX% = 4
  cx% = X%
  dx% = y%
  bx% = 0
  MOUSE 1
END IF
IF which = 3 THEN
  AX% = 3
  MOUSE 1
  MOUSELEFTBUTTON = ((bx% AND 1) <> 0)
  MouseRightButton = ((bx% AND 2) <> 0)
  MOUSEXPOS = cx%
  MOUSEYPOS = dx%
END IF
IF which = 4 THEN
 AX% = 2
 bx% = 0
 cx% = 0
 dx% = 0
 MOUSE 1
END IF
IF which = 5 THEN
  AX% = 1
  bx% = 0
  cx% = 0
  dx% = 0
  MOUSE 1
END IF

MX = MOUSEXPOS
MY = MOUSEYPOS


END SUB

SUB mousejoy
LINE (jx, jy)-(jx + 5, jy + 5), 2, B


IF jx <> (jx1) OR jy <> (jy1) THEN LINE (jx1, jy1)-(jx1 + 5, jy1 + 5), 0, B: jx1 = jx: jy1 = jy



END SUB

SUB MOVEWINDOW (h, v)

CALL CLICKNOISE

DO
IF mspresent = 1 THEN CALL MOUSE(3)


CALL CUBE(MX, MY)




LOOP UNTIL MOUSELEFTBUTTON = 0


h = MOUSEXPOS
v = MOUSEYPOS
 CLS
END SUB

SUB PLACE (CUC)
LINE (X - 8, y - 1)-(X - 8 + 5, y - 1), CUC, BF
END SUB

SUB PROCTEXT (text$)


 IF text$ <> "" THEN

 text$ = UCASE$(text$)

 'TEXT$ = TEXT$ + " "

 word$ = ""
 l = LEN(text$)
 X = 1
 DO

 T$ = MID$(text$, X, 1)

 IF T$ <> " " AND T$ <> CHR$(13) THEN
   word$ = word$ + T$

 END IF

 X = X + 1

 LOOP UNTIL T$ = CHR$(34) OR T$ = " " OR T$ = CHR$(13) OR X >= (l)


  SUFFIX$ = ""


  T$ = MID$(text$, X, 1)
  IF T$ = CHR$(32) THEN X = X + 1

  DO

  T$ = MID$(text$, X, 1)
  IF T$ <> CHR$(34) THEN SUFFIX$ = SUFFIX$ + T$
  X = X + 1
  LOOP UNTIL X >= (l)
  LOCATE 1, 45: PRINT SUFFIX$; "   "




 SELECT CASE (word$)
 CASE IS = "TI994A"
 RUN root$ + "TI994A.BAS"


 CASE IS = "CAD"
 CLOSE #1
 OPEN root$ + "CADOBJ.DAT" FOR OUTPUT AS #1
 PRINT "BUILDING CAD DATA"

 PRINT #1, swth / 2
 PRINT #1, shht / 2
 PRINT #1, CHR$(34) + SUFFIX$ + CHR$(34)
 CLOSE #1
 CHAIN root$ + "QBCAD.BAS"


 CASE IS = "EXIT"
  CLS
  PRINT " REBOOT WILL TAKE YOU TO CoCoROM"
  PRINT "QBASIC WILL PUT YOU IN THE QB EDITOR"
  INPUT " EXIT TO DOS OR MS WINDOWS "; choice$
 
   choice$ = UCASE$(choice$)
 
   SELECT CASE (choice$)

   CASE IS = "DOS"
    SYSTEM

    CASE IS = "REBOOT"
    CLS
    PRINT "GOING INTO COCO ROM"
    PRINT "PLEASE WAIT..."
  
    RUN "COCOROM.BAS"

    CASE IS = "QBASIC"
    END


   END SELECT

 CASE IS = "SAY"
 CALL SPEAKER(SUFFIX$)


 CASE IS = "PROMPTON"
 showtrail = 1
 CASE IS = "PROMPTOFF"
 showtrail = 0
  CLS


 CASE IS = "DRAW"
 DRAW SUFFIX$

 CASE IS = "HEBREW"
  hebrewkeyboard = 1
  youread$ = "hebrew keypad on"
 CASE IS = "HEBREWOFF"
  hebrewkeyboard = 0
  CLS
  youread$ = "hebrew keypad closed..."

 CASE IS = "REBOOT"
 CLS
 PRINT " REBOOT ROUTINE"
 PRINT " PLEASE WAIT..."

 RUN "COCOROM.BAS"


 CASE IS = "SCREEN"
  SCREEN VAL(SUFFIX$)
  youread$ = "changed to screen " + SUFFIX$


 CASE IS = "PRINT", "?"
  youread$ = SUFFIX$


 CASE IS = "CLS"
 CLS
 youread$ = "clear screen "

 CASE IS = "COPYOS", "INSTALL"

 CALL COPYOS
  youread$ = " copy the opperating system "

 CASE IS = "SCREENSAVER"
  RUN "SCREENS.BAS"
    youread$ = "exiting to screen saver"

 CASE IS = "VGA"
 'CALL VGA

 CASE IS = "REMOTE"
  CALL REMOTE
   youread$ = "going into remote terminal"

 CASE IS = "LIST"
  CALL FILELIST(SUFFIX$)
 CASE IS = "RS232", "MODEM"
   CALL RS232


 CASE IS = "LPRINT"
 LPRINT SUFFIX$


 CASE IS = "CLOCK"
 CLS
 PRINT " getting clock ...."
 PRINT "       please wait"
 CALL diskgr
 RUN "clock1.bas"



 CASE IS = "BEEP"
 BEEP
 CASE IS = "FILES", "DIR"
 CLS
 FILES
 SLEEP
 CLS
 CASE IS = "DISKCOPY"
 RUN "DISKCOPY.BAS"

 CASE IS = "PLAY"
  PLAY SUFFIX$

 CASE IS = "DRAW"
  DRAW SUFFIX$
 CASE IS = "SHELL"
  SHELL SUFFIX$
  PRINT " ### DONE  ### "

  SLEEP
  CLS
  PRINT "PLEASE WAIT..."

  CASE IS = "OS9"
  
  RUN root$ + "QBos9.BAS"

 END SELECT


 youread$ = youread$ + CR$ + "OK"


 text$ = ""
 LOCATE 10, 1: PRINT STRING$(20, " ")

END IF
END SUB

SUB PRSCREEN
REM
REM SEND SCREEN TO PRINTER
REM
    DIM a%(2)
    DEF SEG = VARSEG(a%(0))
    FOR i% = 0 TO 2
       READ d%
       POKE VARPTR(a%(0)) + i%, d%
    NEXT i%
    CALL Absolute(VARPTR(a%(0)))
    DEF SEG

END SUB

SUB REMOTE
CLOSE
CLS


INPUT "port 1 , 2 "; P
INPUT "basic on 1 or off 2"; B

portname$ = "COM" + STR$(P) + ":19200,8,N,1"
PRINT portname$
SLEEP
CLS

IF P = 1 THEN OPEN "com1:19200,n,8,1" FOR RANDOM AS #4
IF P = 2 THEN OPEN "com2:19200,n,8,1" FOR RANDOM AS #4
IF P > 0 THEN AKB1 = 1' SET AUX KEYBOARD 1 ON


DO
LOCATE 1, 1
PRINT " ### Remote ### up arrow to exit "; OPP$
PRINT
PRINT text$; OPP$



CALL UPDPROMPT




LOOP UNTIL ke$ = CHR$(0) + CHR$(72)

'CLOSE #4
END SUB

SUB RS232

CLS



DO
LOCATE 1, 1

PRINT " rs232 program pak "; OPP$
PRINT "<1>      - change settings"
PRINT "<2>      - enter terminal mode"
PRINT "<3>      - enter teletype mode "
PRINT "<4>      - remote"
PRINT "<F1>     - go back to basic"




CALL UPDPROMPT



    SELECT CASE (ke$)
      CASE IS = "1"
      CALL modemsettings
    
      CASE IS = "4"
      CALL REMOTE



    END SELECT



LOOP UNTIL ke$ = CHR$(0) + CHR$(59)
CLS
END SUB

SUB scroll

REM text scrolling takes place here

l = LEN(MESS$)

IF ctx$ <> (TIME$) THEN
   ctx$ = TIME$: MSPLACE = MSPLACE + 1: IF MSPLACE >= (l) THEN MSPLACE = 1
END IF
T = 0
C$ = "": DT$ = ""
G = MSPLACE
VV = 20
HH = 1
DO
T = T + 1
G = G + 1
HH = HH + 1
IF G > (l) THEN G = 1
C$ = MID$(MESS$, G, 1)
CALL HEBLOC(HH, VV, C$)
DT$ = DT$ + C$


LOOP UNTIL T = 70

LOCATE 2, 2: PRINT DT$
END SUB

SUB SHOWCUBE (X, y, C)



LINE (X, y)-(X + 50, y + 50), C, B



END SUB

' version 1.2
SUB SPEAK (phr$)
 END SUB

SUB SPEAKER (pa$)
'   +-----------------------------------------------------------------------+
'   ¦A1 Ale  ¦D1 Dig  ¦G1 Go   ¦J1 Jug  ¦O1 Over ¦R1 Real ¦U1 Usurp¦Y1 Yard ¦
'   ¦A2 Add  ¦D2 biD  ¦G2 Gem  +--------¦O2 Odd  ¦R2 evER ¦U2 Under¦Y2 monEY¦
'   ¦A3 Above¦D3 buDGE¦G3 baG  ¦K1 Key  ¦O3 nOt  ¦R3 veRy ¦U3 rUde ¦Y3 bAY  ¦
'   ¦A4 AUto +--------¦G4 siNG ¦K2 maKE ¦O4 shORt+--------¦U4 mUte ¦Y4 bOY  ¦
'  ¦A5 tAke ¦E1 Even +--------¦K3 sKate¦O5 bOOt ¦S1 Seem ¦U5 mUd  +--------¦
'   ¦A6 mAt  ¦E2 Ever ¦H1 Hut  +--------¦O6 bOAt ¦S2 miSS ¦U6 pUll ¦Z1 Zone ¦
'   ¦A7 cAr  ¦E3 bEt  ¦H2 WHale¦L1 Like ¦O7 wOOd ¦S3 SHy  ¦U7 hOUse¦Z2 buZZ ¦
'   ¦A8 sAW  ¦E4 wEll +--------¦L2 bowL ¦O8 lOUd ¦S4 waSH ¦U8 awfUL¦Z3 aZure¦
'   +--------¦E5 bEAt ¦I1 Irate¦L3 siLLy+--------+--------+--------+--------¦
'   ¦B1 Bad  ¦E6 hEEl ¦I2 Inane+--------¦P1 Pie  ¦T1 Tie  ¦V1 Very ¦SP short¦
'   ¦B2 daB  ¦E7 vERy ¦I3 tIp  ¦M1 May  ¦P2 naP  ¦T2 laTE ¦V2 aliVE¦   pause¦
'   +--------¦E8 nERd ¦I4 hId  ¦M2 huM  ¦P3 sPin ¦T3 THis +--------+--------¦
'   ¦C1 Cent +--------¦I5 sIte +--------+--------¦T4 baTHE¦W1 Witch¦LP long ¦
'   ¦C2 Case ¦F1 Fat  ¦I6 hIde ¦N1 Nice ¦        ¦T5 THing¦W2 WHich¦   pause¦
'   ¦C3 CHin ¦F2 halF ¦I7 thINK¦N2 saNE ¦Q1 QUeen¦T6 wiTH +--------+--------¦
'   ¦        ¦        ¦I8 thING¦        ¦        ¦        ¦X1 aXis ¦^Z exit ¦
'   +-----------------------------------------------------------------------+
 rword$ = ""
 phr$ = pa$
 phr$ = phr$ + " "
 phr$ = LCASE$(phr$)
 reader = 0: wpb = 1: wpl = 1
'Get phrase size and check all letters
   lsize = LEN(phr$)

   FOR lc = 1 TO lsize
   letr$ = MID$(phr$, lc, 1)
   IF letr$ = CHR$(32) OR lc = (lsize) THEN word$ = MID$(phr$, wpb, wpl): reader = 1
    rword$ = ""
    FOR chc = 1 TO LEN(word$): ch$ = MID$(word$, chc, 1): IF ch$ <> CHR$(32) THEN rword$ = rword$ + ch$
    NEXT chc
 
      wpl = wpl + 1 ' needed to prevent contiuous loop
' show Reader status in
'   IF reader = 0 THEN PRINT "Idle"

'   IF reader = 1 THEN PRINT "Reading"
WHILE reader = 1
    IF wpl > 2 THEN lltr$ = MID$(rword$, wpl - 2, 1)
   IF wpl > 2 THEN nlltr$ = MID$(rword$, wpl - 2, 1):

   word$ = word$ + " ": word$ = " " + word$
   ' Show the word being read in cell "e:6"

   FOR wc = 2 TO wpl + 1 ' Read entire word compinsating for character placement
   IF wpl > 2 THEN pltr$ = MID$(word$, wc - 1, 1)
   ltr$ = MID$(word$, wc, 1): nltr$ = MID$(word$, wc + 1, 1)
   ltva = VAL(ltr$)
' sgl stands for single letter
' the below 'if then' statement test to see if the word is a single letter
' sgl returns a 1 if true 0 if false
   pltv = VAL(pltr$): nltv = VAL(nltr$) ' get the number values of the character if present
   IF pltr$ = CHR$(32) AND nltr$ = CHR$(32) THEN sgl = 1 ELSE sgl = 0
   IF wpl - wc >= 3 THEN L3tr$ = MID$(word$, wc + 2, 1)
' show l3tr$ in cell ("b:3")


' below section of this macro accesses the speech fragments
' it is concerned with assembling speech for numbers
' and commonly used words under united states English western dilect
 
 
   lv = 0
  'check to see if word has long vowels "a,e,i,o,u"
   IF ltr$ = "a" OR ltr$ = "e" OR ltr$ = "i" OR ltr$ = "o" OR ltr$ = "u" OR ltr$ = "y" THEN cfv = 1: vowels = vowels + 1
    IF cfv = 1 THEN
  
   IF nltr$ = "a" OR nltr$ = "e" OR nltr$ = "i" OR nltr$ = "o" OR nltr$ = "u" THEN lv = 1: ntv = 1: moc = 1
   IF lltr$ = "a" OR lltr$ = "e" OR lltr$ = "i" OR lltr$ = "o" OR lltr$ = "u" OR lltr$ = "y" THEN lv = 1
   IF wc < wpl - 3 THEN IF ltr$ <> "o" AND nlltr$ = "a" OR nlltr$ = "e" OR nlltr$ = "i" OR nlltr$ = "o" OR nlltr$ = "u" THEN lv = 1
 
   'return check for vowel to zero hence cfv=0
   'cfv =1 if true 0 if false
   END IF

   cfv = 0
   IF rsword = 1 THEN ltr$ = rword$

   '         [[[[[[[[   ]]]]]]]]
   ' [[[[[[[[  standard letters ]]]]]]]
   '         [[[[[[[[   ]]]]]]]]

' PRINT ltr$ 'for testing purposes only
IF ltr$ = "y" AND sgl = 1 THEN say$ = "w1 i1": ltr$ = ""
IF ltr$ = "y" AND nltr$ = CHR$(32) THEN say$ = "e5": ltr$ = ""
'scope of "a"

   IF ltr$ = "a" AND sgl = 1 THEN say$ = "a1": ltr$ = ""

    ' a cont aeiou section
' Scope of "b"
   IF ltr$ = "b" AND sgl = 1 THEN say$ = "b1 e1"
    IF ltr$ = "b" AND sgl = 0 AND pltr$ = CHR$(32) THEN say$ = "b1"
    IF ltr$ = "b" AND sgl = 0 AND nltr$ = CHR$(32) THEN say$ = "b2"
  
    'scope of "c"
IF ltr$ = "c" AND sgl = 1 THEN say$ = "c1 e5": ltr$ = ""

IF ltr$ = "c" AND nltr$ = "k" THEN moc = 1: say$ = "c2": ltr$ = ""
IF ltr$ = "c" AND pltr$ = "s" THEN say$ = "c2": ltr$ = ""
IF ltr$ = "c" AND lv = 1 THEN say$ = "c1": ltr$ = ""
IF ltr$ = "c" AND rword$ = "nice" THEN say$ = "c1": ltr$ = ""
 IF ltr$ = "c" AND rword$ = "space" THEN say$ = "c1": ltr$ = ""
  IF ltr$ = "c" AND rword$ = "come" THEN say$ = "c2": ltr$ = ""
   IF ltr$ = "c" AND sgl = 1 THEN say$ = "c": ltr$ = ""
    IF ltr$ = "c" AND nltr$ = "h" THEN say$ = "ch": ltr$ = "": moc = 1' ch as in church
    
      IF ltr$ = "c" AND rword$ = "cell" THEN say$ = "c1": ltr$ = ""
       IF ltr$ = "c" AND ntv = 1 THEN say$ = "c1": ltr$ = ""
        IF ltr$ = "c" AND sgl = 0 AND ntv = 0 THEN say$ = "c1": ltr$ = ""
         IF ltr$ = "c" AND ntv = 1 THEN say$ = "c2": ltr$ = ""
          IF ltr$ = "c" AND sgl = 0 AND L3tr$ <> "t" THEN say$ = "c1": ltr$ = ""
           IF ltr$ = "c" AND nltr$ = "c" THEN moc = 1: say$ = "c2"


           
' scope of "d"
   IF ltr$ = "d" AND sgl = 1 THEN say$ = "d1 e1"
     IF ltr$ = "d" AND sgl = 0 THEN say$ = "d1"
' scope of "e"
   IF ltr$ = "e" AND sgl = 1 THEN say$ = "e1": ltr$ = ""
     ' e phonix at aeiou section
' scope of "f"
   IF ltr$ = "f" AND sgl = 1 THEN say$ = "e3 f1"
      IF ltr$ = "f" AND sgl = 0 THEN say$ = "f1"
' scope of "g"
  'PRINT ltr$
 IF ltr$ = "g" AND rword$ = "sign" THEN say$ = "": ltr$ = ""
  IF ltr$ = "g" AND pltr$ = "e" THEN say$ = "g1": ltr$ = ""
   IF ltr$ = "g" AND nltr$ = "r" THEN say$ = "g1": ltr$ = ""
    IF ltr$ = "g" AND pltr$ <> CHR$(32) AND nltr$ <> CHR$(32) THEN say$ = "g2": ltr$ = ""
     IF ltr$ = "g" AND sgl = 1 THEN say$ = "g2 e1"
      IF ltr$ = "g" AND sgl = 0 THEN say$ = "g1"
' scope of "h"
   IF ltr$ = "h" AND sgl = 1 THEN say$ = "a1 c3"
      IF ltr$ = "h" AND sgl = 0 THEN say$ = "h1" 'h as in horse
' scope of "i"
   IF ltr$ = "i" AND sgl = 1 THEN say$ = "i1": ltr$ = ""
' scope of "j"
   IF ltr$ = "j" AND sgl = 1 THEN say$ = "g2 a1"
      IF ltr$ = "j" AND sgl = 0 THEN say$ = "g2"
' scope of "k"
   IF ltr$ = "k" AND sgl = 1 THEN say$ = "c2 a1"
      IF ltr$ = "k" AND sgl = 0 THEN say$ = "c2"
' scope of "l"
   IF ltr$ = "l" AND sgl = 1 THEN say$ = "e2 l1"
      IF ltr$ = "l" AND sgl = 0 THEN say$ = "l2": REM  If nltr$ = "l" Then moc = 2
      IF ltr$ = "l" AND nltr$ <> CHR$(32) AND sgl = 0 THEN say$ = "l2": REM  If nltr$ = "l" Then moc = 2
   
    
    
      IF ltr$ = "l" AND nltr$ = "l" THEN moc = 1: say$ = "l1": REM  If nltr$ = "l" Then moc = 2


' scope of "m"
   IF ltr$ = "m" AND sgl = 1 THEN say$ = "i2 m2"
      IF ltr$ = "m" AND agl = 0 THEN say$ = "m2" ' m as in mouse
' scope of "n"
   IF ltr$ = "n" AND sgl = 1 THEN say$ = "i2 n1"
      IF ltr$ = "n" AND sgl = 0 THEN say$ = "n1"
' scope of "o"
   IF ltr$ = "o" AND sgl = 1 THEN say$ = "o1"
      ' o's phonixe cont at aeiou section
' scope of "p"
   IF ltr$ = "p" AND sgl = 1 THEN say$ = "p1 e1"
  IF ltr$ = "p" AND pltr$ = CHR$(32) AND nltr$ <> CHR$(32) THEN say$ = "p1": ltr$ = ""
  IF ltr$ = "p" AND pltr$ <> CHR$(32) AND nltr$ = CHR$(32) THEN say$ = "p2": ltr$ = ""

  IF ltr$ = "p" AND sgl = 0 THEN say$ = "p3": ltr$ = ""

' scope of "q"
   IF ltr$ = "q" AND sgl = 1 THEN say$ = "q"
      IF ltr$ = "q" AND sgl = 0 THEN say$ = "c2 a1"
' scope of "r"
   IF ltr$ = "r" AND sgl = 1 THEN say$ = "a4 r2"
      IF ltr$ = "r" AND sgl = 0 THEN say$ = "r2"
       IF ltr$ = "r" AND nltr$ = "r" THEN moc = 1
' scope of "s"

   IF ltr$ = "s" AND sgl = 1 THEN say$ = "s"
     IF ltr$ = "s" AND nltr$ = "h" THEN say$ = "sh": moc = 1: ltr$ = "" ' sh as in shack
      IF ltr$ = "s" AND sgl = 0 THEN say$ = "c1"

' scope of "t"
   IF ltr$ = "t" AND sgl = 1 THEN say$ = "t1"
    ' "th" as in the
     IF ltr$ = "t" AND nltr$ = "h" AND pltr$ = "" THEN moc = 1: say$ = "t3": ltr$ = ""' rem th
     IF ltr$ = "t" AND nltr$ = "h" THEN moc = 1: say$ = "t4": ltr$ = "" ' rem th
   
    
      IF ltr$ = "t" AND sgl = 0 THEN say$ = "t1"
       IF ltr$ = "t" AND nltr$ = "t" THEN moc = 1: ltr$ = ""

' scope of "u"
   IF ltr$ = "u" AND sgl = 1 THEN say$ = "y1 o5": ltr$ = ""
' scope of "v"
   IF ltr$ = "v" AND sgl = 1 THEN say$ = "v2 e5"
      IF ltr$ = "v" AND sgl = 0 THEN say$ = "v2"
' scope of "w"
   IF ltr$ = "w" AND sgl = 1 THEN say$ = "d2 u2 b2 l2 u1 o5"
      IF ltr$ = "w" AND sgl = 0 THEN say$ = "w1"
' scope of "x"
   IF ltr$ = "x" THEN say$ = "e2 c2 x1"
' scope of "y"

IF ltr$ = "y" AND pltr$ = "n" THEN say$ = "E5": ltr$ = ""
IF ltr$ = "y" AND sgl = 0 THEN say$ = "y1"
IF ltr$ = "y" AND rword$ = "by" THEN say$ = "i1": ltr$ = ""
 IF ltr$ = "y" AND nltr$ = CHR$(32) THEN say$ = "e5": ltr$ = ""
  IF ltr$ = "y" AND nltr$ = "e" THEN say$ = "y1": ltr$ = ""
 
   IF ltr$ = "y" AND rword$ = "you" THEN say$ = "y1 o5": ltr$ = "": wc = lsize: word$ = ""
  
    IF ltr$ = "y" AND nltr$ = "o" THEN say$ = "y1": ltr$ = ""
    
      IF ltr$ = "y" AND rword$ = "byte" THEN say$ = "i1": ltr$ = ""
       IF ltr$ = "y" AND sgl = 0 AND lv = 0 THEN say$ = "y1": ltr$ = ""
        IF ltr$ = "y" AND sgl = 1 THEN say$ = "w1 i1"
         IF ltr$ = "y" AND pltr$ <> CHR$(32) THEN say$ = "e5"

' scope of "z"
   IF ltr$ = "z" AND sgl = 1 THEN say$ = "z"
      IF ltr$ = "z" AND sgl = 0 THEN say$ = "s2"
' end of standard letters

' special phonix section 'a,e,i,o,u'
' vowel "a"
  IF ltr$ = "a" AND rword$ = "gates" THEN say$ = "a1": ltr$ = ""
   IF ltr$ = "a" AND rword$ = "have" THEN say$ = "a2": ltr$ = ""
    IF ltr$ = "a" AND rword$ = "start" THEN say$ = "R": ltr$ = ""
    
      IF ltr$ = "a" AND rword$ = "happy" THEN say$ = "a2": ltr$ = ""
       IF ltr$ = "a" AND lv = 1 AND nltr$ <> "r" THEN say$ = "a1": ltr$ = ""
        IF ltr$ = "a" AND nltr$ = "r" AND lv = 1 THEN say$ = "r": ltr$ = "": moc = 1
         IF ltr$ = "a" AND lv = 0 THEN say$ = "a2": ltr$ = ""
          IF ltr$ = "a" AND lltr$ = "e" THEN say$ = "a1": ltr$ = ""
           IF ltr$ = "a" AND sgl = 0 AND lltr$ <> "e" THEN say$ = "a1": ltr$ = ""
            IF ltr$ = "a" AND lv = 0 THEN say$ = "a2": ltr$ = ""



' vowel "e
 '  PRINT "lv "; lv

IF ltr$ = "e" AND pltr$ <> CHR$(32) AND nltr$ <> CHR$(32) AND sgl = 0 AND lv = 0 THEN say$ = "e2": ltr$ = ""
IF ltr$ = "e" AND rword$ = "me" THEN say$ = "e1": ltr$ = ""
IF ltr$ = "e" AND rword$ = "hello" THEN say$ = "e4": ltr$ = ""
IF ltr$ = "e" AND rword$ = "the" THEN say$ = "e": ltr$ = ""
 IF ltr$ = "e" AND rword$ = "zero" THEN say$ = "e": ltr$ = ""
  IF ltr$ = "e" AND rword$ = "error" THEN say$ = "a1": ltr$ = ""
   IF ltr$ = "e" AND rword$ = "welcome" AND pltr$ = "w" THEN say$ = "e1": ltr$ = ""
    IF ltr$ = "e" AND rword$ = "byte" THEN say$ = "": ltr$ = ""
     IF ltr$ = "e" AND rword$ = "here" AND pltr$ <> "r" THEN say$ = "e"
      IF ltr$ = "e" AND rword$ = "come" THEN say$ = "": ltr$ = ""
       IF ltr$ = "e" AND rword$ = "there" THEN say$ = "eee": ltr$ = ""
        IF ltr$ = "e" AND rword$ = "the" THEN say$ = "e": ltr$ = "":    ' force long e for "the"
         IF ltr$ = "e" AND ntv = 1 THEN say$ = "e1": ltr$ = ""
         IF ltr$ = "e" AND nltr$ = CHR$(32) AND lv = 1 THEN say$ = "": ltr$ = ""
          IF ltr$ = "e" AND nltr$ = CHR$(32) THEN say$ = "e1": ltr$ = ""
           IF ltr$ = "e" AND nltr$ = "r" THEN say$ = "": ltr$ = ""
            IF ltr$ = "e" AND lltr$ = "y" THEN say$ = "e1": ltr$ = ""
             IF ltr$ = "e" AND ntv = 0 AND nltr$ <> CHR$(32) THEN say$ = "e1": ltr$ = ""
              IF ltr$ = "e" AND nltr$ = "n" THEN say$ = "i2": ltr$ = ""
             
               IF ltr$ = "e" AND nltr$ = "r" THEN say$ = "e1": ltr$ = ""
                IF ltr$ = "e" AND wc < wpl AND pltr$ <> "p" AND lltr$ <> "o" AND lv = 1 THEN say$ = "e":  ltr$ = ""
                 IF ltr$ = "e" AND lv = 1 AND ntv = 1 AND wc < wpl AND pltr$ <> "P" AND lltr$ <> "o" THEN say$ = "e": ltr$ = ""
                  IF ltr$ = "e" AND lv = 1 AND sgl = 0 AND pltr$ <> "p" AND wc < wpl THEN say$ = "e1": ltr$ = ""
                   IF ltr$ = "e" AND lv = 0 THEN say$ = "e1": ltr$ = ""
                    IF ltr$ = "e" AND lv = 1 THEN say$ = "e1": ltr$ = ""
                   
                       'when all else fails long "e"




  ' vowel "i"
 IF ltr$ = "i" AND rword$ = "sign" THEN say$ = "i1": ltr$ = ""
  IF ltr$ = "i" AND rword$ = "hi" THEN say$ = "i1": ltr$ = "" ' force long i as in "hi"
   IF ltr$ = "i" AND ntv = 0 AND lv = 0 THEN say$ = "i2": ltr$ = ""
      IF ltr$ = "i" AND lv = 1 THEN say$ = "i1": ltr$ = ""

' vowel "o"
 IF ltr$ = "o" AND nltr$ = "t" THEN say$ = "o3": ltr$ = ""
 IF ltr$ = "o" AND rword$ = "do" THEN say$ = "o5 ": ltr$ = ""
  IF ltr$ = "o" AND nltr$ = "u" AND lltr$ <> "d" THEN say$ = "o5 ": moc = 1: ltr$ = ""
   IF ltr$ = "o" AND nltr$ = "u" THEN say$ = "a2": ltr$ = ""
    ' "OU" AS IN FOUND OR SOUND = FORCES AA.WAV
     IF ltr$ = "o" AND pltr$ = "c" AND lv = 0 THEN say$ = "aaa": ltr$ = ""
      IF ltr$ = "o" AND nltr$ = "m" THEN say$ = "u2 ": ltr$ = ""
       IF ltr$ = "o" AND rword$ = "come" THEN say$ = "o1"
        IF ltr$ = "o" AND rword$ = "tron" THEN say$ = "aaa": ltr$ = ""
         IF ltr$ = "o" AND nltr$ = "w" THEN say$ = "o8": ltr$ = ""
          IF ltr$ = "o" AND plltr$ = "z" THEN say$ = "o1": ltr$ = ""
           IF ltr$ = "o" AND nltr$ = "o" THEN say$ = "o5 ": ltr$ = ""
            IF ltr$ = "o" AND pltr$ = "t" THEN say$ = "o5 ": ltr$ = ""
             IF ltr$ = "o" AND nltr$ = CHR$(32) AND lv = 1 THEN say$ = "o1": ltr$ = ""
              ' o as in 'on'
               IF ltr$ = "o" AND pltr$ = CHR$(32) THEN say$ = "aaa": ltr$ = ""
                IF ltr$ = "o" AND lv = 1 AND nltr$ <> "o" AND ntv = 1 THEN say$ = "o1": ltr$ = ""
                 IF ltr$ = "o" THEN say$ = "o1"
' vowel "u"
  IF ltr$ = "u" AND rword$ = "yuck" THEN say$ = "u2": ltr$ = ""
  IF ltr$ = "u" AND lv = 0 THEN say$ = "u2 ": ltr$ = ""
  IF ltr$ = "u" AND rword$ = "stupid" THEN say$ = "o5 ": ltr$ = ""
  IF ltr$ = "u" AND rword$ = "user" THEN say$ = "u": ltr$ = ""
 
     IF ltr$ = "u" AND lv = 1 THEN say$ = "o5 ": 'leave open for next test of "u"
 
 
 
 
 
 
'   end of vowel section
 
     IF moc > 0 THEN wc = wc + moc: moc = 0
     IF wc > wpl THEN word$ = ""
   lv = 0
' end of special vowel "a,e,i,o,u" section

  IF wc >= wpl THEN reader = 0: ltr$ = "": rword$ = ""
  IF wpl = 1 THEN word$ = "": rword$ = "": ltr$ = ""

  ltr$ = ""
   text$ = text$ + say$ + " "
 '  PRINT say$
  say$ = ""
NEXT wc

 nlltr$ = "": wpl = 1: wpb = lc: ntv = 0: vowels = 0: lv = 0: L3tr$ = ""
 WEND
  NEXT lc


CHDIR "c:\pcspeak"


  OPEN "textf.txt" FOR OUTPUT AS #1
  PRINT #1, text$
  CLOSE #1
  cc = 0

SHELL "read.bat"
 
 
 


END SUB

SUB tablet (X, y)

LINE (X - 2, y - 2)-(X + 170, y + 80), 7, B
  LINE (X, y)-(X + 5, y + 5), blkcol, BF


  IF BU = -1 AND MX > (X) AND MX < (X + 5) AND MY > (y) AND MY < (y + 5) THEN CALL MOVEWINDOW(X, y)







END SUB

SUB UDCUR

IF X <> (X1) OR y <> (Y1) THEN

CALL BOX(X1, Y1, BC)
X1 = X: Y1 = y

END IF


CURTPX = CURTPX + 1

 CALL BOX(X, y, CURTPX)

IF CURTPX >= 16 THEN CURTPX = 0

END SUB

SUB UPDPROMPT
  REM readkey board
'
   ke$ = INKEY$
   l = LEN(text$)
   IF ke$ = CHR$(8) THEN ke$ = "": IF l >= 1 THEN text$ = LEFT$(text$, l - 1)
  
   IF ke$ = CHR$(0) + CHR$(67) THEN scsvr = 0
   IF ke$ <> "" THEN
      ctxvar = 0
      IF AKB1 = 1 THEN
     
     
     
     
        IF ke$ = CHR$(0) + CHR$(77) THEN
            PRINT #4, CHR$(13)

         ke$ = ""
        END IF
        PRINT #4, ke$
      END IF

   END IF

   a$ = ""

   IF AKB1 = 1 THEN

    IF LOC(4) > 0 THEN
    LINE INPUT #4, a$
     IF a$ <> "" THEN ke$ = a$: ctxvar = 0
     IF a$ = "~" THEN ke$ = CHR$(13)

    END IF

   END IF



  IF TIME$ <> (lt$) THEN

  oppv = oppv + 1

  IF oppv = 1 THEN OPP$ = CHR$(219)
  IF oppv > 1 THEN oppv = 0
  IF oppv = 0 THEN OPP$ = " "

   lt$ = TIME$: ctxvar = ctxvar + 1

   REM we call the screen saver here

   IF ctxvar > 120 THEN
    IF scsvr = 1 THEN RUN "screens"
   END IF
  END IF

 IF ke$ <> "" THEN text$ = text$ + ke$



'
END SUB

SUB WORDLEARN (pa$, OUTPA$)



SELECT CASE (pa$)
  CASE IS = "KF"

   OUTPA$ = "EVERY"
 
  CASE IS = "KRY"
   OUTPA$ = "ROCKET"
  CASE IS = ""
   OUTPA$ = ""

END SELECT




END SUB

