tvguts.4 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493
  1. <SETG FROBS
  2. '![<MAKE.QUESTIONS>
  3. <ASK.QUESTIONS>
  4. <GRADE.STUFF>
  5. <READ.MAIL>
  6. <BABBLE-SORT>
  7. <PSCORES>
  8. <PRINT.QSCORE>!]>
  9. <SETG FROB-NAMES
  10. '["
  11. Making Questions.
  12. "
  13. "
  14. Answering Questions.
  15. "
  16. "
  17. Grading/Reading Answers.
  18. "
  19. "
  20. Reading mail.
  21. "
  22. "
  23. Babbling.
  24. "
  25. "
  26. Printing scores.
  27. "
  28. "
  29. Status of questions
  30. "]>
  31. <SETG TUV <IUVECTOR 4 0>>
  32. <SETG TTUV <IUVECTOR 1 0>>
  33. <SETG TBUV <IUVECTOR 4 0>>
  34. <SETG FOOUV <IUVECTOR 4 0>>
  35. <GDECL (TUV TBUV FOOUV)
  36. <UVECTOR [4 FIX]>
  37. (TTUV)
  38. <UVECTOR FIX>>
  39. <SETG STATUS-VECTOR
  40. '[0
  41. "Grade"
  42. 1
  43. "Answer"
  44. 2
  45. "Babble"
  46. 3
  47. "Read mail"
  48. 4
  49. "Make"
  50. 5
  51. "Peek"
  52. 6
  53. "Start up"
  54. 7
  55. "Print score"
  56. 8
  57. "Command"
  58. 9
  59. "Update"
  60. 10
  61. "Status"
  62. 11
  63. "FLUSH"
  64. 12
  65. "ERROR"
  66. 13
  67. "SHOUT"]>
  68. <DEFINE DFUMP ("OPTIONAL" (FNAM "MADMAN;TV FOO"))
  69. #DECL ((FNAM) STRING)
  70. <DEBUG>
  71. <FUMP -1 ,TIME -1 .FNAM>>
  72. <GDECL (PG) FIX (LASTMAIL) WORD>
  73. <DEFINE FUMP (VERSION
  74. "OPTIONAL" (SAVER ,TIME) (MOD 0) (FNAM "MADMAN;TV FILE")
  75. "AUX" M PLAYERS TEMP)
  76. #DECL ((VERSION MOD) FIX (M) <OR FALSE LIST> (SAVER) APPLICABLE
  77. (PLAYERS) STRUCTURED (TEMP) FIX (FNAM) STRING)
  78. <COND (<=? <APPLY .SAVER "MADMAN;TRV SAVFIL"> "SAVED">)
  79. (<AND <DINIT> <>>)
  80. (<AND <=? <JNAME> "DEBUG"> <MEMBER <XUNAME> ,WINNERS>>
  81. <SETG TVASS <OPEN-DATA-FILE .FNAM <> 7 5>>
  82. "LOSING")
  83. (<SETG TVASS <OPEN-DATA-FILE .FNAM <> 7 5>>
  84. <COMREP>
  85. <PRINC "
  86. TRIVIA.">
  87. <PRIN1 .VERSION>
  88. <COND (<0? .MOD>) (<PRINC "."> <PRIN1 .MOD>)>
  89. <CRLF>
  90. <IPC-OFF>
  91. <IPC-ON <XUNAME> "TRIVIA">
  92. <INIT> ;"SET UP TTY'S"
  93. <SET IMLAC? <==? <MOD <11 ,INCHAN> 128> 2>>
  94. <SETG TVSPACE <AFIND 1>>
  95. <SETG TVSPACE1 <AFIND 1>>
  96. <SETG TVSPACE2 <AFIND 1>>
  97. <SETG LOSSSPACE <AFIND 1>>
  98. <SETG MOBYSPACE <AFIND 4>>
  99. <SETG LOSSTABLE <DATA-AREAD ,TVASS ,LUSERS ,LOSSSPACE>>
  100. <RESET ,INCHAN>
  101. <COND (<SET M <MEMBER <SETG PLAYER <XUNAME>> ,LOSSTABLE>>
  102. <SETG LUBLK <3 .M>>
  103. <SETG TINDEX <4 .M>>
  104. <OR <PASS-CHECK <2 .M>> <QUIT>>
  105. <PRINC "
  106. Last played ">
  107. <PDSKDATE <DATA-READW ,TVASS <+ ,LUBLK ,LASTIN>>>)
  108. (<SETG LUBLK <NEW-USER ,PLAYER>>)>
  109. <AND <SET PG <DIRMAP ,TVASS ,PEEK-PAGE>>
  110. <DIR-INIT .PG>
  111. <PUT <MEMQ .PG <5 ,TVASS>> 3 1>
  112. <SET TEMP
  113. <+ ,PEEK-START
  114. <SETG PG <* .PG 1024>>
  115. <SETG TINDEX <* ,TINDEX 4>>>>
  116. <PUT-LOC <+ .TEMP 1> '![0!]>
  117. <DHLOCK .TEMP>>
  118. <UPDATE-BABBLE ,LUBLK ,TINDEX>
  119. <PUT ,TUV 2 <STRTOX ,PLAYER>>
  120. <PUT ,TUV 3 <CHTYPE <DSKDATE> FIX>>
  121. <SET-STATUS ,$SWAKE>
  122. <DATA-PRINTW ,TVASS <+ ,LUBLK ,LASTIN> <DSKDATE>>
  123. <SETG LASTMAIL
  124. <CHTYPE <1 <GET-LOC <+ ,PG 1 ,TELEC-START ,TINDEX> ,TTUV>>
  125. WORD>>
  126. <READ.ANNOUNCE>
  127. <PLAY-BALL>)
  128. (<PRINC "
  129. TRIVIA DATA BASE MISSING?
  130. "> <QUIT>)>>
  131. <DEFINE UPDATE-BABBLE (LUBLK TINDEX
  132. "AUX" SCORE (TBUV ,TBUV) (PG ,PG) LOC (TTUV ,TTUV))
  133. #DECL ((LOC LUBLK TINDEX PG) FIX (TBUV) <UVECTOR [3 FIX]>
  134. (SCORE) <OR FALSE <UVECTOR [REST UVECTOR]>> (TTUV) <UVECTOR FIX>)
  135. <PUT-LOC <+ .PG ,TELEC-START .TINDEX 2> <PUT .TTUV 1 0>>
  136. <SET LOC <+ .PG ,BABBLE-START .TINDEX>>
  137. <UNWIND <PROG (SCOREM (TOTAL 0.000) (POSS 0.000))
  138. #DECL ((SCOREM) <OR FALSE MANIAC> (TOTAL POSS) FLOAT)
  139. <COND (<DHLOCK .LOC>
  140. <SET SCORE
  141. <DATA-AREAD ,TVASS
  142. <+ .LUBLK ,SCORE>
  143. <ARESET ,TVSPACE>>>
  144. <GET-LOC .LOC .TBUV>
  145. <PUT .TBUV 2 <GETLASTQ .LUBLK>>
  146. <MAPF <>
  147. <FUNCTION (X)
  148. <SET TOTAL <+ .TOTAL <1 .X>>>
  149. <SET POSS <+ .POSS <2 .X>>>>
  150. .SCORE>
  151. <PUT .TBUV 3 <CHTYPE .TOTAL FIX>>
  152. <PUT .TBUV 4 <CHTYPE .POSS FIX>>
  153. <PUT-LOC .LOC .TBUV>
  154. <DUNLOCK .LOC>)
  155. (<SLEEP 1> <AGAIN>)>>
  156. <DUNLOCK .LOC>>>
  157. <SETG VERBOSE <>>
  158. <DEFINE DO-TELECON ("AUX" FX)
  159. #DECL ((FX) <OR FALSE FIX>)
  160. <COND (<SET FX
  161. <READER '[] "at intervals of " '["" ""] '["FIX"] ,VERBOSE>>
  162. <TELECON .FX>)>>
  163. <SETG TELEC-INTERVAL 0>
  164. <GDECL (TELEC-INTERVAL) FIX>
  165. <DEFINE TELECON (AMT)
  166. #DECL ((AMT) FIX)
  167. <SETG TELEC-INTERVAL .AMT>
  168. <COND (<GASSIGNED? RTIMINT>)
  169. (<SETG RTIMINT <ON "REALT" ,CHECK.MAIL 1>>)>
  170. <PUT-LOC <+ ,PG ,TELEC-START ,TINDEX 2>
  171. <PUT ,TTUV 1 *400000000000*>>
  172. <REALTIMER .AMT>>
  173. <DEFINE OFFTELECON ()
  174. <COND (<GASSIGNED? RTIMINT>
  175. <SETG TELEC-INTERVAL 0>
  176. <OFF ,RTIMINT>
  177. <PUT-LOC <+ ,PG ,TELEC-START ,TINDEX 2> <PUT ,TTUV 1 0>>
  178. <GUNASSIGN RTIMINT>)>>
  179. <DEFINE CHECK.MAIL ("AUX" (TVA ,TVASS) LST (UV ,TTUV) (TINDEX ,TINDEX))
  180. #DECL ((TVA) ASYLUM (LST) WORD (UV) <UVECTOR FIX> (TINDEX) FIX)
  181. <COND (<==? <CHTYPE <GETBITS <1 <GET-LOC <+ ,PG ,PEEK-START .TINDEX 3>
  182. .UV>>
  183. <BITS 18 18>>
  184. FIX>
  185. ,$SREAD>)
  186. (<==? <SET LST
  187. <CHTYPE <1 <GET-LOC <+ ,TELEC-START ,PG .TINDEX 1>
  188. .UV>>
  189. WORD>>
  190. ,LASTMAIL>)
  191. (<SETG LASTMAIL .LST> <PRINC "
  192. --MESSAGE HERE--
  193. ">)>
  194. <INT-LEVEL 0>
  195. <DISMISS T>>
  196. <SETG PNEWMAIL <>>
  197. <SETG WINNERS ("MARC" "TAA" "JMB")>
  198. <DEFINE PASS-CHECK (PW "AUX" PS I)
  199. #DECL ((PS PW) STRING (I) HANDLER)
  200. <SET I
  201. <ON "CHAR"
  202. <FUNCTION (R N)
  203. #DECL ((R) CHARACTER (N) CHANNEL)
  204. <COND (<==? .R <ASCII 19>>
  205. <OR <MEMBER <XUNAME> ,WINNERS> <QUIT>>)>>
  206. 8
  207. 0
  208. ,INCHAN>>
  209. <REPEAT ((N 3))
  210. <RESET .INCHAN>
  211. <TTYECHO .INCHAN <>>
  212. <PRINC "
  213. Password: ">
  214. <READSTRING <SET PS <ISTRING 10>> .INCHAN ,PWTERM>
  215. <UPPERCASE .PS>
  216. <TTYECHO .INCHAN T>
  217. <COND (<=? .PS .PW> <OFF .I> <RETURN T>)
  218. (<SET N <- .N 1>> <AND <L? .N 0> <OFF .I> <RETURN <>>>)>>>
  219. <DEFINE NEW-USER (XUNM "AUX" PS VEC (TVA ,TVASS) (TVS ,TVSPACE))
  220. #DECL ((PS XUNM) STRING (VEC) <UVECTOR [REST UVECTOR]> (TVA) ASYLUM
  221. (TVS) SPACE)
  222. <PROG ()
  223. <SET PS <ISTRING 10>>
  224. <PRINC "
  225. Your TRIVIA password: ">
  226. <RESET .INCHAN>
  227. <TTYECHO .INCHAN <>>
  228. <READSTRING .PS .INCHAN ,PWTERM>
  229. <UPPERCASE .PS>
  230. <COND (<MEMQ <1 .PS> '(!" !" !"î)>
  231. <PRINC "
  232. Illegal password.">
  233. <AGAIN>)>
  234. <TTYECHO .INCHAN T>
  235. <PRINC "
  236. Please confirm your chosen password,">
  237. <OR <PASS-CHECK .PS> <AGAIN>>
  238. <PROG (L)
  239. #DECL ((L) <OR FALSE FIX>)
  240. <COND
  241. (<SET L <DATA-RESERVE .TVA ,LBLEN>>
  242. <PROG (CRAZY P)
  243. #DECL ((CRAZY) <OR FALSE MANIAC> (P) LIST)
  244. <COND
  245. (<SET CRAZY <DATA-OPEN "PRINT" .TVA ,LUSERS>>
  246. <UNWIND
  247. <PROG (TINDEX)
  248. #DECL ((TINDEX) FIX)
  249. <COND (<==? <SET TINDEX
  250. <CHTYPE <DATA-READW .TVA ,HIPOFFSET> FIX>>
  251. 83>
  252. <PERR "Can't make NEW-USER--no slots available">)
  253. (T
  254. <SETG TINDEX .TINDEX>
  255. <DATA-PRINTW .TVA ,HIPOFFSET <+ .TINDEX 1>>)>
  256. <ARESET .TVS>
  257. <SET P <DATA-AREAD .TVA ,LUSERS .TVS>>
  258. <SET P <PUTREST <ALIST .TVS .TINDEX> .P>>
  259. <SET P <PUTREST <ALIST .TVS .L> .P>>
  260. <SET P <PUTREST <ALIST .TVS <ACOPY .TVS .PS>> .P>>
  261. <SET P <PUTREST <ALIST .TVS <ACOPY .TVS .XUNM>> .P>>
  262. <OR <DATA-IPRINT .TVA .CRAZY .TVS .P>
  263. <PERR "Can't print NEW-USER">>
  264. <DATA-CLOSE .TVA .CRAZY>>
  265. <DATA-CLOSE .TVA .CRAZY>>
  266. <SET VEC <AIUVECTOR <ARESET .TVS> ,NCAT <AUVECTOR .TVS>>>
  267. <MAPR <>
  268. <FUNCTION (X) <PUT .X 1 <AUVECTOR .TVS 0.000 0.000>>>
  269. .VEC>
  270. <DATA-APRINT .TVA <+ .L ,SCORE> .TVS .VEC>
  271. <DATA-APRINT .TVA
  272. <+ .L ,QASKED>
  273. .TVS
  274. <AIVECTOR <ARESET .TVS> ,NCAT <ALIST .TVS>>>
  275. <DATA-PRINTW .TVA <+ .L ,QNEXT> ,LOWQUES>
  276. <DATA-PRINTW .TVA <+ .L ,ALAST> <+ .L ,ANEXT>>
  277. <DATA-PRINTW .TVA <+ .L ,MLAST> <+ .L ,MNEXT>>
  278. <DATA-PRINTW .TVA <+ .L ,ANNEXT> ,LOMAIL>
  279. .L)
  280. (<AGAIN>)>>)
  281. (<AGAIN>)>>>>
  282. <DEFINE COMMAND ("AUX" RD)
  283. #DECL ((RD) <OR FALSE SYMBOL>)
  284. <REPEAT ()
  285. <AND ,FLUSH <FLUSH-EM>>
  286. <SET-STATUS ,$SCOM>
  287. <COND (<SET RD <READER ,MCOMS "
  288. @" '["" ""] ["SYM"] <>>>
  289. <EVAL <2 .RD>>)>>>
  290. <SETG COMS
  291. <MAKEBST "COMMANDS"
  292. '["Announce"
  293. <ANNOUNCE>
  294. "Answer"
  295. <ASK.QUESTIONS>
  296. "Babble"
  297. <BABBLE-SORT>
  298. "End.teleconference"
  299. <OFFTELECON>
  300. "Grade"
  301. <GRADE.STUFF>
  302. "Load.players"
  303. <NEW-LOSS>
  304. "Load.scores"
  305. <MOBY-VEC>
  306. "Make"
  307. <MAKE.QUESTIONS>
  308. "No.simple"
  309. <COND (<SETG IGNORE-SIMPLE <NOT ,IGNORE-SIMPLE>>
  310. <PRINC "
  311. Ignore simple questions">)
  312. (<PRINC "
  313. Read simple questions">)>
  314. "Peek"
  315. <TVPEEK>
  316. "Print.score"
  317. <PSCORES>
  318. "Question.print"
  319. <PRINT.QSCORE T T>
  320. "Quit"
  321. <QUIT>
  322. "Read.mail"
  323. <READ.MAIL>
  324. "Safety"
  325. <COND (<SETG BUFSAFE <NOT ,BUFSAFE>> <PRINC "
  326. Safe">)
  327. (<PRINC "
  328. Sorry">)>
  329. "Save.tailor"
  330. <SAVE-TAILOR>
  331. "Send.mail"
  332. <SEND.MAIL>
  333. "Sequence"
  334. <GET-SEQUENCE>
  335. "Shout"
  336. <SHOUT>
  337. "Simple.load"
  338. <LOAD.SIMPLE ,PLAYER>
  339. "Simple.print"
  340. <PRINT.SIMPLE>
  341. "Simple.update"
  342. <UPDATE.QUESTION <>>
  343. "Status.of.question"
  344. <PRINT.QSCORE>
  345. "Summary.status.of.question"
  346. <PRINT.QSCORE <>>
  347. "Teleconference"
  348. <DO-TELECON>
  349. "Tiny.babble"
  350. <BABBLE-SORT T>
  351. "Update.question"
  352. <UPDATE.QUESTION>
  353. "Verbosity"
  354. <COND (<SETG VERBOSE <NOT ,VERBOSE>> <PRINC "
  355. Verbose">)
  356. (<PRINC "
  357. Unverbose">)>]>>
  358. <SETG BUFSAFE <>>
  359. <SETG DCOMS <MAKESST "DCOM" []>>
  360. <SETG MCOMS <MAKEMST "MCOM" [,COMS ,DCOMS]>>
  361. <SETG DCOM
  362. '["Recurse"
  363. <RECURSE>
  364. "Play"
  365. <PLAY>
  366. "Erret"
  367. <DO-ERRET>
  368. "Evaluate"
  369. <DO-EVAL>]>
  370. <DEFINE DO-ERRET () <ERRET <READER [] "" "" ["ANY"] <>>>>
  371. <DEFINE DO-EVAL () <EVAL <READER [] "" "" ["ANY"] <>>>>
  372. <SETG DEBUGSW <>>
  373. <DEFINE DEBUG () <PUT ,DCOMS 2 ,DCOM> <SETG DEBUGSW T>>
  374. <SETG DSKDATE
  375. %<FIXUP!-RSUBRS '[
  376. #CODE ![23751557122 23085678677 25614352384 4701028359 -26289897472 17188483128
  377. 23085698016 *400000000000* -14200726235 -34091302910 2 5804174166 0 262146!]
  378. DSKDATE
  379. #DECL ("VALUE" WORD)]
  380. '(53
  381. FINIS!-MUDDLE
  382. 229461
  383. (2)
  384. $TLOSE!-MUDDLE
  385. 225280
  386. (6)
  387. MPOPJ!-MUDDLE
  388. 248800
  389. (7))>>
  390. <AND <ASSIGNED? GLUE>
  391. .GLUE
  392. <PUT ,DSKDATE GLUE '![17448304640 2!]>>
  393. <SETG FLUSH <>>
  394. <SETG QTYPES
  395. <MAKEBST "QT"
  396. '["Command"
  397. 1
  398. "Joint"
  399. 8
  400. "Long Answer"
  401. 2
  402. "Matching"
  403. 3
  404. "Multiple Choice"
  405. 4
  406. "None"
  407. 0
  408. "Quit"
  409. 6
  410. "Simple"
  411. 7
  412. "True/False"
  413. 5]>>
  414. <SETG CATS
  415. <MAKEBST "CAT"
  416. '["Athletics"
  417. 1
  418. "Cinema"
  419. 2
  420. "Events"
  421. 3
  422. "General"
  423. 4
  424. "History"
  425. 5
  426. "Literature"
  427. 6
  428. "Music"
  429. 7
  430. "Science Fiction"
  431. 8
  432. "TV/Radio"
  433. 9]>>
  434. <DEFINE QUESTIONABLE? (STR)
  435. #DECL ((STR) STRING)
  436. <NOT <MAPF <>
  437. <FUNCTION (X) <COND (<G? <ASCII .X> 32> <MAPLEAVE T>)>>
  438. .STR>>>
  439. <DEFINE TP (QUESTION) ;"Hack to get Q's to print evenly"
  440. #DECL ((QUESTION) STRING)
  441. <COND (<L=? <14 .OUTCHAN> 40> <PUT .OUTCHAN 14 41>)>
  442. .QUESTION>
  443. <DEFINE UNTASTEFUL-CODE (Q "OPTIONAL" (GST <>) "AUX" (IDX 0))
  444. <MAPF ,VECTOR
  445. <FUNCTION (X)
  446. <SET IDX <+ .IDX 1>>
  447. <COND (<AND <1? .IDX> .GST>
  448. <MAPRET 2
  449. ,MATCH-HACK
  450. <STRING <UNPARSE .IDX> ". " .X>
  451. 0>)>
  452. <MAPRET <STRING <UNPARSE .IDX> ". " .X>
  453. <COND (.GST 0) (.IDX)>>>
  454. .Q>>
  455. <DEFINE FLUSH-EM ()
  456. <COND (<TYPE? ,FLUSH FIX> <OUT ,FLUSH>)
  457. (<==? ,FLUSH SHOUT> <SETG FLUSH <>> <PRINT.SHOUT>)
  458. (T
  459. <OUT <MOD <RANDOM <CHTYPE <TIME> FIX> <FIX <SIN <TIME>>>> 20>>)>>
  460. <DEFINE OUT ("OPTIONAL" (DELAY 10.000))
  461. #DECL ((DELAY) <SPECIAL <OR FIX FLOAT>>)
  462. <SET-STATUS ,$SFLUSH>
  463. <OFF "CHAR" ,INCHAN>
  464. <INT-LEVEL 999>
  465. <ON "CLOCK"
  466. <FUNCTION ("AUX" (D .DELAY))
  467. <AND <0? <- .D <FIX .D>>>
  468. <PRINC "TRIVIA going down in ">
  469. <PRIN1 <FIX .D>>
  470. <PRINC <COND (<1? .D> " second.") (" seconds.")>>
  471. <CRLF>>
  472. <SET DELAY <- .D 0.500>>>
  473. 1000>
  474. <SLEEP .DELAY>
  475. <VALRET ":KILL
  476. :
  477. TRIVIA DOWN!
  478. 
  479. ">>
  480. <DEFINE PRINT.SHOUT ("AUX" (MSG
  481. <DATA-AREAD ,TVASS ,SHOUTMSG <ARESET ,TVSPACE>>))
  482. #DECL ((MSG) <VECTOR STRING STRING>)
  483. <CRLF>
  484. <CRLF>
  485. <CRLF>
  486. <IMAGE 7>
  487. <IMAGE 7>
  488. <IMAGE 7>
  489. <PRINC "Message from ">
  490. <PRINC <1 .MSG>>
  491. <CRLF>
  492. <PRINC <2 .MSG>>
  493. <CRLF>>
  494. <DEFINE SHOUT ("AUX" MSG ID (TVA ,TVASS) (TVS ,TVSPACE))
  495. #DECL ((MSG) STRING (ID) <OR FALSE MANIAC> (TVA) ASYLUM)
  496. <COND (<MEMBER ,PLAYER ,WINNERS>
  497. <SET MSG <GETBUF "Message: ">>
  498. <COND (<NOT <QUESTIONABLE? .MSG>>
  499. <COND (<SET ID <DATA-OPEN "PRINT" .TVA ,SHOUTMSG>>
  500. <DATA-IPRINT .TVA
  501. .ID
  502. .TVS
  503. <AVECTOR <ARESET .TVS>
  504. <ACOPY .TVS ,PLAYER>
  505. <ACOPY .TVS .MSG>>>
  506. <SEND-TRIVIAS SHOUT>
  507. <DATA-CLOSE .TVA .ID>)
  508. (<CRLF>
  509. <PRINC
  510. "The right hand knows not what the left hand does.">
  511. <CRLF>)>)>)>>
  512. <DEFINE FLUSH-ALL ("OPTIONAL" (GRACE 10) "AUX" CH)
  513. #DECL ((GRACE) FIX (CH) <OR CHANNEL FALSE>)
  514. <COND (<MEMBER ,PLAYER ,WINNERS>
  515. <CRLF>
  516. <VALRET ":COPY AR1:MARC;TS TVDOWN,SYS;TS TRIVIA
  517. :CONTIN
  518. ">
  519. <AND <SET CH <OPEN "PRINT" "_MSGS_;TRIVIA DEBUG">>
  520. <CLOSE .CH>>
  521. <SEND-TRIVIAS .GRACE>)
  522. (<QUIT>)>>
  523. <DEFINE SEND-TRIVIAS (WHAT?
  524. "AUX" (PG ,PG) (UV ,FOOUV) (SENDER ,PLAYER)
  525. (MSG <STRING "<SETG FLUSH " <UNPARSE .WHAT?> ">">))
  526. #DECL ((PG) FIX (UV) <UVECTOR [4 FIX]> (SENDER MSG) STRING)
  527. <SET-STATUS ,$SHOUT>
  528. <REPEAT ((N 0) (LOC <+ .PG ,PEEK-START>) LOSER)
  529. #DECL ((N LOC) FIX (LOSER) STRING)
  530. <COND (<G? .N 83> <RETURN>)
  531. (<AND <GET-LOC .LOC .UV> <0? <1 .UV>>>
  532. <COND (<=? <SET LOSER <SIXTOS <2 .UV>>> .SENDER>)
  533. (T
  534. <SEND .LOSER "TRIVIA" .MSG *400000000000*>
  535. <PRINC .LOSER>
  536. <CRLF>)>)>
  537. <SET N <+ .N 1>>
  538. <SET LOC <+ .LOC 4>>>>
  539. <SETG GIVEUP <MAKESST "GIVE" ["
  540. Give up (CR)" <>]>>
  541. <SETG SYMTAB <MAKESST "SYMS" []>>
  542. <SETG ALLSYMS <MAKEMST "ALLSYMS" [,GIVEUP ,SYMTAB]>>
  543. <SETG ALWAYS-ANSWER <>>
  544. <SETG KEEPASKING <>>
  545. <SETG IGNORE-SIMPLE <>>
  546. <SETG NEW-MATCH <>>
  547. <SETG T/F <MAKESST "T/F" ["Yes" T "No" <>]>>
  548. <DEFINE TRUE? (STR1 STR2 TRUELST FALSELST "OPTIONAL" INTCHR "AUX" CHR)
  549. #DECL ((STR1 STR2) STRING (INTCHR CHR) CHARACTER (TRUELST) LIST)
  550. <PROG ()
  551. <PRINC .STR1>
  552. <RESET ,INCHAN>
  553. <PRINC " (">
  554. <PRINC .STR2>
  555. <PRINC ") ">
  556. <SET CHR <TYI>>
  557. <COND (<AND <ASSIGNED? INTCHR> <==? .CHR .INTCHR>>
  558. <INTERRUPT "CHAR" .INTCHR ,INCHAN>)>
  559. <COND (<MEMQ .CHR .TRUELST>)
  560. (<MEMQ .CHR .FALSELST> <>)
  561. (<AGAIN>)>>>
  562. <DEFINE SEND-PLAYER (WHO WHAT
  563. "OPTIONAL" (WHR ,ALAST) (MUNG-SLOT? <>)
  564. "AUX" (TVS ,TVSPACE2) (TVA ,TVASS) (TTUV ,TTUV) NUTS LAST
  565. NEW (RETRY? T) LOC)
  566. #DECL ((WHO) STRING (WHAT) ANY (TVS) SPACE (NUTS) LIST (LOC LAST WHR) FIX
  567. (TVA) ASYLUM (MUNG-SLOT) <OR FIX FALSE> (NEW) <OR FALSE MANIAC>
  568. (RETRY?) <OR ATOM FALSE> (TTUV) <UVECTOR FIX>)
  569. <COND (<=? ,PLAYER "DEBUG">)
  570. (<SET NUTS <GET-LOSER .WHO>>
  571. <SET LAST <+ .WHR <3 .NUTS>>>
  572. <COND (.MUNG-SLOT?
  573. <SET LOC <+ ,PG <* 4 <4 .NUTS>> .MUNG-SLOT?>>
  574. <UNWIND <PROG ()
  575. <COND (<DHLOCK .LOC>
  576. <GET-LOC .LOC .TTUV>
  577. <PUT .TTUV 1 <CHTYPE <4 .WHAT> FIX>>
  578. <PUT-LOC <+ .LOC 1> .TTUV>
  579. <DUNLOCK .LOC>)
  580. (<SLEEP 2> <AGAIN>)>>
  581. <DUNLOCK .LOC>>)>
  582. <COND (<CHAIN-APPEND .TVA .TVS .WHAT .LAST>
  583. <CRLF>
  584. <PRINC "Sent.">)
  585. (<PERR "SEND-PLAYER FAILURE -- PLEASE REPORT TO MARC">)>)>>
  586. <DEFINE NEW-LOSS ("AUX" NUTS)
  587. #DECL ((NUTS) <OR LIST FALSE>)
  588. <GUNASSIGN PLAYER-SYMS>
  589. <COND (<SET NUTS <DATA-AREAD ,TVASS ,LUSERS <ARESET ,LOSSSPACE>>>
  590. <SETG LOSSTABLE .NUTS>
  591. .NUTS)
  592. (T
  593. <PERR "Can't read losstable--your TRIVIA is DEAD"
  594. .NUTS
  595. NEW-LOSS>)>>
  596. <DEFINE CHAIN-APPEND (TVA TVS WHAT CHAIN "AUX" OINT)
  597. #DECL ((TVA) ASYLUM (TVS) SPACE (WHAT) ANY (OINT CHAIN) FIX)
  598. <SET OINT <INT-LEVEL 20>>
  599. <PROG (FROB HIA WHR RETVAL)
  600. #DECL ((FROB HIA) <OR FALSE MANIAC> (RETVAL WHR) FIX)
  601. <COND (<SET FROB <DATA-APRINT .TVA -1 .TVS .WHAT>>
  602. <OR <0? <CHTYPE <DATA-READW .TVA <SET RETVAL <1 .FROB>>>
  603. FIX>>
  604. <AND <INT-LEVEL 0>
  605. <PERR "Non-zero chain pointer"
  606. CHAIN-APPEND
  607. .FROB>>>
  608. <COND (<AND <SET HIA <DATA-OPEN "PRINTW" .TVA .CHAIN>>
  609. <SET WHR <CHTYPE <DATA-READW .TVA .CHAIN> FIX>>
  610. <DATA-PRINTW .TVA .WHR .RETVAL>
  611. <DATA-PRINTW .TVA .HIA .RETVAL>>
  612. <INT-LEVEL .OINT>
  613. .RETVAL)
  614. (<AND <NOT .HIA> <MEMQ <1 .HIA> '(5 6)>>
  615. <STALL <1 .HIA>>
  616. <AGAIN>)
  617. (<PERR "Can't CHAIN-APPEND" .FROB .HIA>)>)
  618. (<MEMQ <1 .FROB> '(5 6)> <STALL <1 .FROB>> <AGAIN>)
  619. (<INT-LEVEL 0>
  620. <PERR "Can't PRINT append, CHAIN-APPEND" .FROB>)>>>
  621. <DEFINE STALL (WHY)
  622. <PRINC "
  623. NON-FATAL TIME OUT, STALLING BECAUSE --">
  624. <PRINC <NTH ,ERRORS .WHY>>
  625. <SLEEP 4>>
  626. <DEFINE GET-LOSER (PLAYER "AUX" (NUTS ,LOSSTABLE) OINT)
  627. #DECL ((PLAYER) STRING (NUTS) <OR LIST FALSE> (OINT) FIX)
  628. <SET OINT <INT-LEVEL 20>>
  629. <COND (<SET NUTS <MEMBER .PLAYER .NUTS>>)
  630. (<SET NUTS <NEW-LOSS>>
  631. <COND (<SET NUTS <MEMBER .PLAYER .NUTS>>)
  632. (<PERR "Player does not exist!!" .PLAYER GET-LOSER>)>)>
  633. <INT-LEVEL .OINT>
  634. .NUTS>
  635. <DEFINE ADDSCORE (WHO QUES AMT
  636. "AUX" (NUTS <GET-LOSER .WHO>) (TVA ,TVASS) (TVS ,TVSPACE1) ID
  637. SCORE SCUVEC LBLK M CATSCR OINT)
  638. #DECL ((WHO) STRING (QUES) VECTOR (AMT) <OR FIX FLOAT> (TVA) ASYLUM
  639. (NUTS) LIST (TVS) SPACE (ID) <OR MANIAC FALSE> (SCORE) WORD
  640. (SCUVEC) <UVECTOR [REST <UVECTOR FLOAT FLOAT>]> (M) <OR FALSE LIST>
  641. (LBLK) FIX (CATSCR) <UVECTOR FLOAT FLOAT>)
  642. <COND
  643. (<=? ,PLAYER "DEBUG">)
  644. (<SET OINT <INT-LEVEL 20>>
  645. <COND
  646. (<SET ID <DATA-OPEN "PRINTW" .TVA <NTH .QUES ,QSCORE>>>
  647. <SET SCORE <DATA-READW .TVA <1 .ID>>>
  648. <SET SCORE
  649. <PUTBITS .SCORE
  650. <BITS 18 18>
  651. <CHTYPE <+ 1 <CHTYPE <GETBITS .SCORE <BITS 18 18>> FIX>>
  652. WORD>>>
  653. <DATA-PRINTW
  654. .TVA
  655. .ID
  656. <PUTBITS .SCORE
  657. <BITS 18 0>
  658. <CHTYPE <+ <FIX <* 1000 .AMT>>
  659. <CHTYPE <GETBITS .SCORE <BITS 18 0>> FIX>>
  660. WORD>>>)
  661. (<INT-LEVEL 0> <PERR "Can't update QUESTION-SCORE" .QUES>)>
  662. <SET LBLK <3 .NUTS>>
  663. <PROG (QVAL (TBUV ,TBUV) (TINDEX <4 .NUTS>)
  664. (LOC <+ ,PG ,BABBLE-START <* 4 .TINDEX>>))
  665. #DECL ((QVAL) FLOAT (TBUV) <UVECTOR [4 FIX]> (TINDEX LOC) FIX)
  666. <COND
  667. (<SET ID <DATA-OPEN "PRINT" .TVA <+ .LBLK ,SCORE>>>
  668. <SET SCUVEC <DATA-IREAD .TVA .ID <ARESET .TVS>>>
  669. <SET CATSCR <NTH .SCUVEC <NTH .QUES ,QCAT>>>
  670. <PUT .CATSCR 1 <FLOAT <+ .AMT <1 .CATSCR>>>>
  671. <PUT .CATSCR
  672. 2
  673. <+ <SET QVAL <FLOAT <NTH .QUES ,QVAL>>> <2 .CATSCR>>>
  674. <DATA-IPRINT .TVA .ID .TVS .SCUVEC>
  675. <PROG ()
  676. <COND (<DHLOCK .LOC>
  677. <GET-LOC .LOC .TBUV>
  678. <PUT .TBUV
  679. 3
  680. <CHTYPE <+ <CHTYPE <3 .TBUV> FLOAT> <FLOAT .AMT>>
  681. FIX>>
  682. <PUT .TBUV
  683. 4
  684. <CHTYPE <+ <CHTYPE <4 .TBUV> FLOAT> .QVAL> FIX>>
  685. <PUT-LOC .LOC .TBUV>
  686. <DUNLOCK .LOC>)
  687. (<SLEEP 2> <AGAIN>)>>
  688. <DATA-CLOSE .TVA .ID>)
  689. (<MEMQ <1 .ID> '(5 6)> <STALL <1 .ID>> <AGAIN>)
  690. (<INT-LEVEL 0>
  691. <PERR "Can't update PLAYER-SCORE" .WHO .AMT .NUTS>)>>
  692. <INT-LEVEL .OINT>)>>
  693. <DEFINE PERR (STR "TUPLE" ARG)
  694. #DECL ((STR) STRING (ARG) TUPLE)
  695. <SET-STATUS ,$SERROR>
  696. <CRLF>
  697. <PRINC "ERROR, ">
  698. <PRINC .STR>
  699. <PRINC ". Please report to ">
  700. <PRINC ,MAINT>
  701. <SETG REP ,SAVEREP>
  702. <ERROR TRIVIA-LOSSAGE!-ERRORS !.ARG>>
  703. <SETG MAINT "MARC or TAA">
  704. <SETG WHOSYMS <MAKESST "FOO" []>>
  705. <DEFINE P-SYMS ("AUX" (NUTS ,LOSSTABLE) (CURSPACE ,LOSSSPACE))
  706. #DECL ((NUTS) LIST (CURSPACE) <SPECIAL SPACE>)
  707. <COND (<GASSIGNED? PLAYER-SYMS> ,PLAYER-SYMS)
  708. (<SETG PLAYER-SYMS
  709. <PUT ,WHOSYMS
  710. 2
  711. <MAPR ,ALVECTOR
  712. <FUNCTION (X)
  713. <COND (<==? 1 <1 .X>> <MAPRET>)
  714. (<AND <TYPE? <1 .X> STRING>
  715. <NOT <TYPE? <2 .X> FIX>>>
  716. <MAPRET <1 .X> <3 .X>>)
  717. (<MAPRET>)>>
  718. .NUTS>>>)>>
  719. <DEFINE SEND.MAIL ("AUX" (TVS <ARESET ,TVSPACE2>) WHO LST MSG)
  720. #DECL ((TVS) SPACE (WHO) <OR FALSE VECTOR> (LST) <LIST [REST SYMBOL]>
  721. (MSG) STRING)
  722. <COND
  723. (<SET WHO <READARGS <P-SYMS> "To" '["" ""] '["SYM" "MULT"]>>
  724. <COND (<EMPTY? <SET LST <1 .WHO>>>)
  725. (<SET MSG <GETBUF "Message: ">>
  726. <MAPF <>
  727. <FUNCTION (X)
  728. <SEND-PLAYER <1 .X>
  729. <AVECTOR .TVS
  730. .MSG
  731. 1
  732. <ACOPY .TVS ,PLAYER>
  733. <DSKDATE>>
  734. ,MLAST
  735. ,TELEC-START>>
  736. .LST>)>)>>
  737. <DEFINE CHAIN-FOLLOW (APP FROM TO
  738. "AUX" (TVA ,TVASS)
  739. (LO <CHTYPE <DATA-READW .TVA <+ ,LUBLK .FROM>> FIX>)
  740. (TVS <ARESET ,TVSPACE>) MAIL NEXT)
  741. #DECL ((TVA) ASYLUM (LO FROM TO) FIX (TVS) SPACE
  742. (MAIL) <OR FALSE VECTOR> (NEXT) WORD
  743. (APP) <VECTOR [REST APPLICABLE]>)
  744. <COND (<0? .LO> #FALSE ())
  745. (<SET MAIL <DATA-AREAD .TVA .LO .TVS>>
  746. <APPLY <NTH .APP <NTH .MAIL ,ATYPE>> .MAIL>
  747. <DATA-PRINTW .TVA
  748. <+ ,LUBLK .FROM>
  749. <SET NEXT <DATA-READW .TVA .LO>>>
  750. <COND (<==? .NEXT #WORD *000000000000*>
  751. <DATA-PRINTW .TVA <+ ,LUBLK .TO> <+ ,LUBLK .FROM>>)>
  752. <DATA-DELETE .TVA .LO>)>>
  753. <DEFINE VERBOHACK ("TUPLE" TUP)
  754. <CRLF>
  755. <COND (<SETG KEEPASKING <NOT ,KEEPASKING>>
  756. <PRINC "Continuous questions mode">
  757. <AND <ASSIGNED? topask>
  758. <LEGAL? .topask>
  759. <RETURN T .topask>>)
  760. (<PRINC "One at a time mode">)>
  761. <CRLF>>
  762. <DEFINE ANSHACK ()
  763. <CRLF>
  764. <COND (<SETG ALWAYS-ANSWER <NOT ,ALWAYS-ANSWER>>
  765. <PRINC "Always give answer mode">
  766. <AND <ASSIGNED? topask>
  767. <LEGAL? .topask>
  768. <RETURN T .topask>>)
  769. (<PRINC "Dont give answers">)>
  770. <CRLF>>
  771. <DEFINE ANSWERHACK ("TUPLE" X)
  772. <PROG ()
  773. <COND (<AND <ASSIGNED? Q.A>
  774. <ASSIGNED? BUF>
  775. <==? <NTH .Q.A ,QTYPE> ,$TLONG>>
  776. <ADDSTRING .BUF <NTH .Q.A 10>>
  777. <PRINC "[Answer added]">)
  778. (<ANSHACK>)>>>
  779. <DEFINE CHAR-INIT ()
  780. <CALRDRINIT>
  781. <SETG SPCCHARS <STRING <ASCII 22> !,SPCCHARS>>
  782. <SET FOO <MEMQ <ASCII 12> .CHRTABLE>>
  783. <PUT .FOO 2 ,BUFHACK>
  784. <SET CHRTABLE
  785. [<ASCII 20> ,ANSWERHACK <ASCII 22> ,VERBOHACK !.CHRTABLE]>
  786. <SET FOO <MEMQ <ASCII 12> ,XSPCCHARS>>
  787. <PUT .FOO 2 '<CLEAR>>
  788. <SETG XSPCCHARS
  789. [<ASCII 20> '<ANSHACK> <ASCII 22> '<VERBOHACK> !,XSPCCHARS]>
  790. <ON "CHAR" ,CHARINT 8 0 ,INCHAN>>
  791. <DEFINE CLEAR ()
  792. <PRINC "C">
  793. <COND (<ASSIGNED? QUESTION?>
  794. <PQHEADER .QUESTION?>
  795. <COND (<==? <NTH .QUESTION? ,QTYPE> ,$TMATCH>
  796. <MATCH-PRINT <REST .QUESTION? ,QQUES>>)
  797. (<PRINC <NTH .QUESTION? <+ ,QQUES 1>>>)>)
  798. (<ASSIGNED? Q.A>
  799. <TERPRI>
  800. <PRINC "Answer from ">
  801. <PRINC <NTH .A ,AAUTH>>
  802. <PRINC ": ">
  803. <PRINC <NTH .A ,ARESP>>)>
  804. <COND (<GASSIGNED? MATCH>
  805. <TERPRI>
  806. <PRINC "Match ">
  807. <PRINC ,MATCH>)
  808. (<ASSIGNED? MARKING>
  809. <PRINC "
  810. Score (out of ">
  811. <PRIN1 .MARKING>
  812. <PRINC ")">)>
  813. <RETYPE-BUFFER!-ICALRDR T>>
  814. <DEFINE CHARINT (CHR CHN)
  815. #DECL ((CHR) CHARACTER (CHN) CHANNEL)
  816. <INT-LEVEL 0>
  817. <COND (<==? .CHR <ASCII 7>>
  818. <COND (<MEMBER ,PLAYER ,WINNERS> <RECURSE> <DISMISS T>)
  819. (<DISMISS T>)>)
  820. (<==? .CHR <ASCII 22>> <VERBOHACK>)
  821. (<==? .CHR <ASCII 20>> <ANSHACK>)>>
  822. <DEFINE BUFHACK (BUF CHR)
  823. #DECL ((CHR) CHARACTER (BUF) BUFFER)
  824. <PRINC "C">
  825. <AND <ASSIGNED? QUESTION?> <PQHEADER .QUESTION?>>
  826. <COND (<ASSIGNED? qprompt> <PRINC .qprompt> <CRLF>)>
  827. <COND (<ASSIGNED? bprompt> <PRINC .bprompt>)>
  828. <COND (<ASSIGNED? aprompt>
  829. <PRINC .aprompt>
  830. <TERPRI>
  831. <PRINC "Correct answer">)>
  832. <AND ,VERBOSE <PRINC " (BUFFER): ">>
  833. <IBUFPRINT .BUF <ASCII 4>>>
  834. <SETG SCOREVEC <IVECTOR 2 0>>
  835. <DEFINE GETQSCORE (QLOC "AUX" (SCWD <DATA-READW ,TVASS .QLOC>) (SV ,SCOREVEC))
  836. #DECL ((QLOC) FIX (SCWD) WORD (SV) <VECTOR [2 <OR FIX FLOAT>]>)
  837. <PUT .SV 1 <CHTYPE <GETBITS .SCWD <BITS 18 18>> FIX>>
  838. <PUT .SV
  839. 2
  840. </ <CHTYPE <GETBITS .SCWD <BITS 18 0>> FIX> 1000.000>>>
  841. <DEFINE PQSCORE (QLOC QMAX
  842. "OPTIONAL" (SV <GETQSCORE .QLOC>) (MX <* <1 .SV> .QMAX>)
  843. "AUX")
  844. #DECL ((QLOC) FIX (MX QMAX) <OR FIX FLOAT>
  845. (SV) <VECTOR [2 <OR FIX FLOAT>]>)
  846. <PRIN1 <1 .SV>>
  847. <PRINC " players received ">
  848. <PRIN1 <2 .SV>>
  849. <PRINC " points of maximum ">
  850. <PRIN1 .MX>
  851. <PRINC " [">
  852. <PRIN1 <FIX </ <* 100 <2 .SV>> .MX>>>
  853. <PRINC "%]">
  854. .SV>
  855. <DEFINE GETSCORE (PLAYER "AUX" (TVA ,TVASS) (TVS ,TVSPACE1) NUTS WHR)
  856. #DECL ((PLAYER) STRING (TVA) ASYLUM (TVS) SPACE (NUTS) LIST (WHR) FIX)
  857. <SET WHR
  858. <+ ,SCORE
  859. <COND (<=? .PLAYER ,PLAYER> ,LUBLK)
  860. (<SET NUTS <GET-LOSER .PLAYER>> <3 .NUTS>)>>>
  861. <DATA-AREAD .TVA .WHR <ARESET .TVS>>>
  862. <DEFINE PSCORE (PLAYER
  863. "AUX" SCUVEC (TVS ,TVSPACE1) (TVA ,TVASS) (N 1) (TOT 0)
  864. (SCTOT 0) (QTOT 0) QTEMP QASKED LUBLK NSC NSC1)
  865. #DECL ((PLAYER) STRING (SCUVEC) UVECTOR (QTEMP QTOT N) FIX (TVA) ASYLUM
  866. (TVS) SPACE (TOT SCTOT) <OR FIX FLOAT> (NSC NSC1) FLOAT
  867. (QASKED) <VECTOR [REST LIST]> (LUBLK) FIX)
  868. <SET SCUVEC <GETSCORE .PLAYER>>
  869. <SET QASKED
  870. <DATA-AREAD .TVA
  871. <+ <SET LUBLK <3 <MEMBER .PLAYER ,LOSSTABLE>>> ,QASKED>
  872. .TVS>>
  873. <MAPF <>
  874. <FUNCTION (X)
  875. #DECL ((X) <OR STRING FIX>)
  876. <COND (<TYPE? .X STRING>
  877. <CRLF>
  878. <PRINC .X>
  879. <INDENT-TO 19>
  880. <PRIN1 <SET NSC <1 <1 .SCUVEC>>>>
  881. <SET SCTOT <+ .SCTOT .NSC>>
  882. <INDENT-TO 33>
  883. <PRIN1 <SET NSC1 <2 <1 .SCUVEC>>>>
  884. <SET TOT <+ .TOT .NSC1>>
  885. <SET N <+ .N 1>>
  886. <INDENT-TO 47>
  887. <COND (<==? .NSC1 0.000> <PRINC "---">)
  888. (T <PRIN1 </ .NSC .NSC1>>)>
  889. <SET SCUVEC <REST .SCUVEC>>
  890. <INDENT-TO 61>
  891. <PRIN1 <SET QTEMP </ <LENGTH <1 .QASKED>> 2>>>
  892. <SET QTOT <+ .QTEMP .QTOT>>
  893. <SET QASKED <REST .QASKED>>)>>
  894. <2 ,CATS>>
  895. <CRLF>
  896. <PRINC "Total of ">
  897. <PRIN1 .SCTOT>
  898. <PRINC " points out of ">
  899. <PRIN1 .TOT>
  900. <PRINC " [">
  901. <PRIN1 <FIX </ <* 100 .SCTOT> .TOT>>>
  902. <PRINC "%]. ">
  903. <PRIN1 .QTOT>
  904. <PRINC " questions.">
  905. <CRLF>
  906. <PRINC "Progress: ">
  907. <PRIN1 <GETLASTQ .LUBLK>>>
  908. <DEFINE GETLASTQ (LUBLK "AUX" (TVS ,TVSPACE1) Q LOWQ)
  909. #DECL ((LOWQ LUBLK) FIX (Q) <OR FALSE <VECTOR FIX [REST ANY]>>)
  910. <COND (<==? <SET LOWQ
  911. <CHTYPE <DATA-READW ,TVASS <+ .LUBLK ,QNEXT>> FIX>>
  912. ,LOWQUES>
  913. 0)
  914. (<SET Q <DATA-AREAD ,TVASS .LOWQ <ARESET .TVS>>>
  915. <QQNUM .Q>)>>
  916. <DEFINE PDSKDATE (WD
  917. "AUX" (TIM <CHTYPE <GETBITS .WD <BITS 18 0>> FIX>)
  918. (A/P " AM ") HR)
  919. #DECL ((WD) WORD (TIM HR) FIX (A/P) STRING)
  920. <PRINC " ">
  921. <PRINC <NTH ,MONTHS <CHTYPE <GETBITS .WD <BITS 4 23>> FIX>>>
  922. <PRINC " ">
  923. <PRIN1 <CHTYPE <GETBITS .WD <BITS 5 18>> FIX>>
  924. <PRINC " at ">
  925. <SET HR </ .TIM 7200>>
  926. <COND (<G=? .HR 12> <SET HR <- .HR 12>> <SET A/P " PM ">)>
  927. <COND (<0? .HR> <SET HR 12>)>
  928. <PRIN1 .HR>
  929. <PRINC ":">
  930. <SET HR </ <MOD .TIM 7200> 120>>
  931. <COND (<L? .HR 10> <PRINC "0">)>
  932. <PRIN1 .HR>
  933. <PRINC .A/P>>
  934. <SETG MONTHS
  935. ["January"
  936. "February"
  937. "March"
  938. "April"
  939. "May"
  940. "June"
  941. "July"
  942. "August"
  943. "September"
  944. "October"
  945. "November"
  946. "December"]>
  947. <GDECL (MONTHS) <VECTOR [12 STRING]>>
  948. <DEFINE ANNOUNCE ("AUX" (TVS <ARESET ,TVSPACE2>) (TVA ,TVASS) ANN)
  949. #DECL ((TVA) ASYLUM (TVS) SPACE (ANN) STRING)
  950. <COND (<AND <PRINC
  951. "
  952. [PLEASE ONLY MAKE ANNOUNCEMENTS IF REALLY NECESSARY
  953. TYPE ALTMODE TO FLUSH THIS COMMAND]
  954. ">
  955. <SET ANN <GETBUF "Announcement: ">>
  956. <NOT <QUESTIONABLE? .ANN>>>
  957. <CHAIN-APPEND .TVA
  958. .TVS
  959. <AVECTOR .TVS <DSKDATE> <ACOPY .TVS ,PLAYER> .ANN>
  960. ,HIMAIL>)>>
  961. <DEFINE READ.ANNOUNCE ("AUX" (TVA ,TVASS) (TVS <ARESET ,TVSPACE>) ANN
  962. (NXT
  963. <CHTYPE <DATA-READW .TVA <+ ,LUBLK ,ANNEXT>>
  964. FIX>))
  965. #DECL ((TVA) ASYLUM (NXT) FIX (TVS) SPACE (ANN) <OR FALSE VECTOR>)
  966. <REPEAT ()
  967. <COND (<0? <SET NXT <CHTYPE <DATA-READW .TVA .NXT> FIX>>>
  968. <RETURN>)
  969. (<SET ANN <DATA-AREAD .TVA .NXT .TVS>>
  970. <PRINC "
  971. From ">
  972. <PRINC <2 .ANN>>
  973. <PDSKDATE <1 .ANN>>
  974. <CRLF>
  975. <PRINC <3 .ANN>>
  976. <SET DAT <DSKDATE>>
  977. <COND (<==? <GETBITS .DAT <BITS 4 23>>
  978. <GETBITS <1 .ANN> <BITS 4 23>>>
  979. <AND <G? <- <CHTYPE <GETBITS .DAT <BITS 5 18>> FIX>
  980. <CHTYPE <GETBITS <1 .ANN> <BITS 5 18>>
  981. FIX>>
  982. 14>
  983. <DELETE.ANNOUNCE .NXT>>)
  984. (<G? <- <+ <CHTYPE <GETBITS .DAT <BITS 5 18>> FIX> 30>
  985. <CHTYPE <GETBITS <1 .ANN> <BITS 5 18>> FIX>>
  986. 14>
  987. <DELETE.ANNOUNCE .NXT>)>)>
  988. <DATA-PRINTW .TVA <+ ,LUBLK ,ANNEXT> .NXT>>>
  989. <DEFINE DELETE.ANNOUNCE (WHR "AUX" DAT LOC)
  990. #DECL ((WHR LOC) FIX (DAT) <UVECTOR [4 WORD]>)
  991. <SET DAT <DATA-FIND ,TVASS .WHR>>
  992. <SET LOC <CHTYPE <NTH .DAT <+ ,NAMDATA 1>> FIX>>
  993. <PUT .DAT 2 #WORD *000000000000*>
  994. <PUT .DAT 3 #WORD *000000000000*>
  995. <DATA-PUT ,TVASS .WHR .DAT>
  996. <DATA-BLOCK-FREE ,TVASS .LOC>>
  997. <DEFINE COMREP () <SETG SAVEREP ,REP> <SETG REP ,COMMAND>>
  998. <DEFINE RECURSE () <SETG REP ,SAVEREP> <LISTEN> <SETG REP ,COMMAND>>
  999. <DEFINE ANSWER? ()
  1000. <OR ,ALWAYS-ANSWER
  1001. <PROG topask ()
  1002. #DECL ((topask) <SPECIAL ACTIVATION>)
  1003. <TRUE? "
  1004. Want the answer "
  1005. "Y/N"
  1006. '(!"Y !"y)
  1007. '(!"N !"n)
  1008. <ASCII 20>>>>>
  1009. <DEFINE FLOATPRINT (FLT "AUX" DEC X1000)
  1010. #DECL ((FLT) FLOAT (DEC X1000) FIX)
  1011. <COND (<==? <MOD <SET X1000 <FIX <* 1000 .FLT>>> 10> 9>
  1012. <SET X1000 <+ .X1000 1>>)>
  1013. <PRIN1 </ .X1000 1000>>
  1014. <PRINC ".">
  1015. <SET DEC <MOD .X1000 1000>>
  1016. <AND <L? .DEC 100> <PRINC !"0>>
  1017. <AND <L? .DEC 10> <PRINC !"0>>
  1018. <PRINC .DEC>>
  1019. <PRINTTYPE FLOAT ,FLOATPRINT>
  1020. <OVERFLOW <>>
  1021. <DEFINE TVSAVE (VER DBG "OPTIONAL" (MOD 0) "AUX")
  1022. #DECL ((DBG) <OR 'T FALSE> (VER MOD) FIX)
  1023. <CHAR-INIT>
  1024. <AND .DBG <DEBUG>>
  1025. <FUMP .VER ,SAVE .MOD>>
  1026. <SETG QSYMS <MAKESST "QSYMS" []>>
  1027. <DEFINE Q-SYMS ("AUX" (TVA ,TVASS) (CURSPACE <ARESET ,TVSPACE>) (IDX 1) WHR)
  1028. #DECL ((TVA) ASYLUM (CURSPACE) <SPECIAL SPACE> (WHR IDX) FIX)
  1029. <COND
  1030. (<SET QPOSS <DATA-AREAD .TVA <+ ,LUBLK ,QASKED> .CURSPACE>>
  1031. <PUT
  1032. ,QSYMS
  1033. 2
  1034. <MAPF ,ALVECTOR
  1035. <FUNCTION (X "AUX" CATNM)
  1036. #DECL ((X) LIST (CATNM) STRING)
  1037. <AND <EMPTY? .X> <SET IDX <+ .IDX 1>> <MAPRET>>
  1038. <SET CATNM <NTH <2 ,CATS> <- <* .IDX 2> 1>>>
  1039. <REPEAT ((Y .X))
  1040. #DECL ((Y) LIST)
  1041. <COND (<EMPTY? .Y> <RETURN>)
  1042. (<SET WHR <1 .Y>>
  1043. <PUT .Y
  1044. 1
  1045. <ASTRING .CURSPACE
  1046. .CATNM
  1047. "."
  1048. <UNPARSE <2 .Y>>>>
  1049. <PUT .Y 2 .WHR>
  1050. <SET Y <REST .Y 2>>)>>
  1051. <SET IDX <+ .IDX 1>>
  1052. <MAPRET !.X>>
  1053. .QPOSS>>)>>
  1054. <DEFINE GET.QUESTION ("OPTIONAL" (MULT <>) "AUX" SYMS SYMV)
  1055. #DECL ((SYMS) <OR FALSE SYMTABLE> (SYMV) <OR FALSE VECTOR>
  1056. (MULT) <OR FALSE 'T>)
  1057. <COND (<SET SYMS <Q-SYMS>>
  1058. <COND (<SET SYMV
  1059. <READARGS .SYMS
  1060. "Question"
  1061. '["" ""]
  1062. <COND (.MULT '["SYM" "MULT"]) ('["SYM"])>>>
  1063. <AND <NOT <EMPTY? <1 .SYMV>>> <1 .SYMV>>)>)
  1064. (<PERR "Can't get QUESTION SYMBOLS, Q-SYMS">)>>
  1065. <GDECL (SIMPLE-SPACE) SPACE>
  1066. <SETG SIMTABLE <MAKESST "SIMTABLE" []>>
  1067. <GDECL (SIMTABLE) <OR FALSE SYMTABLE>>
  1068. <DEFINE GET.SIMPLE ("OPTIONAL" (MULT <>) "AUX" SYMV)
  1069. #DECL ((SYMV) <OR FALSE VECTOR> (MULT) <OR ATOM FALSE>)
  1070. <COND (<NOT <GASSIGNED? SIMPLE-SPACE>>
  1071. <COND (<SETG SIMTABLE <LOAD.SIMPLE ,PLAYER>>)
  1072. (T <PERR "Can't get QUESTION SYMBOLS" GET.SIMPLE>)>)>
  1073. <COND (<SET SYMV
  1074. <READARGS ,SIMTABLE
  1075. "Question"
  1076. '["" ""]
  1077. <COND (.MULT '["SYM" "MULT"]) ('["SYM"])>>>
  1078. <AND <NOT <EMPTY? <1 .SYMV>>> <1 .SYMV>>)>>
  1079. <DEFINE LOAD.SIMPLE (PLAYER
  1080. "AUX" (TVA ,TVASS)
  1081. (CURSPACE
  1082. <COND (<GASSIGNED? SIMPLE-SPACE> ,SIMPLE-SPACE)
  1083. (T <SETG SIMPLE-SPACE <AFIND 1>>)>)
  1084. (TVS ,TVSPACE1) (CQID ,LOWQUES) RES)
  1085. #DECL ((PLAYER) STRING (CURSPACE) <SPECIAL SPACE> (TVS) SPACE (TVA) ASYLUM
  1086. (CQID) FIX (RES) VECTOR)
  1087. <PUT
  1088. ,SIMTABLE
  1089. 2
  1090. <MAPF ,ALVECTOR
  1091. <FUNCTION ()
  1092. <COND
  1093. (<0? <SET CQID <CHTYPE <DATA-READW .TVA .CQID> FIX>>>
  1094. <MAPSTOP>)
  1095. (<SET CQUES <DATA-AREAD .TVA .CQID <ARESET .TVS>>>
  1096. <COND (<AND <==? <QTYPE .CQUES> ,$TSIMPLE>
  1097. <=? <QAUTH .CQUES> .PLAYER>>
  1098. <MAPRET <ASTRING .CURSPACE <UNPARSE <QQNUM .CQUES>>>
  1099. .CQID>)
  1100. (T <MAPRET>)>)
  1101. (<PERR "Can't read question" LOAD.SIMPLE .CQID> <MAPRET>)>>>>>
  1102. <DEFINE PRINT.QSCORE ("OPTIONAL" (PRINT? T) (VERBOSE? <>)
  1103. "AUX" (TVA ,TVASS) (TVS ,TVSPACE) (PL 0) (PS 0.000)
  1104. (MX 0.000) SYML)
  1105. #DECL ((SYML) <OR FALSE <LIST [REST SYMBOL]>> (TVA) ASYLUM (TVS) SPACE
  1106. (PS MX) FLOAT (PL) FIX (PRINT? VERBOSE?) <OR ATOM FALSE>)
  1107. <COND
  1108. (<SET SYML <GET.QUESTION T>>
  1109. <CRLF>
  1110. <MAPF <>
  1111. <FUNCTION (X "AUX" FROB QUES)
  1112. #DECL ((X) SYMBOL (QUES) VECTOR
  1113. (FROB) <VECTOR [2 <OR FIX FLOAT>]>)
  1114. <SET QUES <DATA-AREAD .TVA <2 .X> <ARESET .TVS>>>
  1115. <COND (.PRINT?
  1116. <PQHEADER .QUES>
  1117. <COND (.VERBOSE? <PRINT-QUESTION .QUES>)
  1118. (T <PRINC <NTH .QUES <+ ,QQUES 1>>>)>
  1119. <CRLF>
  1120. <CRLF>
  1121. <SET FROB
  1122. <PQSCORE <NTH .QUES ,QSCORE> <NTH .QUES ,QVAL>>>
  1123. <CRLF>
  1124. <PRINC "------">)
  1125. (<SET FROB <GETQSCORE <NTH .QUES ,QSCORE>>>)>
  1126. <SET PL <+ .PL <1 .FROB>>>
  1127. <SET PS <+ .PS <2 .FROB>>>
  1128. <SET MX <+ .MX <* <NTH .QUES ,QVAL> <1 .FROB>>>>>
  1129. .SYML>
  1130. <AND <NOT <LENGTH? .SYML 1>>
  1131. <CRLF>
  1132. <PRINC "
  1133. Total for all questions...">
  1134. <CRLF>>
  1135. <OR <AND <LENGTH? .SYML 1> <OR .PRINT? .VERBOSE?>>
  1136. <PQSCORE 0 0 <VECTOR .PL .PS> .MX>>)>>
  1137. <DEFINE PSCORES ("AUX" SYMV)
  1138. #DECL ((SYMV) <OR FALSE VECTOR>)
  1139. <SET-STATUS ,$SPSCORE>
  1140. <COND (<SET SYMV
  1141. <READARGS <P-SYMS> "for" '["" ""] '["SYM" "MULT"]>>
  1142. <MAPF <>
  1143. <FUNCTION (X)
  1144. #DECL ((X) SYMBOL)
  1145. <PRINC "
  1146. Score for ">
  1147. <PRINC <1 .X>>
  1148. <INDENT-TO 19>
  1149. <PRINC
  1150. "Points Possible Average Questions">
  1151. <CRLF>
  1152. <PSCORE <1 .X>>>
  1153. <1 .SYMV>>)>>
  1154. <DEFINE GETBUF (bprompt "OPTIONAL" qprompt SPROMPT "AUX" BUF)
  1155. #DECL ((qprompt bprompt) <SPECIAL STRING> (SPROMPT) <OR FALSE STRING>
  1156. (BUF) <SPECIAL BUFFER>)
  1157. <TERPRI>
  1158. <SET BUF <BUFMAKE 20>>
  1159. <AND <ASSIGNED? SPROMPT>
  1160. .SPROMPT
  1161. <ADDSTRING .BUF .SPROMPT>>
  1162. <REPEAT ()
  1163. <COND (,VERBOSE <GETSTR .BUF .CHRTABLE .bprompt " (BUFFER):">)
  1164. (<GETSTR .BUF .CHRTABLE .bprompt>)>
  1165. <COND (,BUFSAFE <AND <CONFIRM> <RETURN>>) (<RETURN>)>>
  1166. <ACOPY ,TVSPACE2 <BUFTOS .BUF>>>
  1167. <DEFINE CONFIRM ()
  1168. <PRINC "[confirm]">
  1169. <AND <RESET ,INCHAN> <==? <TYI> <ASCII 27>>>>
  1170. <DEFINE PLAY-BALL ("AUX" (TWORD <DATA-READW ,TVASS <+ ,LUBLK ,TAILOR>>))
  1171. #DECL ((TWORD) WORD)
  1172. <AND <==? .TWORD #WORD *000000000000*>
  1173. <DATA-PRINTW ,TVASS <+ ,LUBLK ,TAILOR> ,T-DEF>
  1174. <SET TWORD ,T-DEF>>
  1175. <SETG SEQUENCE <GETBITS .TWORD <BITS 27 0>>>
  1176. <MAPF <>
  1177. <FUNCTION (BT SW)
  1178. #DECL ((BT) BITS (SW) ATOM)
  1179. <COND (<==? <GETBITS .TWORD .BT> #WORD *000000000000*>
  1180. <SETG .SW <>>)
  1181. (<SETG .SW T>)>>
  1182. ,BIT-TABLE
  1183. ,SWITCH-TABLE>
  1184. <COND (<0? <SETG TELEC-INTERVAL
  1185. <CHTYPE <GETBITS .TWORD ,TCON-BITS> FIX>>>)
  1186. (<TELECON ,TELEC-INTERVAL>)>
  1187. <MAPF <>
  1188. <FUNCTION (BT)
  1189. #DECL ((BT) BITS)
  1190. <COND (<0? <SET COD <CHTYPE <GETBITS .TWORD .BT> FIX>>>
  1191. <MAPLEAVE T>)
  1192. (<PRINC <NTH ,FROB-NAMES .COD>>
  1193. <EVAL <NTH ,FROBS .COD>>)>>
  1194. ,SEQ-BITS>
  1195. <COMMAND>>
  1196. <SETG SWITCH-TABLE
  1197. '[VERBOSE
  1198. ALWAYS-ANSWER
  1199. PNEWMAIL
  1200. IGNORE-SIMPLE
  1201. KEEPASKING
  1202. BUFSAFE]>
  1203. <SETG BIT-TABLE
  1204. '[#BITS *430100000000*
  1205. #BITS *420100000000*
  1206. #BITS *410100000000*
  1207. #BITS *400100000000*
  1208. #BITS *370100000000*
  1209. #BITS *360100000000*]>
  1210. <SETG TCON-BITS <BITS 6 0>>
  1211. <MANIFEST TCON-BITS>
  1212. <DEFINE SAVE-TAILOR ("AUX" (SEQ ,SEQUENCE))
  1213. #DECL ((SEQ) WORD)
  1214. <MAPF <>
  1215. <FUNCTION (BT SW)
  1216. #DECL ((BT) BITS (SW) ATOM)
  1217. <SET SEQ <PUTBITS .SEQ .BT <COND (,.SW 1) (0)>>>>
  1218. ,BIT-TABLE
  1219. ,SWITCH-TABLE>
  1220. <SET SEQ
  1221. <PUTBITS .SEQ
  1222. ,TCON-BITS
  1223. <COND (<G? ,TELEC-INTERVAL 60> 60) (T ,TELEC-INTERVAL)>>>
  1224. <DATA-PRINTW ,TVASS <+ ,LUBLK ,TAILOR> .SEQ>>
  1225. <DEFINE GET-SEQUENCE ("AUX" SEQ (S #WORD *000000000000*))
  1226. #DECL ((SEQ) <OR FALSE <VECTOR LIST>> (S) WORD)
  1227. <COND (<SET SEQ
  1228. <READARGS ,SEQ-SYMS "will be" '["" ""] '["SYM" "MULT"]>>
  1229. <MAPF <>
  1230. <FUNCTION (BT SYM)
  1231. #DECL ((BT) BITS (SYM) <PRIMTYPE VECTOR>)
  1232. <SET S <PUTBITS .S .BT <2 .SYM>>>>
  1233. ,SEQ-BITS
  1234. <1 .SEQ>>
  1235. <SETG SEQUENCE .S>)>>
  1236. <SETG SEQ-SYMS
  1237. <MAKESST "SS"
  1238. ["Make"
  1239. 1
  1240. "Answer"
  1241. 2
  1242. "Grade"
  1243. 3
  1244. "Read.mail"
  1245. 4
  1246. "Babble"
  1247. 5
  1248. "Print.score"
  1249. 6
  1250. "Status.of.question"
  1251. 7]>>
  1252. <DEFINE SET-STATUS (CODE "OPTIONAL" (FROB 0) "AUX" (PG ,PG) (TU ,TUV))
  1253. #DECL ((PG CODE FROB) FIX (TU) <UVECTOR [4 FIX]>)
  1254. <COND (<GASSIGNED? TINDEX>
  1255. <PUT-LOC <+ ,PEEK-START .PG ,TINDEX>
  1256. <PUT .TU 4 <PUTBITS .FROB <BITS 18 18> .CODE>>>)>>
  1257. <SETG PWINNERS ("MARC " "TAA " "JMB ")>
  1258. <SETG PTTUV <IUVECTOR 1 0>>
  1259. <GDECL (PTTUV) <UVECTOR FIX>>
  1260. <DEFINE TVPEEK ("AUX" (FIRST <>) (PG ,PG) (UV ,FOOUV) FROB CODE NAME
  1261. (PWINNERS ,PWINNERS) (PTTUV ,PTTUV))
  1262. #DECL ((FIRST) <OR 'T FALSE> (PG FROB CODE) FIX (UV) <UVECTOR [4 FIX]>
  1263. (NAME) STRING (PWINNERS) <LIST [REST STRING]> (PTTUV) <UVECTOR FIX>)
  1264. <SET-STATUS ,$SPEEK>
  1265. <REPEAT ((N 0) (LOC <+ .PG ,PEEK-START>) M)
  1266. #DECL ((N LOC) FIX (M) <OR FALSE VECTOR>)
  1267. <COND
  1268. (<G? .N 83> <RETURN>)
  1269. (<AND <GET-LOC .LOC .UV> <0? <1 .UV>>>
  1270. <OR .FIRST
  1271. <PRINC "
  1272. Player Status Entered">>
  1273. <SET FIRST T>
  1274. <CRLF>
  1275. <COND (<0? <2 .UV>>
  1276. <PRINC "HACKER Password">
  1277. <INDENT-TO 27>
  1278. <PDSKDATE <DSKDATE>>)
  1279. (<PRINC <SET NAME <SIXTOS <2 .UV>>>>
  1280. <COND (<MEMBER .NAME .PWINNERS> <PRINC " *">)
  1281. (T <PRINC " ">)>
  1282. <OR <0? <1 <GET-LOC <+ .LOC 338> .PTTUV>>> <PRINC " T">>
  1283. <INDENT-TO 12>
  1284. <COND (<SET M
  1285. <MEMQ <CHTYPE <GETBITS <4 .UV> <BITS 18 18>> FIX>
  1286. ,STATUS-VECTOR>>
  1287. <PRINC <2 .M>>)
  1288. (<PRINC "??">)>
  1289. <INDENT-TO 21>
  1290. <COND (<MEMQ <SET CODE
  1291. <CHTYPE <GETBITS <4 .UV> <BITS 18 18>> FIX>>
  1292. '(9 1)>
  1293. <COND (<0? <SET FROB
  1294. <CHTYPE <GETBITS <4 .UV> <BITS 18>> FIX>>>)
  1295. (<PRINC "#"> <PRIN1 .FROB>)>)
  1296. (<==? .CODE ,$SMAKE>
  1297. <COND (<0? <SET FROB
  1298. <CHTYPE <GETBITS <4 .UV> <BITS 18>> FIX>>>)
  1299. (<PRINC <NTH ,MAKETYPES .FROB>>)>)>
  1300. <INDENT-TO 28>
  1301. <PDSKDATE <CHTYPE <3 .UV> WORD>>)>)>
  1302. <SET N <+ .N 1>>
  1303. <SET LOC <+ .LOC 4>>>
  1304. <CRLF>>
  1305. <SETG TOBRKS " ,
  1306. ">
  1307. <DEFINE BUFLEX (S "OPTIONAL" (BRKS ,TOBRKS) "AUX" (LL ("")) (L .LL) (S1 .S))
  1308. #DECL ((S S1 BRKS) STRING (VALUE LL L) <LIST [REST STRING]>)
  1309. <REPEAT ()
  1310. <COND (<OR <EMPTY? .S1> <MEMQ <1 .S1> .BRKS>>
  1311. <AND <N==? .S .S1>
  1312. <PUTREST .L
  1313. <SET L
  1314. (<SUBSTRUC
  1315. .S
  1316. 0
  1317. <- <LENGTH .S> <LENGTH .S1>>>)>>>
  1318. <AND <EMPTY? .S1> <RETURN <REST .LL>>>
  1319. <SET S <REST .S1>>)>
  1320. <SET S1 <REST .S1>>>>
  1321. <SETG MAKETYPES
  1322. ["ZORK!" "Long" "Match" "M.C." "T/F" "ZORK!" "Simple"]>
  1323. ;"POINTER TO START OF USER BLOCK FOR USER FOO
  1324. SETG'S FOO TO THAT FIX"
  1325. <DEFINE UBLOCK (STR "OPTIONAL" (L ,LOSSTABLE) M)
  1326. #DECL ((STR) STRING (L) LIST (M) <OR LIST FALSE>)
  1327. <COND (<GASSIGNED? <PARSE .STR>> ,<PARSE .STR>)
  1328. (<SET M <MEMBER .STR .L>> <SETG <PARSE .STR> <3 .M>>)>>
  1329. <DEFINE PLAY ("OPTIONAL" (PLAYER <>) "AUX" FOO TINDEX LUBLK)
  1330. #DECL ((PLAYER) <OR STRING FALSE> (FOO) <OR FALSE FIX>)
  1331. <COND (<MEMBER <XUNAME> ,WINNERS>
  1332. <COND (<NOT .PLAYER>
  1333. <SET PLAYER <READER '[] "as " "" '["LINE"] <>>>)>
  1334. <COND (<SET FOO <UBLOCK .PLAYER>>
  1335. <SET TINDEX <* 4 <4 <MEMBER .PLAYER ,LOSSTABLE>>>>
  1336. <COND (<DHLOCK <+ .TINDEX ,PEEK-START ,PG>>
  1337. <DUNLOCK <+ ,TINDEX ,PEEK-START ,PG>>
  1338. <SETG TINDEX .TINDEX>
  1339. <SETG LUBLK .FOO>
  1340. <SETG PLAYER .PLAYER>
  1341. <PUT ,TUV 2 <CHTYPE <STRTOX .PLAYER> FIX>>
  1342. .PLAYER)
  1343. (T <PRINC "Already playing">)>)
  1344. (T <PRINC "You blew it, champ.">)>)>>
  1345. <SETG INDEX
  1346. %<FIXUP!-RSUBRS '[
  1347. #CODE ![23751557122 23085678677 25614352384 4793303046 17188483073 23085698016
  1348. 4980738 2 6302928656 0 262146!]
  1349. INDEX
  1350. #DECL ("VALUE" FIX)]
  1351. '(53
  1352. FINIS!-MUDDLE
  1353. 229461
  1354. (2)
  1355. $TLOSE!-MUDDLE
  1356. 225280
  1357. (5)
  1358. MPOPJ!-MUDDLE
  1359. 248800
  1360. (6))>>
  1361. <AND <ASSIGNED? GLUE>
  1362. .GLUE
  1363. <PUT ,INDEX GLUE '![17448304640 2!]>>