From news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!howland.reston.ans.net!nntp.coast.net!news.kei.com!newsfeed.internetmci.com!gatech!rutgers!news.columbia.edu!news.new-york.net!news.stormking.com!PK6811S@ACAD.DRAKE.EDU Tue Jun 25 10:48:22 1996 Article: 5501 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!howland.reston.ans.net!nntp.coast.net!news.kei.com!newsfeed.internetmci.com!gatech!rutgers!news.columbia.edu!news.new-york.net!news.stormking.com!PK6811S@ACAD.DRAKE.EDU From: PK6811S@ACAD.DRAKE.EDU Newsgroups: rec.games.corewar Subject: Yogi Bear Date: 24 Jun 1996 16:21:42 -0400 Organization: Storm King Ind. Inc. Lines: 137 Sender: server@news.stormking.com Distribution: world Message-ID: <01I6A8AUEXZM001CUG@ACAD.DRAKE.EDU> Reply-To: PK6811S@ACAD.DRAKE.EDU NNTP-Posting-Host: valhalla.stormking.com Originator: corewar-l@stormking.com With Pizza down, it is a perfect time to polish up your code and POST it :-) Here is Yogi Bear: Yogi's table-based switcher allows a high level of flexibility after a loss the pointer moves forward one entry after a tie the pointer moves to the entry indicated by the a-operand after a win the pointer moves to the entry indicated by the b-operand first two portions of the table alternate stone-imp and one-shot 1st portion is switch-on-loss, stick on tie or win should beat non-pspace programs 2nd portion is switch-on-loss-or-win, stick on tie should beat two-component pspacers the last portion is a solo stone to handle certain fast opponents and is also the designated qscan defense qscanners are detected by a failure in the one-shot launch interrupting the one-shot launch causes the table to jump to stone and stays there until he loses twice ;redcode-94 ;name Yogi Bear ;kill Yogi ;author P.Kline ;assert CORESIZE == 8000 ;strategy table-based switcher (smarter than the average bear :-) ;strategy improved Emerald, one-shot, qscan alert ;strategy more bug fixes ptable ; AfterTie , AfterWin p1ST1 dat p1ST1-ptable,p1ST1-ptable p1WT1 dat p1WT1-ptable,p1WT1-ptable p1ST2 dat p1ST1-ptable,p1ST1-ptable p1WT2 dat p1WT1-ptable,p1WT1-ptable ptable2 p2ST1 dat p2ST1-ptable,p2WT1-ptable p2WT1 dat p2WT1-ptable,p2ST1-ptable p2ST2 dat p2ST1-ptable,p2WT1-ptable p2WT2 dat p2WT1-ptable,p2ST1-ptable ptable3 p3QK1 dat p3QK1-ptable,p3QK1-ptable dat p3QK1-ptable,p3QK1-ptable pstuff ldp.ab #0,#0 ; result of the last round pflag ldp.ab #1 ,ptable ; last strategy jmn pwintie,pstuff ; did we lose? add #1 ,ptable ; yes - bump the pointer jmp pcommit pwintie sne #2 ,pstuff ; no - use the table mov.ab @ptable,@ptable mov.b @ptable,ptable pcommit mod #pstuff-ptable ,ptable ; brainwash protection stp.ba ptable,pflag ; save the current strategy slt ptable,#p3QK1-ptable ; are we selecting stone? jmp slQuick ; yes mov.ba ptable,ptable ; no mod.a #2,ptable ; select stone-imp or one-shot jmz.a slStone,ptable wBoot equ 250 wStep equ 11 slWither stp.a #p3QK1-ptable-1,pflag ; set pointer to stone mov wGate,wGate+wBoot ; boot the one-shot mov wGate mov @1,>wGate djn.b -2,{wWipe dat 0,0 dat 0,0 wNext sub wScan ,wGate ; one-shot 80% scanner sne *wGate ,@wGate sub wScan ,wGate seq }wGate ,>wGate wScan sne.x *wGate ,@wGate ; ignore single bombs djn.f wNext ,<-2001 spl wWipe ,-28 ; stone mov -2,<-111 add Stone,1 mov >0,-2 djn.f -2,<6500 dat 0,0 dat 0,0 dat 0,0 gate equ (hide1-19) hide1 spl #0 ,gate djn.f -1 ,>gate dat 0,0 hbomb dat <2667,2-gate end pstuff Paul Kline pk6811s@acad.drake.edu