home *** CD-ROM | disk | FTP | other *** search
Wrap
' AI~WHEEL.BAS Academic Shareware Version 1.1 PRESS F5 TO START ' UNIVERSAL ROBOTIC BRAIN CELL ' by David Albert Harrell ' Copyright 1996 - All Rights Reserved. ' Educational non-profit non-government individuals may use this software ' for a 30 day evaluation period only, after which time users must register. ' Profit oriented and/or government entities may NOT utilize any portion ' or version of AI~WHEEL without written permission from David Albert Harrell. retrogdupnn = 0: supcnd = 1: forceobjkeypp = 0: recvalonly = -50: matchallbyprod = 0: appearnowonly = 0: appearnow = 1: evrechardlimit = 500: incondtot = 10: outcondtot = 10: inparthardlimit = 20: outparthardlimit = 11: lawshardlimit = 30: maxminmute = 8888: rndrndon = 1: rndrndstop = 350: rndwithevnum = 1: rndtop = 100: numneedon = 1: rndsimnnrate = 66: linkalways = 1: simselon = 1: linktrys = 25: likelinks = 1: fulpartrnd = 0: bailaftval = 0: useppout = 0: dominaterndflag = 1: dominaterndrate = 25: bailaftmmordisapr = 0: actmaxlimit = 100: settlefor = .1: nodefaultflag = 1: tttflag = 0: rndrate = 25: calcpospponly = 2: calcnnppalso = 1: usevalppflag = 1: compglobalppflag = 1: simnnon = 1: beginpp = 2: boxstall = 1: noduprecs = 0: fleecode = 969696: disapearcode = 868686: icc = 987654 jj = 13: kk = 20: acnum = 1: nt$ = "MBL20": ot = 1: jauger = 41: back = 6: box = 9: rrr = 1: ccc = 51: flash = 14: flashback = 4: black = 0: blue = 1: green = 2: cyan = 3: red = 4: mag = 5: brown = 6: white = 7: gray = 8: lblue = 9: lgreen = 10: lcyan = 11: lred = 12: lmag = 13: yel = 14: whiteh = 15: backg = white: foreg = gray GOSUB menusub3 REDIM condlinkfinal(incondtot) REDIM conlink(incondtot, outcondtot) DIM incondfreq(incondtot, inparthardlimit) DIM incondgift(incondtot, inparthardlimit) DIM incondord(incondtot, inparthardlimit) REDIM befincondtext$(incondtot) REDIM befoutcondtext$(outcondtot) REDIM aftincondtext$(incondtot) REDIM aftoutcondtext$(outcondtot) REDIM inconddiscribe$(incondtot) REDIM outconddiscribe$(outcondtot) DIM currin(incondtot) DIM currout(outcondtot) DIM actname$(outcondtot, outparthardlimit) DIM objname$(incondtot, inparthardlimit) DIM actenrgused(outcondtot, outparthardlimit) REDIM inpartspectrumtot(incondtot) REDIM outpartspectrumtot(outcondtot) REDIM rrin(incondtot, lawshardlimit) REDIM rrout(outcondtot, lawshardlimit) REDIM valaug(lawshardlimit) REDIM mmgrant(lawshardlimit) REDIM mmkey(lawshardlimit) REDIM ippnt(incondtot) REDIM pinstk(incondtot) REDIM oppnt(outcondtot) REDIM poutstk(outcondtot) REDIM inhistory(incondtot, evrechardlimit) REDIM outhistory(outcondtot, evrechardlimit) DIM byprod(incondtot, evrechardlimit) DIM convcost(evrechardlimit) DIM numneed(evrechardlimit) DIM prodval(evrechardlimit) DIM goalval(evrechardlimit) DIM czf(evrechardlimit) REDIM ramu(incondtot) REDIM findTHISbyprodall(incondtot) wh = incondtot IF outcondtot > wh THEN wh = outcondtot wl = inparthardlimit IF outparthardlimit > wh THEN wh = outparthardlimit DIM spr(wh, wl) RANDOMIZE TIMER GOSUB openmenu IF userflagx = 1 THEN 1199 IF userflag = 0 THEN 1199 GOSUB useru: CLOSE 1199 SCREEN 0: CLS GOSUB defaultpp: CLS GOSUB drawcirt 7011 IF aflag = 1 THEN 7777 GOSUB sig IF tttflag = 1 THEN acnum = 2: actmax = 9 GOSUB setusercondbypass FOR hfs = 1 TO incondtot ramu(hfs) = currin(hfs) NEXT hfs ' *************** begin MAIN LINE ************** 7777 GOSUB prntclean IF rndwithevnum = 1 THEN rndtop = histeventnum COLOR flash, flashback: GOSUB box1 7659 manpicked = 0 118 GOSUB setusercond IF rndrndon = 1 AND histeventnum < rndrndstop THEN GOSUB rndrnd IF tttflag = 1 THEN GOSUB tttdispl FOR c = 1 TO 10 choice$ = INKEY$ IF choice$ = "z" THEN intrmflag = 1: GOTO 8422 IF choice$ = "p" THEN crretflag = 1 IF choice$ = "t" THEN GOSUB toglrnd LOCATE 5, 58 IF toglrf = 1 THEN COLOR lred, blue: PRINT "Perform" IF toglrf = 0 THEN COLOR yel, blue: PRINT "Explore" NEXT c COLOR flash, flashback: GOSUB box2 7172 tryedsofar = 0: moveobflag = 0 disapflag = 0: newrecflag = 0: crazyflag = 0: keyx = 0: goalvalhold = 0 IF sugoflag = 1 THEN 4680 FOR qaz = 1 TO outcondtot currout(qaz) = 1 NEXT qaz IF nodefaultflag = 1 THEN GOSUB randaction IF likelinks = 1 THEN GOSUB sugglink winval = -3050: winact = 0: tryedsofar = 0: freshmade = 0: freshmadex = 0 evcnt = evcnt + 1 COLOR 6, 0: LOCATE 10, 70: PRINT evcnt: LOCATE 14, 35: PRINT actmax REDIM outstacker(outcondtot, actmax) ' begin an event COLOR flash, flashback: GOSUB box3 COLOR flash, flashback: GOSUB box4 FOR iew = 1 TO histeventnum FOR hfs = 1 TO incondtot IF NOT inhistory(hfs, iew) = currin(hfs) THEN 3527 NEXT hfs GOTO 3528 3527 NEXT iew IF tryedsofar = actmax THEN 2906 COLOR flash, flashback: GOSUB box6 2906 'all rec have been looked at, best are loaded IF tryedsofar < actmax THEN 4560 GOTO 4561 ' skip rnd 3528 IF outhistory(1, iew) = 0 THEN PRINT " ev rec with a zero win act? ": intrmflag = 1: GOTO 8422 FOR wer = 1 TO actmax: ' grab bestscore and act; ' winval may be either goal val or prod VAL IF goalval(iew) + convcost(iew) > winval THEN winval = goalval(iew) + convcost(iew): winact = outhistory(acnum, iew): FOR hfs = 1 TO outcondtot: currout(hfs) = outhistory(hfs, iew): NEXT hfs IF prodval(iew) < settlefor THEN 1171 IF prodval(iew) > winval THEN winval = prodval(iew): winact = outhistory(acnum, iew): FOR hfs = 1 TO outcondtot: currout(hfs) = outhistory(hfs, iew): NEXT hfs 1171 FOR hfs = 1 TO outcondtot IF NOT outhistory(hfs, iew) = outstacker(hfs, wer) THEN 6527 NEXT hfs GOTO 3527 6527 IF outstacker(1, wer) = 0 THEN tryedsofar = tryedsofar + 1: FOR hfs = 1 TO outcondtot: outstacker(hfs, wer) = outhistory(hfs, iew): NEXT hfs: GOTO 3527 ' a new currout(1) is stacked NEXT wer LOCATE 6, 71: PRINT "rec outstack limit err"; actmax; acnum; wer: STOP ' rnd constrant to provoke mutations 4560 IF winval > settlefor AND tryedsofar < actmax AND FIX(RND * rndtop) + 1 < rndrate + 1 THEN crazyflag = 9999: czf(histeventnum) = crazyflag: LOCATE 7, 59: COLOR red, blue: PRINT "║║║║": LOCATE 9, 59: COLOR red, blue: PRINT "║║║║": GOTO 4481 IF winval > settlefor THEN 4679 4569 IF outstacker(1, actmax) > 0 THEN 4561 ' all tried back in line dom b4 imp IF simselon = 1 THEN GOSUB simsel GOSUB prntrnswchs IF currout(1) > 0 THEN GOSUB checkifnew IF simnnon = 0 THEN 2799 IF rndsimnnrate > FIX(RND * rndtop) + 1 THEN LOCATE 7, 59: COLOR 14, blue: PRINT "║║║║": LOCATE 9, 59: PRINT "║║║║": GOSUB simnn: GOTO 2722 IF winner = 0 OR currout(1) = 0 OR currout(1) = 9999 THEN GOSUB simnn ' rare gosub 2722 IF currout(1) > 0 THEN GOSUB checkifnew 2799 IF currout(1) = 0 THEN 4481 IF currout(1) < 9999 THEN 4561 4481 linktrycnt = 0: GOSUB randaction COLOR flash, flashback: GOSUB box9 IF linktrycnt < linktrys THEN GOSUB sugglink: GOSUB checkifnew COLOR flash, flashback: GOSUB box10 IF currout(1) = 9999 AND tryedsofar < actmax THEN 4481 ' fallthru top of all poss or untried 4561 'begin selecting numneed to produce experimental creations without proven or known val of any kind COLOR flash, flashback: GOSUB box5 IF numneedon = 0 THEN 4679 FOR fdr = 1 TO histeventnum FOR hfs = 1 TO incondtot IF NOT inhistory(hfs, fdr) = currin(hfs) THEN 4527 ' iew should fdr NEXT hfs IF numneed(fdr) < 1 THEN 4527 FOR irm = 1 TO outcondtot currout(irm) = outhistory(irm, fdr) NEXT irm GOTO 4679 4527 NEXT fdr 4679 IF sugoflag = 1 OR dominaterndflag = 0 THEN 4680 GOSUB domnrnd 4680 COLOR flash, flashback: GOSUB box11 IF linkalways = 1 THEN GOSUB sugglink IF tttflag = 1 THEN GOSUB placettt: GOSUB tttdispl '****** INTERFACE TERMINAL # 2 _ Shapers - OUT actions ****** GOSUB revalu 'IF condbyprodflag = 1 THEN GOSUB condbyprodset 1042 FOR exx = 1 TO histeventnum ' ck for an exsiting rec FOR hfs = 1 TO outcondtot IF NOT outhistory(hfs, exx) = currout(hfs) THEN 9527 NEXT hfs FOR hfs = 1 TO incondtot IF NOT inhistory(hfs, exx) = currin(hfs) THEN 9527 NEXT hfs GOTO 4409 9527 NEXT exx newrecflag = 1 GOTO 4544 4409 newrecflag = 0 ' skip make new rec and numneed 4544 'new act and rec ' below to stop record rec but cont to react, next dream! IF histeventnum > evrechardlimit - 2 THEN 4546 histeventnum = histeventnum + 1 4546 GOSUB cleanrec FOR hfs = 1 TO incondtot inhistory(hfs, histeventnum) = currin(hfs) NEXT hfs IF currout(1) = 0 THEN PRINT " currout zero? ": STOP FOR hfs = 1 TO outcondtot outhistory(hfs, histeventnum) = currout(hfs) NEXT hfs convcost(histeventnum) = enrgused goalval(histeventnum) = goalvalhold eventgrade2 = goalvalhold + enrgused IF NOT eventgrade2 = eventgrade THEN STOP COLOR flash, flashback: GOSUB box12 IF freshmadex = disapearcode OR freshmadex = fleecode THEN 8789 IF freshmade = 0 THEN GOTO 8789 incondgift(objkey, freshmade) = incondgift(objkey, freshmade) + 1 IF numneedon = 1 THEN numneed(histeventnum) = numneed(histeventnum) - 1 ' on top of below if no mm is 0 fm, below if fm is rec same as inconds FOR hfs = 1 TO incondtot byprod(hfs, histeventnum) = ramu(hfs) NEXT hfs 'a new 1st creation of this obj 'main split here ' if falling thru then we have new OBJobj byprod(objkey, histeventnum) = freshmade IF freshmadex = disapearcode OR freshmadex = fleecode OR freshmadex = icc THEN 8789 IF numneedon = 1 THEN numneed(histeventnum) = actmax sfor = inhistory(objkey, histeventnum): hdam = actmax: IF numneedon = 0 THEN actmax = 0 IF retrogdupnn = 0 AND newrecflag = 0 THEN actmax = 0 ' activate this to prevent retro-grade of duplicate numneed 9625 FOR eew = 1 TO histeventnum - 1 IF sfor = byprod(objkey, eew) THEN numneed(eew) = numneed(eew) + actmax: sfor = inhistory(objkey, eew): GOTO 9625 NEXT eew actmax = hdam GOTO 4545 ' if numneed skips retgrade since prod not yet goal valuble 8789 'retrograde val to OBJobj chain FOR hfs = 1 TO incondtot findTHISbyprodall(hfs) = ramu(hfs) NEXT hfs 3311 findTHISbyprod = currin(objkey) 3312 FOR fbi = 1 TO histeventnum - 1 IF findTHISbyprod = icc THEN 4545 IF findTHISbyprod = byprod(objkey, fbi) THEN 3313 3310 NEXT fbi GOTO 4545 'fall thru is not a known byprod, exit retrograde 3313 IF matchallbyprod = 0 THEN 3314 FOR hfs = 1 TO incondtot IF NOT ramu(hfs) = byprod(hfs, fbi) THEN 3310 NEXT hfs 3314 IF valdifxx + convcost(fbi) > prodval(fbi) THEN prodval(fbi) = valdifxx + convcost(fbi) valdifxx = prodval(fbi) findTHISbyprod = inhistory(objkey, fbi) IF matchallbyprod = 0 THEN 3312 FOR hfs = 1 TO incondtot findTHISbyprodall(hfs) = inhistory(hfs, fbi) NEXT hfs findTHISbyprod = findTHISbyprodall(objkey) GOTO 3312 4545 ' end rec update IF crazyflag > 0 THEN czf(histeventnum) = crazyflag IF freshmadex > 0 THEN byprod(objkey, histeventnum) = freshmadex GOSUB prntcurr GOSUB dumpvals GOSUB getpartord GOSUB getpartordo IF histeventnum < 1 THEN 454 IF noduprecs = 1 THEN 455 452 IF newrecflag = 0 THEN 453 IF recvalonly = 0 THEN 454 IF goalvalhold < recvalonly THEN 454 IF goalvalhold > settlefor THEN 454 IF NOT freshmade = 0 THEN 454 453 histeventnum = histeventnum - 1 454 FOR hfs = 1 TO incondtot currin(hfs) = ramu(hfs) NEXT hfs IF suggflag = 0 AND crretflag = 0 THEN 63 DO: doj$ = INKEY$ IF doj$ = "a" THEN crretflag = 0: GOTO 63 LOOP UNTIL doj$ = CHR$(13) 63 sugoflag = 0: sugiflag = 0: suggflag = 0' add opt to keep 414 manpicked = 0: GOTO 7777 ' ***************** end mainline ********************* 455 FOR exx = 1 TO histeventnum - 1 FOR hfs = 1 TO outcondtot FOR coni = 1 TO incondtot ' add swch later? IF condlinkfinal(coni) = hfs THEN 526 NEXT coni IF NOT outhistory(hfs, exx) = currout(hfs) THEN 527 526 NEXT hfs LOCATE 10, 1: PRINT goalval(exx); goalvalhold; currin(objkey); inhistory(objkey, exx); freshmade; byprod(objkey, exx) IF convcost(exx) = enrgused AND goalval(exx) = goalvalhold AND currin(objkey) = inhistory(objkey, exx) AND freshmade = byprod(objkey, exx) THEN 453 IF convcost(exx) = enrgused AND goalval(exx) = goalvalhold AND currin(objkey) = inhistory(objkey, exx) AND freshmadex = byprod(objkey, exx) THEN 453 527 NEXT exx GOTO 452 simsel: IF sugoflag = 1 THEN RETURN IF histeventnum < 1 THEN RETURN COLOR flash, flashback: GOSUB box7 IF goalvalflag = 0 AND prodvalflag = 0 AND byprodflag = 0 THEN 316 315 FOR uhb = 1 TO incondtot srchE(uhb) = currin(uhb) NEXT uhb REDIM t2(2, histeventnum + 1) bestyet = -99999: winner = 0: newlimit = histeventnum: stackcnt = 1: b1st = 1: b2nd = 2: cellcnt = 1 FOR ehd = 1 TO histeventnum: t2(b1st, ehd) = ehd: NEXT ehd FOR cellcnt = 1 TO incondtot FOR cy2 = 1 TO newlimit ' sel either goalval or prodval as greater IF condlinkfinal(cellcnt) > 0 AND linkalways = 1 THEN GOTO 26 IF goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > prodval((t2(b1st, cy2))) AND inhistory((pinstk(cellcnt)), (t2(b1st, cy2))) = srchE(pinstk(cellcnt)) AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > settlefor AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > bestyet THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): bestyet = goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))): vflag = 1: GOTO 2388 IF goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) = prodval((t2(b1st, cy2))) AND inhistory((pinstk(cellcnt)), (t2(b1st, cy2))) = srchE(pinstk(cellcnt)) AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > settlefor AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > bestyet THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): bestyet = goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))): vflag = 1 IF prodval((t2(b1st, cy2))) > goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) AND inhistory((pinstk(cellcnt)), (t2(b1st, cy2))) = srchE(pinstk(cellcnt)) AND prodval((t2(b1st, cy2))) > settlefor AND prodval((t2(b1st, cy2))) > bestyet THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): bestyet = prodval((t2(b1st, cy2))): vflag = 1 2388 NEXT cy2 3444 IF vflag = 0 THEN 3556 IF b1st = 1 THEN b1st = 2: b2nd = 1: GOTO 6036 b1st = 1: b2st = 2 6036 newlimit = stackcnt stackcnt = 1: vflag = 0 3556 NEXT cellcnt IF winner = 0 THEN RETURN COLOR flash, flashback: GOSUB box8 FOR wsx = 1 TO outcondtot currout(wsx) = outhistory(wsx, winner) NEXT wsx COLOR green, 0: LOCATE 3, 1: PRINT winner; " "; FOR yt = 1 TO incondtot PRINT inhistory(yt, winner); NEXT yt PRINT " "; FOR yt = 1 TO outcondtot PRINT outhistory(yt, winner); NEXT yt PRINT " " COLOR yel, 0: LOCATE 4, 1: PRINT cy1; cy2; " "; goalval(winner); prodval(winner); numneed(winner); " "; convcost(winner); byprod(objkey, winner) 316 RETURN 26 IF goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > prodval((t2(b1st, cy2))) AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > settlefor AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > bestyet THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): bestyet = goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))): vflag = 1: GOTO 2388 IF goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) = prodval((t2(b1st, cy2))) AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > settlefor AND goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) > bestyet THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): bestyet = goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))): vflag = 1 IF prodval((t2(b1st, cy2))) > goalval((t2(b1st, cy2))) + convcost((t2(b1st, cy2))) AND prodval((t2(b1st, cy2))) > settlefor AND prodval((t2(b1st, cy2))) > bestyet THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): bestyet = prodval((t2(b1st, cy2))): vflag = 1 GOTO 2388 simnn: IF numneedon = 0 OR sugoflag = 1 THEN RETURN IF histeventnum < 1 THEN RETURN COLOR flash, flashback: GOSUB box7 IF prodvalflag = 0 AND byprodflag = 0 THEN 716 FOR uhb = 1 TO incondtot srchE(uhb) = currin(uhb) NEXT uhb REDIM t2(2, histeventnum + 1) bestyet = -8844: winner = 0 newlimit = histeventnum: stackcnt = 1: b1st = 1: b2nd = 2: cellcnt = 1 FOR ehd = 1 TO histeventnum: t2(b1st, ehd) = ehd: NEXT ehd FOR cellcnt = 1 TO incondtot FOR cy2 = 1 TO newlimit ' sel either goalval or prodval as greater IF inhistory(1, (t2(b1st, cy2))) = 0 THEN 5388 ' necc? IF condlinkfinal(cellcnt) > 0 AND linkalways = 1 THEN GOTO 36 IF inhistory((pinstk(cellcnt)), (t2(b1st, cy2))) = srchE(pinstk(cellcnt)) AND numneed((t2(b1st, cy2))) > 0 THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): vflag = 1: GOTO 5388 5388 NEXT cy2 5444 IF vflag = 0 THEN 7556 IF b1st = 1 THEN b1st = 2: b2nd = 1: GOTO 5036 b1st = 1: b2st = 2 5036 newlimit = stackcnt stackcnt = 1 vflag = 0 7556 NEXT cellcnt IF winner = 0 THEN RETURN COLOR flash, flashback: GOSUB box8 FOR uhb = 1 TO outcondtot currout(uhb) = outhistory(uhb, winner) NEXT uhb COLOR lmag, 0: LOCATE 5, 1 PRINT winner; " "; FOR yt = 1 TO incondtot PRINT inhistory(yt, winner); NEXT yt PRINT " "; FOR yt = 1 TO outcondtot PRINT outhistory(yt, winner); NEXT yt PRINT " " COLOR lblue, 0: LOCATE 6, 1: PRINT cy1; cy2; " "; goalval(winner); prodval(winner); numneed(winner); " "; convcost(winner); byprod(objkey, winner) 716 RETURN 36 IF numneed((t2(b1st, cy2))) > 0 THEN t2(b2nd, stackcnt) = t2(b1st, cy2): stackcnt = stackcnt + 1: winner = (t2(b1st, cy2)): vflag = 1: GOTO 5388 GOTO 5388 defaultpp: FOR ijn = 1 TO incondtot pinstk(ijn) = ijn NEXT ijn RETURN defaultppok: pinstk(1) = objkey RETURN getpartord: IF histeventnum < 3 THEN RETURN IF prodvalflag = 0 AND goalvalflag = 0 AND byprodflag = 0 THEN GOSUB defaultpp: GOTO 2037 IF compglobalppflag = 1 THEN 8404 REDIM ippnt(incondtot) 8404 FOR ii = 1 TO incondtot: rvr(ii) = ii: NEXT ii FOR rvcnt = 1 TO incondtot IF compglobalppflag = 1 THEN mse = histeventnum: GOTO 8405 FOR mse = 1 TO histeventnum 'grab a search record 8405 FOR foc = 1 TO histeventnum 'look at all else IF foc = mse THEN 117 IF calcnnppalso = 1 AND numneed(foc) > 0 THEN 127 IF calcpospponly = 1 AND prodval(foc) < 1 AND goalval(foc) + convcost(foc) < settlefor THEN 117 IF calcpospponly = 2 AND prodval(foc) < 1 AND goalval(foc) + convcost(foc) < 0 THEN 117 127 IF inhistory((rvr(1)), mse) = inhistory((rvr(1)), foc) THEN 117 FOR jgd = 2 TO incondtot IF NOT inhistory((rvr(jgd)), mse) = inhistory((rvr(jgd)), foc) OR NOT goalval(mse) + convcost(mse) = goalval(foc) + convcost(foc) OR NOT byprod(objkey, mse) = byprod(objkey, foc) THEN 117 ' NEXT foc NEXT jgd 'fall thru is an isomer particle of the search rec (mse) ippnt(rvr(1)) = ippnt(rvr(1)) + 1 117 NEXT foc IF compglobalppflag = 1 THEN 8406 NEXT mse 8406 FOR rx = 1 TO incondtot 'turn ip revolver rvr(rx) = rvr(rx) + 1: IF rvr(rx) > incondtot THEN rvr(rx) = 1 119 NEXT rx NEXT rvcnt FOR lll = 1 TO incondtot ippntdv(lll) = ippnt(lll) IF inpartspectrumtot(lll) = 0 THEN 16 ippntdv(lll) = ippntdv(lll) / inpartspectrumtot(lll) 16 winstkdv(lll) = winstk(lll) NEXT lll LOCATE 1, 1 FOR lat = 1 TO incondtot COLOR 0, green PRINT ippnt(lat); COLOR 0, white PRINT ippntdv(lat); COLOR 0, brown PRINT inpartspectrumtot(lat); NEXT lat FOR wee = 1 TO incondtot ' stack conditions in pri order ipbest = 999933: ipwin = 0 FOR ooy = 1 TO incondtot IF ippntdv(ooy) < ipbest THEN ipbest = ippntdv(ooy): ipwin = ooy NEXT ooy winstkdv(wee) = ipwin: ippntdv(ipwin) = 999933 NEXT wee 'fall thru with pripart in winstk(1)etc... IF usevalppflag = 0 THEN RETURN IF beginpp > histeventnum THEN RETURN FOR mmm = 1 TO incondtot pinstk(mmm) = winstkdv(mmm) NEXT mmm 2037 LOCATE 7, 1: COLOR lcyan, 0 PRINT " " LOCATE 7, 1: COLOR lcyan, 0 FOR wx = 1 TO incondtot PRINT pinstk(wx); NEXT wx IF ippnt(objkey) = 0 OR forceobjkeypp = 1 THEN GOSUB defaultppok RETURN defaultppo: FOR ijn = 1 TO outcondtot poutstk(ijn) = ijn NEXT ijn actkey = 1 poutstk(1) = actkey RETURN getpartordo: IF histeventnum < 3 THEN RETURN IF prodvalflag = 0 AND goalvalflag = 0 AND byprodflag = 0 THEN GOSUB defaultppo: GOTO 9037 IF compglobalppflag = 1 THEN 9404 REDIM oppnt(outcondtot) 9404 FOR ii = 1 TO outcondtot: rvr(ii) = ii: NEXT ii FOR rvcnt = 1 TO outcondtot IF compglobalppflag = 1 THEN mse = histeventnum: GOTO 9405 FOR mse = 1 TO histeventnum 'grab a search record 9405 FOR foc = 1 TO histeventnum 'look at all else IF foc = mse THEN 917 IF calcnnppalso = 1 AND numneed(foc) > 0 THEN 927 IF calcpospponly = 1 AND prodval(foc) < 1 AND goalval(foc) + convcost(foc) < settlefor THEN 917 IF calcpospponly = 2 AND prodval(foc) < 1 AND goalval(foc) + convcost(foc) < 0 THEN 917 927 IF outhistory((rvr(1)), mse) = outhistory((rvr(1)), foc) THEN 917 FOR jgd = 2 TO outcondtot IF NOT outhistory((rvr(jgd)), mse) = outhistory((rvr(jgd)), foc) OR NOT goalval(mse) = goalval(foc) OR NOT byprod(objkey, mse) = byprod(objkey, foc) THEN 917 ' NEXT foc NEXT jgd 'fall thru is an isomer particle of the search rec (mse) oppnt(rvr(1)) = oppnt(rvr(1)) + 1 917 NEXT foc IF compglobalppflag = 1 THEN 9406 NEXT mse 9406 FOR rx = 1 TO outcondtot 'turn ip revolver rvr(rx) = rvr(rx) + 1 IF rvr(rx) > outcondtot THEN rvr(rx) = 1 919 NEXT rx NEXT rvcnt FOR lll = 1 TO outcondtot oppntdv(lll) = oppnt(lll) IF outpartspectrumtot(lll) = 0 THEN 169 'in case corrupt file oppntdv(lll) = oppntdv(lll) / outpartspectrumtot(lll) 169 owinstkdv(lll) = owinstk(lll) NEXT lll LOCATE 11, 1 FOR lat = 1 TO outcondtot COLOR 4, green PRINT oppnt(lat); COLOR 4, white PRINT oppntdv(lat); COLOR 4, brown PRINT outpartspectrumtot(lat); NEXT lat FOR wee = 1 TO outcondtot ' stack conditions in pri order ipbest = 999933: ipwin = 0 FOR ooy = 1 TO outcondtot IF oppntdv(ooy) < ipbest THEN ipbest = oppntdv(ooy): ipwin = ooy NEXT ooy owinstkdv(wee) = ipwin: oppntdv(ipwin) = 999933 NEXT wee 'fall thru with pripart in owinstk(1)etc... IF usevalppflag = 0 THEN RETURN IF beginpp > histeventnum THEN RETURN FOR mmm = 1 TO outcondtot poutstk(mmm) = owinstkdv(mmm) NEXT mmm LOCATE 8, 1: COLOR lred, 0 9037 FOR wx = 1 TO outcondtot PRINT poutstk(wx); NEXT wx RETURN ttt: GOSUB tttset 96 hu = (INT(RND * 9) + 1) IF NOT t(hu) = 3 THEN 96 t(hu) = 2 FOR tts = 1 TO 9 currin(tts) = t(tts) NEXT tts RETURN setusercond: '****** INTERFACE TERMINAL # 1 _ Sensors - IN conditions ****** IF sugiflag = 1 THEN RETURN IF tttflag = 1 THEN GOSUB ttt: RETURN IF appearnowonly = 1 THEN RETURN setusercondbypass: FOR lkj = 1 TO incondtot currin(lkj) = FIX(RND * inpartspectrumtot(lkj)) + 1 NEXT lkj 307 currin(objkey) = INT(RND * inpartspectrumtot(objkey)) + 1 COLOR 6, 0: LOCATE 14, 1 PRINT currin(objkey); freshmade; incondgift(objkey, (currin(objkey))); inpartspectrumtot(objkey) IF incondgift(objkey, (currin(objkey))) < 1 THEN 307 IF appearnow = 1 AND NOT prodlink = 0 THEN currin(objkey) = prodlink prodlink = 0 807 RETURN randaction: IF sugoflag = 1 THEN RETURN FOR lkj = 1 TO outcondtot currout(lkj) = FIX(RND * outpartspectrumtot(lkj)) + 1 NEXT lkj RETURN useru: CLS : COLOR 4, black PRINT " Begin Universe creation sequence." PRINT " To answer a yes-or-no question, use... [cr] for yes. n for no." PRINT " " INPUT " Which is the main incoming condition in this universe"; objkey PRINT #1, 99766; objkey FOR condcnt = 1 TO incondtot + 1 PRINT #1, 99999 PRINT "" PRINT #1, condcnt FOR objccode = 1 TO inparthardlimit + 1 PRINT "" PRINT #1, 99222; objccode IF objccode > 1 THEN 6704 INPUT " Creators reference name for this IN condition field"; inconddiscribe$(condcnt) INPUT " Prefix for this field in the event read out"; befincondtext$(condcnt) INPUT " Suffix for this field in the event read out"; aftincondtext$(condcnt) WRITE #1, inconddiscribe$(condcnt), befincondtext$(condcnt), aftincondtext$(condcnt) 6704 PRINT " "; objccode - 1; "objects defined so far."; : INPUT " Create another object.."; anser$ PRINT "" IF anser$ = "n" THEN 7492 IF anser$ = "x" THEN objccode = objccode - 1 INPUT " Object name"; objname$(condcnt, objccode) IF NOT condcnt = objkey THEN 7431 473 IF condcnt = objkey THEN INPUT " How many of this object occur naturally in the opening universe"; incondgift(condcnt, objccode) IF condcnt = objkey THEN 7431 PRINT #1, incondfreq(condcnt, objccode); ' being skipped always 7431 WRITE #1, objname$(condcnt, objccode), spr(condcnt, objccode), spr(condcnt, objccode), spr(condcnt, objccode), incondgift(condcnt, objccode), incondord(condcnt, objccode) PRINT "" NEXT objccode 7492 inpartspectrumtot(condcnt) = objccode - 1 'added - 1 v1360 ??? PRINT " "; condcnt; "INconds defined so far."; : INPUT " Create another INcond.."; anser$ PRINT "" IF anser$ = "n" THEN 8431 IF anser$ = "z" THEN intrmflag = 1: GOTO 8422 IF anser$ = "x" THEN condcnt = condcnt - 1 NEXT condcnt 8431 CLS incondtot = condcnt PRINT #1, 99999 PRINT #1, 44444 qxflag = 1 GOSUB dumpuser qxflag = 0: CLS FOR condcnt = 1 TO outcondtot + 1 COLOR 2, black PRINT "" WRITE #1, 99755, condcnt FOR actccode = 1 TO outparthardlimit + 1 WRITE #1, 99744, actccode IF actccode > 1 THEN 2704 INPUT " Creators reference name for this OUT condition field"; outconddiscribe$(condcnt) INPUT " Prefix for this field in the event read out"; befoutcondtext$(condcnt) INPUT " Suffix for this field in the event read out"; aftoutcondtext$(condcnt) WRITE #1, outconddiscribe$(condcnt), befoutcondtext$(condcnt), aftoutcondtext$(condcnt) 2704 PRINT " "; actccode - 1; "actions defined so far."; : INPUT " Create another action.."; anser$ PRINT "" IF anser$ = "n" THEN 4431 IF anser$ = "x" THEN actccode = actccode - 1 INPUT " action name"; actname$(condcnt, actccode) IF NOT condcnt = 1 THEN 4418 ' act(1) will be like objkey soon 4418 INPUT " What is the Creator assigned value units cost of this action"; actenrgused(condcnt, actccode) WRITE #1, actname$(condcnt, actccode), spr(condcnt, actccode), spr(condcnt, actccode), spr(condcnt, actccode), actenrgused(condcnt, actccode) PRINT "" NEXT actccode 4431 outpartspectrumtot(condcnt) = actccode - 1 PRINT " "; condcnt; "OUTconds defined so far."; : INPUT " Create another OUTcond.."; anser$ PRINT "" IF anser$ = "n" THEN 1431 IF anser$ = "z" THEN intrmflag = 1: GOTO 8422 IF anser$ = "x" THEN condcnt = condcnt - 1 NEXT condcnt 1431 outcondtot = condcnt: CLS 6307 COLOR yel, 0 GOSUB dumpuser FOR rrec = 1 TO lawshardlimit + 1 WRITE #1, 3333, rrec PRINT " "; rrec - 1; "laws defined so far."; : INPUT " Create another law of universe.."; anser$ PRINT "" IF anser$ = "n" THEN 2431 3760 FOR tfc = 1 TO incondtot PRINT befincondtext$(tfc); aftincondtext$(tfc); inconddiscribe$(tfc) 3768 PRINT " Select object, l to link, or enter to include all objects in this law." INPUT " object"; hold$ IF hold$ = "" THEN rrin(tfc, rrec) = icc: GOTO 1768 IF hold$ = "l" THEN GOSUB assoconditionin: GOTO 1768 'link to opt FOR mbc = 1 TO inpartspectrumtot(tfc) IF hold$ = objname$(tfc, mbc) THEN holdc = mbc: GOTO 3762 NEXT mbc PRINT "Object not defined, spaces and cases must match.": GOTO 3768 3762 rrin(tfc, rrec) = holdc 1768 NEXT tfc 1760 FOR tfc = 1 TO outcondtot PRINT befoutcondtext$(tfc); aftoutcondtext$(tfc); outconddiscribe$(tfc) 1788 PRINT " Select action, l to link, or enter to include all actions in this law." INPUT " action "; hold$ IF hold$ = "" THEN rrout(tfc, rrec) = icc: GOTO 1766 IF hold$ = "l" THEN GOSUB assoconditionout: GOTO 1766 FOR mbc = 1 TO outpartspectrumtot(tfc) ' spectrunlimit (range) of the this cond IF hold$ = actname$(tfc, mbc) THEN holdc = mbc: GOTO 1762 NEXT mbc PRINT "Action not defined, spaces and cases must match.": GOTO 1788 1762 rrout(tfc, rrec) = holdc 1766 NEXT tfc 2944 INPUT " Value to this event"; valaug(rrec) ' 6760 h = 0: INPUT " Object created from this event; d to disappear, f to flee"; hold$ IF hold$ = "" THEN mmgrant(rrec) = 0: GOTO 6768 IF hold$ = "d" THEN mmgrant(rrec) = disapearcode: GOTO 6768 IF hold$ = "f" THEN mmgrant(rrec) = fleecode: GOTO 6768 9 IF matchallbyprod = 1 THEN INPUT " Condition number of metmo"; h IF h = 0 THEN 98 IF h < 1 OR h > incondtot THEN 9 objkey = h ' changes objkey until next non zero entry in h 98 FOR mbc = 1 TO inpartspectrumtot(objkey) IF hold$ = objname$(objkey, mbc) THEN holdc = mbc: GOTO 6762 NEXT mbc PRINT "Object not defined": GOTO 6760 6762 mmgrant(rrec) = holdc mmkey(rrec) = objkey PRINT "" 6768 WRITE #1, 8876, incondtot FOR xfc = 1 TO incondtot PRINT #1, rrin(xfc, rrec); NEXT xfc WRITE #1, 6876, outcondtot FOR xfc = 1 TO outcondtot PRINT #1, rrout(xfc, rrec); NEXT xfc WRITE #1, valaug(rrec), mmkey(rrec), mmgrant(rrec) NEXT rrec 2431 WRITE #1, 868699 GOSUB writeswch comandtot = rrec - 1 'ck last comand in?? CLOSE COLOR lmag, 0 GOSUB dumpuser GOSUB setactmax IF likelinks = 1 THEN GOSUB findlikelinks RETURN assoconditionin: INPUT "Associate this with which out cond"; rrin(tfc, rrec) rrin(tfc, rrec) = rrin(tfc, rrec) * -1 RETURN assoconditionout: INPUT "Associate this with which in cond"; rrout(tfc, rrec) rrout(tfc, rrec) = rrout(tfc, rrec) * -1 RETURN setactmax: keepw = 1 FOR okm = 1 TO outcondtot IF outpartspectrumtot(okm) = 0 THEN 2253 actmax = outpartspectrumtot(okm) * keepw: keepw = actmax 2253 NEXT okm IF actmax > actmaxlimit THEN actmax = actmaxlimit RETURN readfile: INPUT "Enter Filename: "; b$ readfilex: 2631 OPEN b$ FOR INPUT AS #1 267 INPUT #1, a IF a = 99766 THEN GOSUB setobjkey: GOTO 268 GOTO 267 getswch: INPUT #1, histeventnum, prodvalflag, goalvalflag, byprodflag, actmax, toglrf INPUT #1, dominaterndflag, bailaftmmordisapr, forcefieldlink, actmaxlimit, settlefor, evrechardlimit, incondtot, outcondtot, inparthardlimit, outparthardlimit, lawshardlimit, evcnt, nodefaultflag, tttflag, rndrate, calcpospponly, calcnnppalso, usevalppflag, compglobalppflag, simnnon, beginpp, boxstall, noduprecs, useppout, bailaftval, fulpartrnd, maxminmute, linktrys, likelinks, simselon, linkalways, dominaterndrate, rndsimnnrate, numneedon, comandtot, rndrndon, rndrndstop, rndwithevnum, rndtop, supcnd, forceobjkeypp, recvalonly, appearnowonly, appearnow, matchallbyprod, retrogdupnn RETURN 268 IF a = 99999 THEN GOSUB newincond IF a = 99222 THEN GOSUB newinpart IF a = 99755 THEN GOSUB newoutcond IF a = 99744 THEN GOSUB newoutpart IF a = 3333 THEN GOSUB newlaw IF a = 8876 THEN GOSUB inlaws IF a = 6876 THEN GOSUB outlaws IF a = 868699 THEN GOSUB getswch: CLOSE : GOTO 269 GOTO 268 269 comandtot = rrec GOSUB setactmax IF likelinks = 1 THEN GOSUB findlikelinks RETURN findlikelinks: FOR cono = 1 TO outcondtot FOR coni = 1 TO incondtot hldtot = 0 FOR prti = 1 TO inpartspectrumtot(coni) FOR prto = 1 TO outpartspectrumtot(cono) IF objname$(coni, prti) = actname$(cono, prto) THEN hldtot = hldtot + 1 NEXT prto NEXT prti conlink(coni, cono) = hldtot NEXT coni NEXT cono FOR coni = 1 TO incondtot FOR cono = 1 TO outcondtot NEXT cono NEXT coni FOR coni = 1 TO incondtot bestt = 0: winz = 0 FOR cono = 1 TO outcondtot IF conlink(coni, cono) > bestt THEN bestt = conlink(coni, cono): winz = cono NEXT cono condlinkfinal(coni) = winz NEXT coni FOR coni = 1 TO incondtot NEXT coni RETURN setobjkey: INPUT #1, objkey INPUT #1, a RETURN newincond: INPUT #1, b IF b = 99755 THEN 5902 IF b = 44444 THEN incondtot = condcnt - 1: GOTO 5901 condcnt = b 5901 INPUT #1, a 5902 RETURN newoutcond: INPUT #1, condcnt INPUT #1, a RETURN INPUT #1, a newinpart: INPUT #1, objccode IF objccode = 1 THEN INPUT #1, inconddiscribe$(condcnt), befincondtext$(condcnt), aftincondtext$(condcnt) INPUT #1, obn$ IF obn$ = "99999" THEN a = 99999: inpartspectrumtot(condcnt) = objccode - 1: GOTO 6204 INPUT #1, spr(condcnt, objccode), spr(condcnt, objccode), spr(condcnt, objccode), incondgift(condcnt, objccode), incondord(condcnt, objccode) objname$(condcnt, objccode) = obn$ INPUT #1, a 6204 RETURN newoutpart: INPUT #1, actccode IF actccode = 1 THEN INPUT #1, outconddiscribe$(condcnt), befoutcondtext$(condcnt), aftoutcondtext$(condcnt) INPUT #1, obn$ IF obn$ = "99755" THEN a = 99755: outpartspectrumtot(condcnt) = actccode - 1: GOTO 6207 IF obn$ = "3333" THEN a = 3333: outpartspectrumtot(condcnt) = actccode - 1: GOTO 6207 INPUT #1, spr(condcnt, actccode) INPUT #1, spr(condcnt, actccode) INPUT #1, spr(condcnt, actccode) INPUT #1, actenrgused(condcnt, actccode) actname$(condcnt, actccode) = obn$ INPUT #1, a 6207 RETURN newlaw: INPUT #1, rrec INPUT #1, a RETURN inlaws: INPUT #1, incondtot FOR xfc = 1 TO incondtot INPUT #1, rrin(xfc, rrec) NEXT xfc INPUT #1, a RETURN outlaws: INPUT #1, outcondtot FOR xfc = 1 TO outcondtot INPUT #1, rrout(xfc, rrec) NEXT xfc INPUT #1, valaug(rrec), mmkey(rrec), mmgrant(rrec) INPUT #1, a RETURN openmenu: 8422 COLOR lred, yel CLS COLOR dblue, yel PRINT "" PRINT " AI~WHEEL" COLOR dblue, yel PRINT " ----------- Main Menu -----------" COLOR white, yel PRINT " Create your own Universe .unv (c)" PRINT " Load Universe from Disk .unv (d)" PRINT " Load Intelligence from Disk .int (u)" PRINT " Save Intelligence to Disk .int (j)" PRINT " Print Universe to Disk .txt (t)" PRINT " Print History to file .txt (f)" 'PRINT " Sound Off (o) (s)" PRINT " Back to Current universe (b)" PRINT " Suggest an Encounter (e)" PRINT " Suggest an Action (x)" PRINT " Force Link of UnEqual I/O Conds. (F)" PRINT " Hardware Limits Menu (h)" PRINT " Set User Parameters (m)" COLOR blue, yel PRINT " Select an AUTO Universe (optional)" PRINT " 1 for cmpxlife.unv 2 for farmer.unv 3 for simplife.unv" PRINT " 4 for at-gaurd.unv 5 for roboship.unv 6 for easytest.unv" PRINT " (use Default Alt #1)" COLOR red, yel PRINT " Then Select Some Intelligence (optional)" PRINT " A for cmpxlife.int B for farmer.int C for simplife.int" PRINT " D for at-guard.int E for roboship.int G for easytest.int" COLOR dblue, yel PRINT " RESET to NEW AI~WHEEL (r)" PRINT " Quit ---------------------------- (q)" 7127 DO choice0$ = INKEY$ IF choice0$ = "s" THEN z = 1: soundflag = 1 IF choice0$ = "o" THEN z = 0: soundflag = 0 IF choice0$ = "c" THEN userflag = 1: manu = 1: GOTO 7025 IF choice0$ = "4" THEN b$ = "at-guard.unv": GOSUB readfilex: GOTO 7126 IF choice0$ = "2" THEN b$ = "farmer.unv": GOSUB readfilex: GOTO 7126 IF choice0$ = "3" THEN b$ = "simplife.unv": GOSUB readfilex: GOTO 7126 IF choice0$ = "1" THEN b$ = "cmpxlife.unv": GOSUB readfilex: GOTO 7126 IF choice0$ = "5" THEN b$ = "roboship.unv": GOSUB readfilex: GOTO 7126 IF choice0$ = "6" THEN b$ = "easytest.unv": GOSUB readfilex: GOTO 7126 'IF choice0$ = "0" THEN b$ = "ttt.unv": GOSUB readfilex: GOTO 7126 IF choice0$ = "G" THEN n$ = "easytest.int": GOSUB upbrainsb: choice0$ = "b" IF choice0$ = "A" THEN n$ = "cmpxlife.int": GOSUB upbrainsb: choice0$ = "b" IF choice0$ = "D" THEN n$ = "at-guard.int": GOSUB upbrainsb: choice0$ = "b" IF choice0$ = "B" THEN n$ = "farmer.int": GOSUB upbrainsb: choice0$ = "b" IF choice0$ = "C" THEN n$ = "simplife.int": GOSUB upbrainsb: choice0$ = "b" IF choice0$ = "E" THEN n$ = "roboship.int": GOSUB upbrainsb: choice0$ = "b" IF choice0$ = "r" THEN RUN IF choice0$ = "d" THEN userflagx = 1: manu = 1: GOSUB readfile IF choice0$ = "t" THEN GOSUB dumpuserf 8 IF choice0$ = "b" THEN COLOR 0, 0: CLS : GOSUB drawcirt: GOSUB sig: GOTO 7777 IF choice0$ = "f" THEN GOSUB prntcurrf IF choice0$ = "m" THEN GOSUB menusub2: GOTO 8422 IF choice0$ = "h" THEN GOSUB menusub3: GOTO 8422 IF choice0$ = "e" THEN suggflag = 1: GOSUB sugi: GOTO 8422 IF choice0$ = "x" THEN suggflag = 1: GOSUB sugo: GOTO 8422 IF choice0$ = "j" THEN GOSUB dumpbrains IF choice0$ = "u" THEN GOSUB upbrains IF choice0$ = "F" THEN GOSUB forcefalselink LOOP UNTIL choice0$ = "q" END 7126 IF intrmflag = 1 THEN 8422 COLOR gray, black RETURN sugi: CLS FOR mmx = 1 TO incondtot PRINT "Example using entry #1: "; befincondtext$(mmx); " "; objname$(mmx, 1); " "; aftincondtext$(mmx); " ["; inconddiscribe$(mmx); "]" FOR oox = 1 TO inpartspectrumtot(mmx) PRINT objname$(mmx, oox); ", "; NEXT oox PRINT " " PRINT " " 2768 PRINT " enter forced "; inconddiscribe$(mmx); INPUT " condition "; hold$ IF hold$ = "" THEN currin(mmx) = FIX(RND * inpartspectrumtot(mmx)) + 1: GOTO 4768 IF hold$ = CHR$(27) THEN 4768 FOR mbc = 1 TO inpartspectrumtot(mmx) IF hold$ = objname$(mmx, mbc) THEN holdc = mbc: GOTO 2762 NEXT mbc PRINT "object not defined, spaces and cases must match.": GOTO 2768 2762 currin(mmx) = holdc 4768 PRINT " " NEXT mmx sugiflag = 1 RETURN sugo: CLS FOR mmx = 1 TO outcondtot PRINT "Example using entry #1: "; befoutcondtext$(mmx); " "; actname$(mmx, 1); " "; aftoutcondtext$(mmx); " ["; outconddiscribe$(mmx); "]" FOR oox = 1 TO outpartspectrumtot(mmx) PRINT actname$(mmx, oox); ", "; NEXT oox PRINT " " PRINT " " 27 PRINT " enter forced "; outconddiscribe$(mmx); INPUT " condition "; hold$ IF hold$ = "" THEN currout(mmx) = FIX(RND * outpartspectrumtot(mmx)) + 1: GOTO 47 IF hold$ = CHR$(27) THEN 47 FOR mbc = 1 TO outpartspectrumtot(mmx) IF hold$ = actname$(mmx, mbc) THEN holdc = mbc: GOTO 4127 NEXT mbc PRINT "action not defined, spaces and cases must match.": GOTO 27 4127 currout(mmx) = holdc 47 PRINT " " NEXT mmx sugoflag = 1 RETURN 7025 INPUT "Output Filename: "; n$ OPEN n$ FOR OUTPUT AS #1 GOTO 7126 checkifnew: IF sugoflag = 1 THEN RETURN FOR poi = 1 TO tryedsofar FOR hfs = 1 TO outcondtot IF NOT currout(hfs) = outstacker(hfs, poi) THEN 3926 NEXT hfs currout(1) = 9999: GOTO 4926 3926 NEXT poi 4926 RETURN prntobj: PRINT objname$(objkey, currin(objkey)) RETURN revalu: '****** INTERFACE TERMINAL # 3 _ Sensors/Value - IN conditions are reread ' (perceived again) and any difference and/or metamorphisis may be assoiciated ' with value augmentation by the user; ie, a value assingment may be injected ' at this point by the creator, either as a coded law or an in-line reference ' to another source of value designation. ****** valu = 0 befval = totalscore ' inflict laws of universe and fix val enrgused = 0 rawsource = currin(objkey) FOR mm = 1 TO outcondtot enrgused = enrgused + actenrgused(mm, currout(mm)) NEXT mm FOR cmt = 1 TO comandtot 'rrec in user FOR isr = 1 TO incondtot IF rrin(isr, cmt) = icc THEN 8633 passflag = 0 IF rrin(isr, cmt) < 0 THEN GOSUB assocondinrval IF passflag = 1 THEN 8633 IF passflag = 9 THEN 8644 IF rrin(isr, cmt) = currin(isr) THEN 8633 GOTO 8644 8633 NEXT isr FOR isr = 1 TO outcondtot IF rrout(isr, cmt) = icc THEN 8622 passflag = 0 IF rrout(isr, cmt) < 0 THEN GOSUB assocondoutrval IF passflag = 1 THEN 8622 IF passflag = 9 THEN 8644 IF rrout(isr, cmt) = currout(isr) THEN 8622 GOTO 8644 8622 NEXT isr valu = valu + valaug(cmt) goalvalhold = goalvalhold + valaug(cmt) freshmadex = mmgrant(cmt) IF mmgrant(cmt) = fleecode THEN moveobflag = 1: GOTO 8344 IF mmgrant(cmt) = disapearcode THEN incondgift(objkey, (currin(objkey))) = incondgift(objkey, (currin(objkey))) - 1: disapflag = 1: GOTO 8344 freshmadex = 0 freshmade = mmgrant(cmt) ramu(mmkey(cmt)) = mmgrant(cmt) 31 IF bailaftval = 1 AND NOT valaug(cmt) = 0 THEN 8345 IF mmgrant(cmt) > 0 THEN 8344 8644 28 NEXT cmt 8345 IF freshmade > 0 THEN prodvalflag = 1: byprodflag = 1: prodlink = freshmade IF eventgrade > settlefor THEN goalvalflag = 1 818 totalscore = totalscore + valu + enrgused eventgrade = totalscore - befval LOCATE 14, 73: COLOR whiteh, 0: PRINT eventgrade LOCATE 14, 58: COLOR gray, 0: PRINT totalscore valdifxx = eventgrade GOSUB printevrec RETURN assocondinrval: IF currout(rrin(isr, cmt) * -1) = currin(isr) THEN passflag = 1: RETURN passflag = 9 RETURN assocondoutrval: IF currin(rrout(isr, cmt) * -1) = currout(isr) THEN passflag = 1: RETURN passflag = 9 RETURN 8344 IF bailaftmmordisapr = 1 THEN 8345 GOTO 28 prntcurr: COLOR green, 0: FOR rla = 16 TO 23: LOCATE rla, 1: PRINT " ": NEXT rla LOCATE 16, 1 FOR mby = 1 TO incondtot PRINT befincondtext$(mby); " "; objname$(mby, currin(mby)); " "; aftincondtext$(mby); NEXT mby IF paraflag = 0 THEN PRINT " " COLOR red, 0: FOR mby = 1 TO outcondtot IF mby = 1 THEN PRINT befoutcondtext$(mby); " "; actname$(mby, currout(mby)); " "; aftoutcondtext$(mby); " "; IF mby = 1 THEN COLOR green, 0: PRINT objname$(objkey, currin(objkey)); " "; COLOR red, 0 IF mby > 1 THEN PRINT befoutcondtext$(mby); " "; actname$(mby, currout(mby)); " "; aftoutcondtext$(mby); NEXT mby IF paraflag = 0 THEN PRINT " " COLOR yel, 0 IF freshmade > 0 THEN PRINT "A"; " "; objname$(objkey, freshmade); " "; "was created.": GOTO 303 42 IF moveobflag = 1 THEN PRINT "The"; " "; objname$(objkey, currin(objkey)); " "; "moved.": GOTO 303 IF disapflag = 1 THEN PRINT "The"; " "; objname$(objkey, currin(objkey)); " "; "disappeared.": GOTO 303 PRINT " " 303 COLOR 3, 0 PRINT "Total Score:"; totalscore; " "; COLOR 8, 0 PRINT "Tried:"; tryedsofar; " "; COLOR 6, 0 PRINT "Event #:"; histeventnum; " "; COLOR 13, 0 PRINT "Event Grade:"; eventgrade COLOR 10, 0 PRINT "goalval:"; goalval(histeventnum); " "; COLOR 9, 0 PRINT "Prodval:"; prodval(histeventnum); " "; COLOR 7, 0 PRINT "Numneed:"; numneed(histeventnum); " "; COLOR 2, 0 PRINT "Convcost:"; convcost(histeventnum); " "; COLOR 4, 0 PRINT " " IF crazyflag = 9999 THEN PRINT "Forced RND MNMutant Conds: ALL RND"; : RETURN IF crazyflag > 0 THEN PRINT "Forced RND MNMutant Cond: "; crazyflag; outconddiscribe$(crazyflag); RETURN dumpuser: COLOR lblue, 0 FOR mmx = 1 TO incondtot PRINT "Example using entry #1: "; befincondtext$(mmx); " "; objname$(mmx, 1); " "; aftincondtext$(mmx); " ["; inconddiscribe$(mmx); "]" FOR oox = 1 TO inpartspectrumtot(mmx) PRINT objname$(mmx, oox); ", "; NEXT oox PRINT " " PRINT " " NEXT mmx IF qxflag = 1 THEN 1709 COLOR lred, 0 FOR mm = 1 TO outcondtot PRINT "Example using entry #1: "; befoutcondtext$(mm); " "; actname$(mm, 1); " "; aftoutcondtext$(mm); " ["; outconddiscribe$(mm); "]" FOR oo = 1 TO outpartspectrumtot(mm) PRINT actname$(mm, oo); ", "; NEXT oo PRINT " " PRINT " " NEXT mm FOR rrecz = 1 TO comandtot FOR xfc = 1 TO incondtot IF (rrin(xfc, rrecz)) = icc THEN PRINT "{ANY}"; " "; IF (rrin(xfc, rrecz)) < 0 THEN PRINT "{in COND}"; " "; IF rrin(xfc, rrecz) < 0 THEN 1206 IF rrin(xfc, rrecz) = icc THEN 1206 PRINT objname$(xfc, (rrin(xfc, rrecz))); " "; 1206 NEXT xfc PRINT " " FOR xfc = 1 TO outcondtot IF rrout(xfc, rrecz) = icc THEN PRINT "{ANY}"; " "; IF (rrout(xfc, rrecz)) < 0 THEN PRINT "{out COND}"; " "; IF rrout(xfc, rrecz) < 0 THEN 1208 IF rrout(xfc, rrecz) = icc THEN 1208 PRINT actname$(xfc, (rrout(xfc, rrecz))); " "; 1208 NEXT xfc PRINT " " PRINT "Value granted"; valaug(rrecz); " "; IF mmgrant(rrecz) = disapearcode THEN PRINT "disappear" IF mmgrant(rrecz) = disapearcode THEN 1708 IF mmgrant(rrecz) = fleecode THEN PRINT "flee": GOTO 1708 PRINT objname$(objkey, mmgrant(rrecz)) 1708 PRINT " " NEXT rrecz 1709 RETURN dumpvals: 333 kk = kk + 1 COLOR 11, 6 hh = 41: pnum = 16 IF kk > pnum THEN kk = 13: GOTO 333 IF histeventnum = 1 THEN 515 515 kk = 14 LOCATE kk, hh + 13 7003 COLOR whiteh, black LOCATE kk, hh PRINT histeventnum evrecnumhold = histeventnum RETURN printevrec: tt = 41 IF jj = 16 THEN jj = 13 jj = jj + 1 hh = 33 LOCATE jj, tt + 5 COLOR black, black LOCATE jj, tt COLOR gray, black LOCATE jj, tt + 7 holdev = histeventnum IF newrecflag = 0 THEN histeventnum = exx LOCATE 13, 1 PRINT byprod(objkey, histeventnum); prodval(histeventnum); numneed(histeventnum); convcost(histeventnum); histeventnum histeventnum = holdev RETURN drawcirt: 7001 GOSUB CLEANbox GOSUB drawbox GOSUB box1 GOSUB box2 GOSUB line2x3 IF randy = 1 THEN 9172 GOSUB box3 GOSUB box4 GOSUB line4x5 GOSUB box5 GOSUB line5x11 9172 IF randy = 1 THEN GOSUB linerx1 GOSUB line3x4 IF randy = 1 THEN GOSUB linerx2 GOSUB line4x6 GOSUB line4x9 GOSUB box6 GOSUB line6x7 GOSUB box7 GOSUB line7x8 GOSUB box8 GOSUB line8x10 3131 GOSUB line6x9 GOSUB box9 GOSUB box10 GOSUB line10x11 7654 GOSUB box11 GOSUB line11x12 IF randy = 1 THEN 8612 GOSUB box12 8612 IF randy = 1 THEN GOSUB linerx3 GOSUB line12x1 IF sek = 1 OR randy = 1 THEN GOSUB line9x8 COLOR m, fff 9898 RETURN CLEANbox: COLOR 1, back FOR fxdf = 1 TO 16 FOR fdf = 1 TO 10 LOCATE rrr + raug + (fdf - 1), ccc + 1 + caug + fxdf PRINT CHR$(219) NEXT fdf NEXT fxdf RETURN drawbox: COLOR back, box FOR fdf = 1 TO 9 LOCATE rrr + raug + 1 + (fdf - 1), ccc + caug + 1 PRINT CHR$(186) LOCATE rrr + raug + 1 + (fdf - 1), ccc + caug + 18 PRINT CHR$(186) NEXT fdf FOR fdf = 1 TO 16 LOCATE rrr + raug, ccc + caug + 2 + (fdf - 1) PRINT CHR$(205) LOCATE rrr + raug + 10, ccc + caug + 2 + (fdf - 1) PRINT CHR$(205) NEXT fdf LOCATE rrr + raug, ccc + caug + 1 PRINT CHR$(201) LOCATE rrr + raug + 10, ccc + caug + 18 PRINT CHR$(188) LOCATE rrr + raug + 10, ccc + caug + 1 PRINT CHR$(200) LOCATE rrr + raug, ccc + caug + 18 PRINT CHR$(187) RETURN box1: LOCATE rrr + raug + 1, ccc + caug + 3 PRINT "███" LOCATE rrr + raug + 1, ccc + caug + 6 PRINT CHR$(16) IF tf = 0 THEN tf = 1: GOTO 5551 scale$ = "c": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5551 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box1 box2: LOCATE rrr + raug + 1, ccc + caug + 7 PRINT CHR$(17) LOCATE rrr + raug + 1, ccc + caug + 8 PRINT "███" LOCATE rrr + raug + 1, ccc + caug + 11 PRINT CHR$(16) IF tf = 0 THEN tf = 1: GOTO 5552 scale$ = "d": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5552 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box2 line2x3: LOCATE rrr + raug + 1, ccc + caug + 12 PRINT "───" LOCATE rrr + raug + 1, ccc + caug + 15 PRINT CHR$(191) LOCATE rrr + raug + 2, ccc + caug + 15 PRINT CHR$(25) RETURN box3: LOCATE rrr + raug + 3, ccc + caug + 13 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 5553 scale$ = "e": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5553 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box3 line3x4: LOCATE rrr + raug + 4, ccc + caug + 15 PRINT CHR$(25) RETURN box4: LOCATE rrr + raug + 5, ccc + caug + 13 PRINT CHR$(17) LOCATE rrr + raug + 5, ccc + caug + 14 PRINT "███" LOCATE rrr + raug + 5, ccc + caug + 17 PRINT CHR$(16) IF tf = 0 THEN tf = 1: GOTO 5554 scale$ = "f": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5554 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box4 line4x6: LOCATE rrr + raug + 6, ccc + caug + 15 PRINT CHR$(25) RETURN line4x9: LOCATE rrr + raug + 7, ccc + caug + 15 PRINT CHR$(25) RETURN line4x5: LOCATE rrr + raug + 5, ccc + caug + 12 PRINT CHR$(27) RETURN box5: LOCATE rrr + raug + 5, ccc + caug + 8 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 5555 scale$ = "g": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5555 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box5 line5x11: LOCATE rrr + raug + 5, ccc + caug + 7 PRINT CHR$(27) RETURN box11: LOCATE rrr + raug + 5, ccc + caug + 3 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 55511 scale$ = "f": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot + 1): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 55511 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box11 box6: LOCATE rrr + raug + 7, ccc + caug + 13 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 5556 scale$ = "a": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5556 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box6 line6x7: LOCATE rrr + raug + 7, ccc + caug + 12 PRINT CHR$(27) RETURN box7: LOCATE rrr + raug + 7, ccc + caug + 8 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 5557 scale$ = "b": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5557 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box7 line7x8: LOCATE rrr + raug + 7, ccc + caug + 7 PRINT CHR$(27) RETURN box8: LOCATE rrr + raug + 7, ccc + caug + 3 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 5558 scale$ = "c": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot + 1): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5558 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box8 line8x10: LOCATE rrr + raug + 8, ccc + caug + 4 PRINT CHR$(25) RETURN line6x9: LOCATE rrr + raug + 9, ccc + caug + 12 PRINT CHR$(27) LOCATE rrr + raug + 9, ccc + caug + 13 PRINT "──" LOCATE rrr + raug + 9, ccc + caug + 15 PRINT CHR$(217) LOCATE rrr + raug + 8, ccc + caug + 15 PRINT CHR$(25) RETURN box9: LOCATE rrr + raug + 9, ccc + caug + 7 PRINT CHR$(17) LOCATE rrr + raug + 9, ccc + caug + 8 PRINT "████" IF tf = 0 THEN tf = 1: GOTO 5559 scale$ = "d": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot + 1): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 5559 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box9 box10: LOCATE rrr + raug + 9, ccc + caug + 3 PRINT "███" LOCATE rrr + raug + 9, ccc + caug + 6 PRINT CHR$(16) IF tf = 0 THEN tf = 1: GOTO 55510 scale$ = "e": IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot + 1): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 55510 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box10 line10x11: LOCATE rrr + raug + 5, ccc + caug + 2 PRINT CHR$(218) LOCATE rrr + raug + 9, ccc + caug + 2 PRINT CHR$(192) LOCATE rrr + raug + 8, ccc + caug + 2 PRINT CHR$(179) LOCATE rrr + raug + 7, ccc + caug + 2 PRINT CHR$(179) LOCATE rrr + raug + 6, ccc + caug + 2 PRINT CHR$(179) RETURN box12: LOCATE rrr + raug + 3, ccc + caug + 3 PRINT "███" IF tf = 0 THEN tf = 1: GOTO 55512 scale$ = "g": IF soundflag = 1 THEN IF soundflag = 1 THEN PLAY nt$: PLAY "O" + STR$(ot + 1): PLAY "X" + VARPTR$(scale$) tf = 0: RETURN 55512 FOR we = 1 TO boxstall: NEXT we COLOR back, box: GOTO box12 line11x12: LOCATE rrr + raug + 4, ccc + caug + 4 PRINT CHR$(24) RETURN line12x1: LOCATE rrr + raug + 2, ccc + caug + 4 PRINT CHR$(24) RETURN line9x8: LOCATE rrr + raug + 9, ccc + caug + 6 PRINT CHR$(196) LOCATE rrr + raug + 9, ccc + caug + 5 PRINT CHR$(196) LOCATE rrr + raug + 9, ccc + caug + 4 PRINT CHR$(192) LOCATE rrr + raug + 8, ccc + caug + 4 PRINT CHR$(24) LOCATE rrr + raug + 7, ccc + caug + 4 PRINT CHR$(24) LOCATE rrr + raug + 6, ccc + caug + 4 PRINT CHR$(24) RETURN linerx1: LOCATE rrr + raug + 3, ccc + caug + 15 PRINT CHR$(25) RETURN linerx2: LOCATE rrr + raug + 5, ccc + caug + 15 PRINT CHR$(25) RETURN linerx3: LOCATE rrr + raug + 3, ccc + caug + 4 PRINT CHR$(24) RETURN prntclean: LOCATE 7, 59: COLOR blue, blue: PRINT " " LOCATE 9, 59: COLOR blue, blue: PRINT " " RETURN prntcurrf: INPUT "Output Filename: "; n$ OPEN n$ FOR OUTPUT AS #1 FOR erk = 1 TO histeventnum FOR mby = 1 TO incondtot PRINT #1, befincondtext$(mby); " "; objname$(mby, inhistory(mby, erk)); " "; aftincondtext$(mby); NEXT mby IF paraflag = 0 THEN PRINT #1, " " COLOR red, 0: FOR mby = 1 TO outcondtot IF mby = 1 THEN PRINT #1, befoutcondtext$(mby); " "; actname$(mby, outhistory(mby, erk)); " "; aftoutcondtext$(mby); " "; IF mby = 1 THEN COLOR green, 0: PRINT #1, objname$(objkey, inhistory(objkey, erk)); " "; COLOR red, 0 IF mby > 1 THEN PRINT #1, befoutcondtext$(mby); " "; actname$(mby, outhistory(mby, erk)); " "; aftoutcondtext$(mby); NEXT mby IF paraflag = 0 THEN PRINT #1, " " COLOR yel, 0 IF byprod(objkey, erk) = fleecode THEN PRINT #1, "The"; " "; objname$(objkey, inhistory(objkey, erk)); " "; "moved.": GOTO 43 IF byprod(objkey, erk) = disapearcode THEN PRINT #1, "The"; " "; objname$(objkey, inhistory(objkey, erk)); " "; "disappeared.": GOTO 43 IF byprod(objkey, erk) > 0 THEN PRINT #1, "A"; " "; objname$(objkey, byprod(objkey, erk)); " "; "was created." 43 COLOR blue, 0 PRINT #1, "Total Score: NA "; COLOR 8, 0 PRINT #1, "Tried: NA "; COLOR 6, 0 PRINT #1, "Event #:"; erk; " "; COLOR 13, 0 PRINT #1, "Event Grade:"; goalval(erk) + convcost(erk) COLOR blue, 0 PRINT #1, "Goalval:"; goalval(erk); " "; COLOR 8, 0 PRINT #1, "Prodval:"; prodval(erk); " "; COLOR 6, 0 PRINT #1, "Numneed:"; numneed(erk); " "; COLOR 13, 0 PRINT #1, "Convcost:"; convcost(erk); " "; IF czf(erk) = 9999 THEN PRINT #1, "RND MNM Conds: ALL RND"; : GOTO 22 IF czf(erk) > 0 THEN PRINT #1, "RND MNM Cond: "; czf(erk); outconddiscribe$(czf(erk)); 22 PRINT #1, " " PRINT #1, " " NEXT erk choice0$ = "" CLOSE RETURN sig: COLOR 6, blue LOCATE 11, 57: PRINT "AI~WHEEL" LOCATE 13, 41: PRINT " Copyright 1996 by David A. Harrell " LOCATE 12, 41: PRINT " Universal Robotic Brain Cell" COLOR brown, blue LOCATE 12, 1: PRINT " ════════ Press z for Main Menu ═══════ " RETURN toglrnd: IF toglrf = 1 THEN 3952 i1 = dominaterndflag i2 = dominaterndrate i3 = rndrate i4 = rndrndon i5 = rndrndstop i6 = rndwithevnum i7 = rndtop i8 = simnnon dominaterndflag = 0 dominaterndrate = 0 rndrate = 0 rndrndon = 0 rndrndstop = 0 rndwithevnum = 0 rndtop = 0 simnnon = 0 simselon = 1 toglrf = 1 GOTO 3959 3952 dominaterndflag = i1 dominaterndrate = i2 rndrate = i3 rndrndon = i4 rndrndstop = i5 rndwithevnum = i6 rndtop = i7 simnnon = i8 toglrf = 0 simnnon = 1 simselon = 1 fulpartrnd = 1 useppout = 1 dominaterndflag = 1 forceobjkeypp = 1 3959 RETURN menusub2: COLOR 0, blue CLS COLOR 0, blue PRINT " ---- User Entry Parameters and Cognitive Track Switches Menu ----" COLOR white, blue PRINT " (1) Last Law on Value Min. "; bailaftval PRINT " (b) Last Law on Metmophisis "; bailaftmmordisapr PRINT " (d) Forced Act Limit "; actmaxlimit PRINT " (e) Minimum Value is: "; settlefor PRINT " (8) Select Similes "; simselon PRINT " (v) Box Lights Duration "; boxstall PRINT " (x) Augment Duplicate Expr Need "; retrogdupnn PRINT " (5) Maxinmum Minimal Mutation "; maxminmute PRINT " (4) Choose ALL Particles @Random"; fulpartrnd PRINT " (n) Tic Tac Toe Switch "; tttflag PRINT " (p) Priority (+) Particles Only "; calcpospponly PRINT " (3) Use Condition Priority Out "; useppout PRINT " (r) In and Out Cond Pri On/Off"; usevalppflag PRINT " (t) Produce Similar Experments "; simnnon PRINT " (7) Auto Check For Equal Fields "; likelinks PRINT " (9) Always Link Like (=) Fields "; linkalways PRINT " (6) Attempt Tries to Force Link "; linktrys PRINT " (c) Force Link Between un= Conds"; forcefieldlink PRINT " (g) Produce Experimental Objects"; numneedon PRINT " (j) Number of Laws "; comandtot PRINT " (R) Expirimental Production Rate"; rndsimnnrate COLOR 6, blue LOCATE 2, 40: PRINT "(G) Record Value/Production Only "; supcnd LOCATE 4, 40: PRINT "(H) #1 Priority to Main Object "; forceobjkeypp LOCATE 3, 40: PRINT "(I) Low Accepted Limit to Record "; recvalonly LOCATE 5, 40: PRINT "(J) Closed (reCycled) Universe "; appearnowonly LOCATE 6, 40: PRINT "(K) Encounter a New Creation Next"; appearnow LOCATE 7, 40: PRINT "(L) Expand Byproduct to All Cond."; matchallbyprod LOCATE 8, 40: PRINT "(m) Entry Order Pri Deflt Release"; nodefaultflag LOCATE 9, 40: PRINT "(i) Soft Action Limit "; actmax LOCATE 10, 40: PRINT "(q) PartPri for Experimental Need"; calcnnppalso LOCATE 11, 40: PRINT "(s) ReCompute Cond Pri Each Cycle"; compglobalppflag LOCATE 12, 40: PRINT "(u) Begin Using CondPri on Recd# "; beginpp LOCATE 13, 40: PRINT "(w) Don't Make Duplicate Records "; noduprecs LOCATE 14, 40: PRINT "(2) Current Event Number "; histeventnum LOCATE 15, 40: PRINT "(a) Manual Random Action "; dominaterndflag LOCATE 16, 40: PRINT "(0) Manual Random Rate "; dominaterndrate LOCATE 17, 40: PRINT "(o) Rate of Random Action "; rndrate LOCATE 18, 40: PRINT "(A) Randomized Random Switches "; rndrndon LOCATE 19, 40: PRINT "(B) Stop Randomizing Rnd Switches"; rndrndstop LOCATE 20, 40: PRINT "(C) Taper Random Rate w/Experince"; rndwithevnum LOCATE 21, 40: PRINT "(D) Float w/Event # Random Rate "; rndtop LOCATE 22, 40: PRINT "(y) open brain surgery" COLOR 0, 1 LOCATE 23, 28: PRINT "(z) Back to main menu" DO 3371 ch$ = INKEY$ IF ch$ = "a" THEN INPUT " set dominaterndflag"; dominaterndflag IF ch$ = "b" THEN INPUT " set bailaftmmordisapr"; bailaftmmordisapr IF ch$ = "c" THEN INPUT " set forcefieldlink"; forcefieldlink IF ch$ = "d" THEN INPUT " set actmaxlimit"; actmaxlimit IF ch$ = "e" THEN INPUT " set settlefor"; settlefor IF ch$ = "m" THEN INPUT " set nodefaultflag"; nodefaultflag IF ch$ = "n" THEN INPUT " set tttflag"; tttflag IF ch$ = "o" THEN INPUT " set rndrate"; rndrate IF ch$ = "p" THEN INPUT " set calcpospponly"; calcpospponly IF ch$ = "q" THEN INPUT " set calcnnppalso"; calcnnppalso IF ch$ = "r" THEN INPUT " set usevalppflag"; usevalppflag IF ch$ = "s" THEN INPUT " set compglobalppflag"; compglobalppflag IF ch$ = "t" THEN INPUT " set simnnon"; simnnon IF ch$ = "u" THEN INPUT " set beginpp"; beginpp IF ch$ = "v" THEN INPUT " set boxstall"; boxstall IF ch$ = "w" THEN INPUT " set noduprecs"; noduprecs IF ch$ = "1" THEN INPUT "set bailaftval"; bailaftval IF ch$ = "4" THEN INPUT "set fulpartrnd"; fulpartrnd IF ch$ = "5" THEN INPUT "set maxminmute"; maxminmute IF ch$ = "6" THEN INPUT "set linktrys"; linktrys IF ch$ = "7" THEN INPUT "set likelinks"; likelinks IF ch$ = "8" THEN INPUT "set simselon"; simselon IF ch$ = "9" THEN INPUT "set linkalways"; linkalways IF ch$ = "0" THEN INPUT "set dominaterndrate"; dominaterndrate IF ch$ = "x" THEN INPUT "set retrogdupnn"; retrogdupnn IF ch$ = "R" THEN INPUT "set rndsimnnrate"; rndsimnnrate IF ch$ = "2" THEN INPUT "set histeventnum"; histeventnum IF ch$ = "g" THEN INPUT "set numneedon"; numneedon IF ch$ = "j" THEN INPUT "set comandtot"; comandtot IF ch$ = "j" THEN INPUT "set actmax"; actmax IF ch$ = "A" THEN INPUT "set rndrndon"; rndrndon IF ch$ = "B" THEN INPUT "set rndrndstop"; rndrndstop IF ch$ = "C" THEN INPUT "set rndwithevnum"; rndwithevnum IF ch$ = "D" THEN INPUT "set rndtop"; rndtop IF ch$ = "y" THEN ch$ = "": STOP IF ch$ = "3" THEN INPUT " set useppout"; useppout IF ch$ = "G" THEN INPUT "set supcnd"; supcnd IF ch$ = "H" THEN INPUT "set forceobjkeypp"; forceobjkeypp IF ch$ = "I" THEN INPUT "set recvalonly"; recvalonly IF ch$ = "J" THEN INPUT "set appearnowonly"; appearnowonly IF ch$ = "K" THEN INPUT "set appearnow"; appearnow IF ch$ = "L" THEN INPUT "set matchallbyprod"; matchallbyprod LOOP UNTIL ch$ = "z" RETURN forcefalselink: INPUT "Set forced link: in condition #"; lcv INPUT "is associated with out condition #"; condlinkfinal(lcv) forcefieldlink = 1 RETURN writeswch: : PRINT #1, histeventnum; prodvalflag; goalvalflag; byprodflag; actmax; toglrf PRINT #1, dominaterndflag; bailaftmmordisapr; forcefieldlink; actmaxlimit; settlefor; evrechardlimit; incondtot; outcondtot; inparthardlimit; outparthardlimit; lawshardlimit; evcnt; nodefaultflag; tttflag; rndrate; calcpospponly; calcnnppalso; usevalppflag; compglobalppflag; simnnon; beginpp; boxstall; noduprecs; useppout; bailaftval; fulpartrnd; maxminmute; linktrys; likelinks; simselon; linkalways; dominaterndrate; rndsimnnrate; numneedon; comandtot; rndrndon; rndrndstop; rndwithevnum; rndtop; supcnd; forceobjkeypp; recvalonly; appearnowonly; appearnow; matchallbyprod; retrogdupnn RETURN dumpbrains: INPUT "Output Filename: "; n$ OPEN n$ FOR OUTPUT AS #1 PRINT #1, incondtot; FOR iux = 1 TO incondtot PRINT #1, inpartspectrumtot(iux); PRINT #1, ippnt(iux); PRINT #1, pinstk(iux); NEXT iux PRINT #1, " " PRINT #1, outcondtot; FOR iux = 1 TO outcondtot PRINT #1, outpartspectrumtot(iux); PRINT #1, oppnt(iux); PRINT #1, poutstk(iux); NEXT iux PRINT #1, " " GOSUB writeswch FOR ick = 1 TO histeventnum PRINT #1, ick; byprod(objkey, ick); convcost(ick); numneed(ick); prodval(ick); goalval(ick); czf(ick) FOR iux = 1 TO incondtot PRINT #1, inhistory(iux, ick); NEXT iux PRINT #1, " " FOR iux = 1 TO outcondtot PRINT #1, outhistory(iux, ick); NEXT iux PRINT #1, " " NEXT ick CLOSE RETURN upbrains: INPUT "Input Filename _________.int: "; n$ upbrainsb: OPEN n$ FOR INPUT AS #1 INPUT #1, incondtot FOR iux = 1 TO incondtot INPUT #1, inpartspectrumtot(iux) INPUT #1, ippnt(iux) INPUT #1, pinstk(iux) NEXT iux INPUT #1, outcondtot FOR iux = 1 TO outcondtot INPUT #1, outpartspectrumtot(iux) INPUT #1, oppnt(iux) INPUT #1, poutstk(iux) NEXT iux GOSUB getswch FOR ick = 1 TO histeventnum INPUT #1, ick, byprod(objkey, ick), convcost(ick), numneed(ick), prodval(ick), goalval(ick), czf(ick) FOR iux = 1 TO incondtot INPUT #1, inhistory(iux, ick) NEXT iux FOR iux = 1 TO outcondtot INPUT #1, outhistory(iux, ick) NEXT iux NEXT ick CLOSE RETURN dumpuserf: INPUT "Output Filename: "; n$ OPEN n$ FOR OUTPUT AS #1 COLOR lblue, 0 FOR mmx = 1 TO incondtot PRINT #1, "Example using entry #1: "; befincondtext$(mmx); " "; objname$(mmx, 1); " "; aftincondtext$(mmx); " ["; inconddiscribe$(mmx); "]" FOR oox = 1 TO inpartspectrumtot(mmx) PRINT #1, objname$(mmx, oox); ", "; NEXT oox PRINT #1, " " PRINT #1, " " NEXT mmx IF qxflag = 1 THEN 709 COLOR lred, 0 FOR mm = 1 TO outcondtot PRINT #1, "Example using entry #1: "; befoutcondtext$(mm); " "; actname$(mm, 1); " "; aftoutcondtext$(mm); " ["; outconddiscribe$(mm); "]" FOR oo = 1 TO outpartspectrumtot(mm) PRINT #1, actname$(mm, oo); ", "; NEXT oo PRINT #1, " " PRINT #1, " " NEXT mm FOR rrecz = 1 TO comandtot FOR xfc = 1 TO incondtot IF (rrin(xfc, rrecz)) = icc THEN PRINT #1, befincondtext$(xfc); " "; "{ANY}"; " "; " "; aftincondtext$(xfc); IF rrin(xfc, rrecz) = icc THEN 206 IF (rrin(xfc, rrecz)) < 0 THEN PRINT #1, befincondtext$(xfc); " "; "{in COND}"; " "; " "; aftincondtext$(xfc); IF rrin(xfc, rrecz) < 0 THEN 206 PRINT #1, befincondtext$(xfc); " "; objname$(xfc, (rrin(xfc, rrecz))); " "; aftincondtext$(xfc); 206 NEXT xfc PRINT #1, " " FOR xfc = 1 TO outcondtot IF rrout(xfc, rrecz) = icc THEN PRINT #1, befoutcondtext$(xfc); " "; "{ANY}"; " "; aftoutcondtext$(xfc); " "; IF rrout(xfc, rrecz) = icc THEN 208 IF rrout(xfc, rrecz) < 0 THEN PRINT #1, befoutcondtext$(xfc); " "; "{out COND}"; " "; aftoutcondtext$(xfc); " "; IF rrout(xfc, rrecz) < 0 THEN 208 IF xfc = 1 THEN PRINT #1, befoutcondtext$(xfc); " "; actname$(xfc, (rrout(xfc, rrecz))); " "; aftoutcondtext$(xfc); " "; objname$(objkey, rrin(objkey, rrecz)); " "; : GOTO 208 PRINT #1, befoutcondtext$(xfc); " "; actname$(xfc, (rrout(xfc, rrecz))); " "; aftoutcondtext$(xfc); " "; 208 NEXT xfc PRINT #1, " " PRINT #1, "Value granted"; valaug(rrecz); " "; IF mmgrant(rrecz) = disapearcode THEN PRINT #1, "disappear"; IF mmgrant(rrecz) = disapearcode THEN 708 IF mmgrant(rrecz) = fleecode THEN PRINT #1, "flee"; : GOTO 708 PRINT #1, objname$(objkey, mmgrant(rrecz)); 708 PRINT #1, " Law #: "; rrecz PRINT #1, " " NEXT rrecz 709 CLOSE RETURN sugglink: linktrycnt = linktrycnt + 1 FOR coni = 1 TO incondtot IF NOT condlinkfinal(coni) > 0 THEN 12 FOR prto = 1 TO outpartspectrumtot(condlinkfinal(coni)) IF actname$((condlinkfinal(coni)), prto) = objname$(coni, currin(coni)) THEN currout((condlinkfinal(coni))) = prto IF forcefieldlink = 1 THEN currout(condlinkfinal(coni)) = currin(coni) NEXT prto 12 NEXT coni RETURN menusub3: COLOR 0, 4 CLS COLOR 0, 4 PRINT "" PRINT " --------- User Entry AI~WHEEL HARDWARE Parameters Menu ---------" COLOR white, 4 LOCATE 4, 26: PRINT "(f) Event Record Limit "; evrechardlimit LOCATE 7, 26: PRINT "(h) Out Condition Limit "; outcondtot LOCATE 6, 26: PRINT "(i) In Particle Limit "; inparthardlimit LOCATE 8, 26: PRINT "(j) Out Particle Limit "; outparthardlimit LOCATE 9, 26: PRINT "(k) Laws Hard Limit "; lawshardlimit LOCATE 5, 26: PRINT "(g) In Condition Limit "; incondtot LOCATE 11, 10: PRINT " (a) Default Alternate #1 (Use this for Auto-Universe 6)" COLOR 0, 4 LOCATE 23, 9 PRINT " Copyright 1996 by David Albert Harrell - All Rights Reserved" COLOR 4, 0 LOCATE 17, 27: PRINT " (z) Proceed to Main Menu " DO ch$ = INKEY$ IF ch$ = "f" THEN INPUT " set Event Record Limit "; evrechardlimit IF ch$ = "g" THEN INPUT " set In Condition Limit "; incondtot IF ch$ = "h" THEN INPUT " set Out Condition Limit"; outcondtot IF ch$ = "i" THEN INPUT " set In Particle Limit "; inparthardlimit IF ch$ = "j" THEN INPUT " set Out Particle Limit "; outparthardlimit IF ch$ = "k" THEN INPUT " set Laws Hard Limit "; lawshardlimit IF ch$ = "a" THEN evrechardlimit = 600: incondtot = 4: outcondtot = 3: inparthardlimit = 5: outparthardlimit = 5: lawshardlimit = 6: LOCATE 11, 10: PRINT " set " LOOP UNTIL ch$ = "z" RETURN tttdispl: COLOR 4, 0: LOCATE 9, 30: PRINT "Wins:"; nttwins COLOR 6, 0: LOCATE 10, 30: PRINT "Game:"; tttgamecnt COLOR 2, 0: LOCATE 11, 30: PRINT "Loss:"; nttloss COLOR lred, 0: LOCATE 9, 43 IF t(1) = 1 THEN PRINT "X" IF t(1) = 2 THEN PRINT "O" IF t(1) = 3 THEN PRINT " " LOCATE 9, 45 IF t(2) = 1 THEN PRINT "X" IF t(2) = 2 THEN PRINT "O" IF t(2) = 3 THEN PRINT " " LOCATE 9, 47 IF t(3) = 1 THEN PRINT "X" IF t(3) = 2 THEN PRINT "O" IF t(3) = 3 THEN PRINT " " LOCATE 10, 43 IF t(4) = 1 THEN PRINT "X" IF t(4) = 2 THEN PRINT "O" IF t(4) = 3 THEN PRINT " " LOCATE 10, 45 IF t(5) = 1 THEN PRINT "X" IF t(5) = 2 THEN PRINT "O" IF t(5) = 3 THEN PRINT " " LOCATE 10, 47 IF t(6) = 1 THEN PRINT "X" IF t(6) = 2 THEN PRINT "O" IF t(6) = 3 THEN PRINT " " LOCATE 11, 43 IF t(7) = 1 THEN PRINT "X" IF t(7) = 2 THEN PRINT "O" IF t(7) = 3 THEN PRINT " " LOCATE 11, 45 IF t(8) = 1 THEN PRINT "X" IF t(8) = 2 THEN PRINT "O" IF t(8) = 3 THEN PRINT " " LOCATE 11, 47 IF t(9) = 1 THEN PRINT "X" IF t(9) = 2 THEN PRINT "O" IF t(9) = 3 THEN PRINT " " RETURN tttset: FOR tts = 1 TO 9 IF t(tts) = 3 THEN 19 NEXT tts 17 IF winf = 1 THEN nttwins = nttwins + 1 IF winf = 2 THEN nttloss = nttloss + 1 winf = 0 tttgamecnt = tttgamecnt + 1 FOR tts = 1 TO 9 t(tts) = 3 NEXT tts GOTO 104 19 winf = 0 IF t(1) = t(2) AND t(2) = t(3) AND NOT t(3) = 3 THEN winf = t(3): GOTO 17 IF t(4) = t(5) AND t(5) = t(6) AND NOT t(6) = 3 THEN winf = t(6): GOTO 17 IF t(7) = t(8) AND t(8) = t(9) AND NOT t(9) = 3 THEN winf = t(9): GOTO 17 IF t(1) = t(5) AND t(5) = t(9) AND NOT t(9) = 3 THEN winf = t(9): GOTO 17 IF t(3) = t(5) AND t(5) = t(7) AND NOT t(7) = 3 THEN winf = t(7): GOTO 17 IF t(1) = t(4) AND t(4) = t(7) AND NOT t(7) = 3 THEN winf = t(7): GOTO 17 IF t(2) = t(5) AND t(5) = t(8) AND NOT t(8) = 3 THEN winf = t(8): GOTO 17 IF t(3) = t(6) AND t(6) = t(9) AND NOT t(9) = 3 THEN winf = t(9): GOTO 17 104 RETURN placettt: GOSUB tttset 10 IF NOT t(currout(2)) = 3 THEN currout(2) = (INT(RND * 9) + 1): GOTO 10 t(currout(2)) = 1 RETURN rndrnd: IF firsttime = 0 THEN firsttime = 1: GOSUB grabswchs IF histeventnum = rndrndstop - 1 THEN GOSUB restoreswchs: RETURN simnnon = FIX(RND * 2) simselon = FIX(RND * 2) fulpartrnd = FIX(RND * 2) useppout = FIX(RND * 2) dominaterndflag = FIX(RND * 2) forceobjkeypp = FIX(RND * 2) maxminmute = FIX(RND * outcondtot) + 1 RETURN restoreswchs: simnnon = hsimnnon simselon = hsimselon fulpartrnd = hfulpartrnd useppout = huseppout dominaterndflag = hdominaterndflag forceobjkeypp = hforceobjkeypp maxminmute = hmaxminmute RETURN grabswchs: hsimnnon = simnnon hsimselon = simselon hfulpartrnd = fulpartrnd huseppout = useppout hdominaterndflag = dominaterndflag hforceobjkeypp = forceobjkeypp hmaxminmute = maxminmute RETURN prntrnswchs: COLOR 4, 0 LOCATE 1, 72: PRINT rndrndstop COLOR 8, 0 LOCATE 2, 71: PRINT "simVL" LOCATE 3, 71: PRINT "simXP" LOCATE 4, 71: PRINT "DmRND" LOCATE 5, 71: PRINT "fpRND" LOCATE 6, 71: PRINT "PPout" LOCATE 7, 71: PRINT "ObjKy" LOCATE 8, 71: PRINT "OMuta" COLOR 14, 0 LOCATE 2, 76: PRINT simselon LOCATE 3, 76: PRINT simnnon LOCATE 4, 76: PRINT dominaterndflag LOCATE 5, 76: PRINT fulpartrnd LOCATE 6, 76: PRINT useppout LOCATE 7, 76: PRINT forceobjkeypp LOCATE 8, 76: PRINT maxminmute RETURN cleanrec: numneed(histeventnum) = 0 byprod(objkey, histeventnum) = 0 prodval(histeventnum) = 0 czf(histeventnum) = 0 RETURN domnrnd: IF dominaterndflag = 1 AND NOT dominaterndrate > FIX(RND * rndtop) + 1 THEN 4678 LOCATE 7, 59: COLOR lblue, blue: PRINT "║║║║": LOCATE 9, 59: PRINT "║║║║" IF useppout = 0 THEN 46 IF maxminmute = 8888 THEN keyx = poutstk(1): GOTO 468 IF maxminmute = 9999 THEN keyx = poutstk(outcondtot): GOTO 468 IF maxminmute > 0 THEN keyx = maxminmute: GOTO 468 46 IF fulpartrnd = 1 THEN GOSUB randaction: crazyflag = 9999: GOTO 4678 keyx = FIX(RND * outcondtot) + 1 IF useppout = 1 THEN keyx = poutstk(1) 468 crazyflag = keyx: czf(histeventnum) = crazyflag currout(keyx) = FIX(RND * outpartspectrumtot(keyx)) + 1 IF currout(keyx) = 0 THEN PRINT " currout key zero? ": END 4678 RETURN