| Routines

31968: Make a teacher decide whether to give EINSTEIN lines for telling tales

Used by the routine at 62208.
Input
H | Teacher's character number (163-166)
31968 | LD A,H | L=0 (MR WACKER), 16 (MR ROCKITT), 32 (MR WITHIT), or 48 (MR CREAK)
31969 | SUB 163
31971 | ADD A,A
31972 | ADD A,A
31973 | ADD A,A
31974 | ADD A,A
31975 | LD L,A
The number in L determines how often the teacher will give lines to EINSTEIN for telling tales:
Teacher | Frequency
--- | ---
MR WACKER | Never
MR ROCKITT | 1 in 16
MR WITHIT | 1 in 8
MR CREAK | 3 in 16
31976 | CALL 24993 | A=random number
31979 | CP L | Set the carry flag if the teacher is going to give lines to EINSTEIN
31980 | LD L,255 | Return with L=255 if the teacher's not in the mood to give lines to EINSTEIN
31982 | RET NC
31983 | JR 31904 | Make the teacher give EINSTEIN lines for telling tales