%EXTERNALROUTINE geac %alias "C#geac"(%STRING (255) s) %externalstring %fn %spec date %alias "S#date" %externalstring %fn %spec itos %alias "S#itos" (%integer a) %externalstringfnspec substring %alias "S#substring" %c (%string (*) %name s, %integer i,j) %EXTERNALROUTINESPEC prompt %ALIAS "S#PROMPT"(%STRING (255) s) %externalroutinespec EMAS3CONNECT %c (%stringname file, %integername mode, hole, prot, conad, %c type, start, end, flag) %ROUTINE define(%STRING (255) s) %EXTERNALROUTINESPEC emas3(%STRINGNAME command,params, %INTEGERNAME flag) %INTEGER flag emas3("DEFINE",s,flag) %END; ! Of %ROUTINE define. %INTEGER i,j,k,max %owninteger seed = 64643 %ownstring (120) %array item(0:300) %integer %fn random(%integer size) %external %real %fn %spec random(%integer %name seed, %integer mode) %real r %integer j, value %const %integer max=500; !set to the no of items r = random(seed, 1) value = int(r*size) %result = value %end %routine readstring(%stringname s) %integer i, j s = "" %cycle readsymbol(i) %exit %if i = '*' s = s.tostring(i) %unless s = "" %and i = nl %repeat {includes nl's} %end %string (255) %fn extract(%stringname s) %string (255) t %integer i, j, n n = length(s) %result = "" %if n <= 1; {nl on end} t = "" %cycle i = 1, 1, n j = charno(s, i) %if j = nl %then %exit t = t. tostring(j) %repeat s = substring(s, i+1, n) %result = t %end %routine output(%string (255) s) %integer i, j, k, think %string (255) t t = "" %cycle t = extract(s) %exit %if t = "" think = 2+random(6) write(think,0); newline printstring(t." TURN\ ") %repeat %end %routine script(%integer n) %integer i, j, k %string (25) name %if n < 10 %then name = "geac0" %else name = "geac" name = name.itos(n) define("2,".name) printstring("writing: ".name." ") select output(2) printstring("& egin\ 3 TURN\ 3 1 TURN\ ") %cycle i = 1, 1, 300 k = random(max) output(item(k)) %repeat printstring("END xxx ") select output(0) closestream(2) %end define("1,geacscr") select input(1) %cycle i = 1, 1, 300 readstring(item(i)) %exit %if item(i) = "" %repeat max = i-1 %cycle i = 1, 1, 48 script(i) %repeat %end %endoffile