8-Bit Software Online Conversion
:2.$.GessWri - Listing
10DEFFNS="GessWri"
20DIM card$(13)
30MODE7
40REM*SA. GessDat E00+0
50REM*SA. GessPtr E00+0
60REM*SA. GessUse E00+0
70REPEAT
80F1%=OPENUP"GessDat"
90F2%=OPENUP"GessPtr"
100F3%=OPENUP"GessUse"
110ONERROR CLOSE#F1%:CLOSE#F2%:CLOSE#F
3%:REPORT:PRINTERL:END
120REPEAT:*FX21
130CLS
140PRINT" Create data for Guess Who."
150PRINT" Program by, game adapted by
C.J.R."''
160PRINT" Number of entries=";EXT#F3%'
170PRINT" (E)nter a new record"
180PRINT" (T)est out"
190PRINT" (C)lose files"
200A$=GET$
210IF A$="T" MODE0:PROCtest:MODE7:A$="
"
220IF A$="E" PROCenter:A$=""
230UNTIL A$="C":CLOSE#F1%:CLOSE#F2%:CL
OSE#F3%
240UNTILFALSE
250DEFPROCenter:CLS
260PTR#F1%=EXT#F1%
270PTR#F2%=EXT#F2%
280PTR#F3%=EXT#F3%
290INPUTLINE" Name etc"'card$(1)
300INPUTLINE" Birthdate, place, death"
'card$(2)
310INPUTLINE" General info"'card$(3)
320FORL%=4TO13:PRINT" Clue "'STR$(L%-4
);".";
330INPUTLINEcard$(L%):NEXT
340REPEAT
350CLS
360PRINT" 1. Name etc"'card$(1)
370PRINT" 2. Birthdate, place, death"'
card$(2)
380PRINT" 3. General info"'card$(3)
390PRINT" Clues":FORL%=4TO13:IF L%>9 P
RINTCHR$(L%+55); ELSE PRINTSTR$(L%);
400PRINT". ";card$(L%):NEXT
410PRINT" Field to alter? Any other to
end":A$=GET$:F%=VAL A$:IF INSTR("ABCD",
A$) F%=ASC(A$)-55
420IF F%<>0 IF F%>3 PRINT" Field "'A$;
".";:INPUTLINEcard$(F%)
430IF F%<>0 IF F%<4 PRINT" Field "'A$:
INPUTLINE'card$(F%)
440UNTILF%=0
450BPUT#F3%,0
460BPUT#F2%,PTR#F1% MOD 256
470BPUT#F2%,PTR#F1% DIV 256
480FORL%=1TO13:PRINT#F1%,card$(L%):NEX
T
490ENDPROC
500DEFPROCtest
510FORL%=1TOEXT#F3%:CLS:PRINTSTR$(L%);
" of ";EXT#F3%
520P%=BGET#F2%+(BGET#F2%*256)
530PTR#F1%=P%
540FORI%=1TO13:Z%=PTR#F1%:INPUT#F1%,A$
:PRINTA$;TAB(40);
550PRINT"At &";STR$÷Z%;" Length-";STR$
(LENA$):NEXT
560A$=GET$:IFA$="J"INPUT"Go to? "L%
570NEXT
580ENDPROC