From tuc Tue Nov 21 14:09:33 1995 Received: from accursio.comune.bologna.it (accursio.comune.bologna.it [193.207.1.1]) by valhalla.stormking.com (8.6.12/8.6.12) with SMTP id OAA19614 for ; Tue, 21 Nov 1995 14:07:45 -0500 Message-Id: <199511211907.OAA19614@valhalla.stormking.com> Received: from async-1.iperbole.bologna.it by accursio.comune.bologna.it with SMTP (1.38.193.5/16.2) id AA03171; Tue, 21 Nov 1995 20:08:12 +0100 Date: Tue, 21 Nov 1995 20:08:12 +0100 X-Sender: pan0178@iperbole.bologna.it (Unverified) X-Mailer: Windows Eudora Version 1.4.4 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: corewar-l@stormking.com From: pan0178@comune.bologna.it (MV) Subject: Re: round 6 > >;strategy Confuse opponent by writing unreadable, uncommented code >;strategy with nonsense labels :-) > >This strategy seems to apply to a lot of the programs from round 6. >Please post an article explaining what your programs do. > >I will not mention any names, but the authors of these warriors should >be ashamed :-) > >?whatever? >machiavelli >plinyswitch >the thinker >winner > >This program is better, but I can't figure out its overall strategy: > >miss playful > >/Anders > Right... I'm blushing! ;-) So I'll post two words about my warrior... My strategy is the following: PLAY 1 WIN: set 347a strategy (that means that the enemy can be white 3,4,7 or Anders...obviously it could be another human!) at next round PLAY 3 RES=0: set a (I'll play 31313131... and Anders will play 1313131...) (this continues until the sequence go on) RES=1: set 4 'cos the enemy is ww#4 (or another human...) RES=2: set 37; at next round I'll use the 37 strat (who is the same of 28 so I'll use go37 routine) LOSS: PLAY 2 RES=0: set 50 (at next round I'll execute go50) RES=1: set 169 RES=2: set 28 If during a selected strategy something goes wrong jump to random strat... BTW thanx to Anders Ivner who has given me about 200 (useful!) points more, but perhaps even more than 200 ;-) Regards Maurizio ;redcode-94 ;name Machiavelli ;author Maurizio Vittuari ;contact pan0178.iperbole.bologna.it ;NSFCWT round 6 ;strategy Handshaking...? Noo! (that means... Yeah! ;-) ;strategy kill whites; score 500/500/0 against Anders; ;strategy pseudo random strat against others ;assert WARRIORS==1 || (WARRIORS == 2 && MINDISTANCE == CORESIZE/2) ;assert VERSION >= 80 ;my/your_hand are used to communicate between players your_hand equ (my_hand+CORESIZE/2) PAPER equ #1 ;some useful constants SCISSORS equ #2 STONE equ #3 org start my_hand dat 0,0 ; ; Variable part starts here. This is were I decide what hand to ; use next. I can use the value of the RESULTS cell (0 if lost, ; 1 if won, 2 if tied last round) and any other values I chose ; to store in pspace. The hand I decide to show is stored in the ; B-field of instruction 'my_hand'. ;---BEGIN-VARIABLE-PART----------------------------------------------------- RES_S equ #0 ;last result RND_S equ #1 ;round_number slot RAND_S equ #2 ;pseudo random number generation STRAT_S equ #3 ;my last strategy (0,4,5,169,etc.) M123_S equ #4 ;my last move (1,2,3) start round ldp RND_S, #0 res ldp RES_S, #0 strat ldp STRAT_S,#0 ; 0,4,5,169,28,37,etc. lmove ldp M123_S, #0 jmn go, strat ;strat is yet decided! jmz first, round ;round #0 sne #1, round jmp second ;goto second sne #2, round jmp third go sne #28, strat ;goto selected strategy jmp go28 sne #347, strat jmp go347a sne #50, strat jmp go50 sne #5, strat jmp go5 sne #169, strat jmp go169 sne #19, strat jmp go19 sne #37, strat jmp go28 sne #6, strat jmp go6 sne #4, strat jmp go4 sne #113, strat jmp goa gor ldp RAND_S, #0 ;pseudo random number generation add #1, gor ;do some stuffs... mul #3, gor add #5, gor mul #7, gor stp.b gor, RAND_S ;store the pseudo random number mod #11, gor ;that will be my next seed add.b gor, ptr num mov.b @ptr, 0 mod #3, num add #1, num mov.ba num, last jmp fine, >round ptr dat 0, 1 ;random table dat 0, 3 ;pseudo random number is used as pointer dat 0, 2 ;to an element of this table dat 0, 1 dat 0, 1 dat 0, 2 dat 0, 3 dat 0, 1 dat 0, 3 dat 0, 2 dat 0, 1 dat 0, 3 dat 0, 2 go28 sne #1, res jmp ok28 check28 seq #501, round jmp setr add #1, lmove mod #3, lmove ok28 mov.ba lmove, last jmp fine, >round go19 sne #1, res jmp ok19 check19 seq #501, round jmp setr add #2, lmove mod #3, lmove ok19 mov.ba lmove, last jmp fine, >round go169 sne #1, res jmp ok169 sne #5, round jmp set6 jmp set19 ok169 slt round, #10 jmp set19 mov.ba lmove,last jmp fine, >round go6 seq #1, res jmp setr add #1, lmove stp lmove, M123_S div #5, lmove add #2, lmove mod #3, lmove add #1, lmove mov.ba lmove, last jmp fine+1, >round go50 sne #1, res jmp ok0 sne #4, round seq #2, res jmp setr jmp set5 ok0 mov.ba lmove, last jmp fine, >round go5 seq #1, res jmp setr add #1, lmove mod.a #3, lmove mov.ba lmove, last jmp fine, >round go347a sne #1, res jmp set4 ;res=1 --> goto set4 jmz seta, res ;res=0 --> goto seta jmp set37 ;res=2 --> goto set37 go4 seq #1, res jmp setr add #1, lmove mod #3, lmove add #1, lmove mov.ba lmove, last jmp fine, >round goa mov round, data ;Maurizio versus Anders mod #2, data jmz uno, data seq #1, res jmp setr ;set random if cheated mov #3, last jmp fine, >round uno jmn setr, res ;set random if cheated mov.a #1, last jmp fine, >round data dat 0, 0 set347a stp #347, STRAT_S ;set a strategy mov.a #3, last jmp fine, >round set50 stp #50, STRAT_S mov.a #2, last jmp fine, >round set5 stp #5, STRAT_S mov.a #1, last jmp fine, >round set19 stp #19, STRAT_S mov.a #2, last jmp fine, >round set37 stp #37, STRAT_S mov.a #1, last jmp fine, >round set169 stp #169, STRAT_S mov.a #2, last jmp fine, >round set28 stp #28, STRAT_S mov.a #3, last jmp fine, >round set6 stp #6, STRAT_S mov #0, lmove jmp go6+2 setr stp #-1, STRAT_S stp #6, RAND_S mov.a #3, last jmp fine, >round seta stp #113, STRAT_S ;the enemy probably is Anders mov.a #1, last jmp fine, >round set4 stp #4, STRAT_S mov.a #2, last jmp fine, >round first mov.a #1, last jmp fine, >round second sne #1, res jmp set347a ;if win set 347a mov.a #2, last ;else don't set any strat yet jmp fine, >round third sne #2, res jmp set28 sne #1, res jmp set169 jmp set50 fine stp.ab last, M123_S stp.b round, RND_S last mov #1, my_hand ;---END-VARIABLE PART------------------------------------------------------- ; End of variable part. I wait for the other player to show his hand. ; I then analyze the outcome of the game. ; wait jmz.b wait,your_hand work mov.b your_hand,#work sub.b my_hand,work ;your_hand minus my_hand, loss=1,-2 add #2,work ;loss=3,0 mod #3,work ;loss=0 live jmn live,work ;die if lost, live if won or tied end