From news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!Supernews60!supernews.com!uunet!in3.uu.net!comp.vuw.ac.nz!paramount.mcs.vuw.ac.nz!amarsden Mon Feb 23 14:48:43 1998 Article: 8420 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!Supernews60!supernews.com!uunet!in3.uu.net!comp.vuw.ac.nz!paramount.mcs.vuw.ac.nz!amarsden From: Anton Marsden Newsgroups: rec.games.corewar Subject: Anton's CW Tournament Round 3 Warriors Date: Mon, 23 Feb 1998 11:50:38 +1300 Organization: School of Mathematical and Computing Sciences, VUW Lines: 358 Message-ID: NNTP-Posting-Host: kaukau.mcs.vuw.ac.nz Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cache-Post-Path: kaukau.mcs.vuw.ac.nz!unknown@paramount.mcs.vuw.ac.nz X-Cache: nntpcache 2.3.2.1 (see http://www.nntpcache.org/) ;redcode-94 ;name Fern 1c ;author Ilmari Karonen ;strategy ** Anton's Core War Tournament round 3 entry ** ;strategy I hope this one's something a bit different: ;strategy A fractal fern, created using a simple random ;strategy bounce algorithm. ;strategy Best viewed with: "pmarsv -b -v 114 fern1c.red" ;strategy I used the 286 version, but it should work on ;strategy others as long as the line width is the same. ;author Ilmari Karonen ;history 1b - works, fixed a math bug ;history 1c - looks a lot nicer ;date Aug 22, 1997 ;planar boot, other ;assert CORESIZE == 8000 ; Line width: WIDTH equ 154 ; Screen attributes: HEIGHT equ ((CORESIZE-MAXLENGTH)/WIDTH) XDISP equ (WIDTH/2) ; Probabilities of different parts: prb01 equ 4560 prb02 equ 1639 prb03 equ 1639 prb04 equ (CORESIZE-prb01-prb02-prb03) ; 162 ; Magic constants for RNG: magic equ 4221 seed equ (prb01+prb02) ; Boot distance: away equ (bptr-dest) org start ; Boot: start mov.i >dest, >bptr ; will overwrite itself bptr jmp start, #away ; Scaling constants: mulc01 dat #7, #7 divc01 dat #10, #10 mulc02 dat #3, #1 divc02 dat #5, #4 addc02 dat #XDISP-((HEIGHT*3)/5), #HEIGHT-((HEIGHT*1)/4)+((XDISP*1)/4) mulc03 equ mulc02 divc03 equ divc02 addc03 dat #XDISP+((HEIGHT*3)/5), #HEIGHT-((HEIGHT*1)/4)-((XDISP*1)/4) mulc04 dat #0, #3 divc04 equ divc01 addc04 dat #XDISP, #HEIGHT-((HEIGHT*3)/10) ;limits dat #WIDTH, #HEIGHT ; Pseudorandom number generator: rand = (rand*magic+1)%CORESIZE rand mul.ab #magic, #seed ; Part selector: select slt.ab #prb01, rand jmp move01, >rand jmn.f 1, @rand ; ground slt.ab #prb01+prb04, rand jmp move04, >rand mov.a #XDISP-((XDISP*7)/10), addc01 slt.ab #prb01+prb04+prb02, rand jmp move02, >rand ; Part 3 - right leaf move03 coord mov.x #XDISP, #HEIGHT mul.f mulc03, coord div.f divc03, coord mul.a #-1, coord add.f addc03, coord jmp plot, >rand ; Part 4 - stem: move04 mov.a #XDISP-((XDISP*7)/10), addc01 mul.f mulc04, coord div.f divc04, coord add.f addc04, coord jmp plot ; Part 1 - top: move01 mul.f mulc01, coord div.f divc01, coord addc01 add.a #XDISP-((XDISP*7)/10), coord jmp plot, {addc01 ; Part 2 - left leaf move02 mov.x coord, coord mul.f mulc02, coord div.f divc02, coord mul.ab #-1, coord add.f addc02, coord ; Plot coordinates: plot ;mod.f limits, coord ; safety jmz.b move04, coord ; kluge mov.b coord, dest mul.ab #WIDTH, dest add.ab coord, dest dest djn.b rand, >bptr+1 ; bfield used as boot ptr end ;To see the starfield please run pMARS like this: ;PMARSV.EXE PStars.red -v 011 -c 999999999 ;If know, the colours arn't that good. It would have been better ;do the animation over several rounds. ;This is propably my last entry for this tournament because I'm ;going to stay a term in London and I don't know if I'm able to ;do Core War there. Thank you for the great tournament, Philipp ;name PStars v1.0 ;author Philipp Offermann ;strategy Starfield ;url http://home.t-online.de/home/offermann ;assert CORESIZE==8000 org clear l equ 158 laenge equ (ende-empty+1) speed equ 8000 ;If the simulation runs to slow ;you may use a smaller value! empty dat.f -1,1 d jmp.a 0,0 stars jmp.a -(l*30+70+1),l*30+70 jmp.a -(l*34+57+1),l*34+57 jmp.a -(l*6+84+1),l*6+84 jmp.a -(l*8+74+1),l*8+74 jmp.a -(l*8+138+1),l*8+138 jmp.a -(l*38+124+1),l*38+124 jmp.a -(l*11+33+1),l*11+33 jmp.a -(l*19+109+1),l*19+109 jmp.a -(l*13+154+1),l*13+154 jmp.a -(l*46+71+1),l*46+71 jmp.a -(l*30+150+1),l*30+150 jmp.a -(l*47+135+1),l*47+135 jmp.a -(l*39+145+1),l*39+145 jmp.a -(l*49+110+1),l*49+110 jmp.a -(l*24+46+1),l*24+46 jmp.a -(l*18+141+1),l*18+141 jmp.a -(l*45+141+1),l*45+141 jmp.a 0,0 jmp.a -(l*45+36+1),l*45+36 jmp.a -(l*27+104+1),l*27+104 jmp.a -(l*34+108+1),l*34+108 jmp.a -(l*22+122+1),l*22+122 jmp.a -(l*22+135+1),l*22+135 jmp.a -(l*22+5+1),l*22+5 jmp.a -(l*12+25+1),l*12+25 jmp.a -(l*31+103+1),l*31+103 jmp.a -(l*4+19+1),l*4+19 jmp.a -(l*6+139+1),l*6+139 jmp.a -(l*24+141+1),l*24+141 jmp.a -(l*37+14+1),l*37+14 jmp.a -(l*23+83+1),l*23+83 jmp.a -(l*43+32+1),l*43+32 jmp.a -(l*11+88+1),l*11+88 jmp.a -(l*2+71+1),l*2+71 jmp.a -(l*2+60+1),l*2+60 jmp.a 0,0 jmp.a -(l*44+52+1),l*44+52 jmp.a -(l*40+54+1),l*40+54 jmp.a -(l*4+43+1),l*4+43 jmp.a -(l*3+118+1),l*3+118 jmp.a -(l*4+15+1),l*4+15 jmp.a -(l*22+94+1),l*22+94 jmp.a -(l*34+42+1),l*34+42 jmp.a -(l*48+14+1),l*48+14 jmp.a -(l*39+24+1),l*39+24 jmp.a -(l*32+152+1),l*32+152 jmp.a -(l*9+43+1),l*9+43 jmp.a -(l*32+98+1),l*32+98 jmp.a -(l*9+83+1),l*9+83 jmp.a -(l*36+111+1),l*36+111 jmp.a -(l*48+148+1),l*48+148 jmp.a -(l*23+113+1),l*23+113 jmp.a -(l*14+16+1),l*14+16 jmp.a 0,0 jmp.a -(l*24+112+1),l*24+112 jmp.a -(l*18+19+1),l*18+19 jmp.a -(l*31+68+1),l*31+68 jmp.a -(l*30+130+1),l*30+130 jmp.a -(l*12+13+1),l*12+13 jmp.a -(l*21+6+1),l*21+6 jmp.a -(l*49+53+1),l*49+53 jmp.a -(l*6+143+1),l*6+143 jmp.a -(l*37+25+1),l*37+25 jmp.a -(l*4+21+1),l*4+21 jmp.a -(l*34+154+1),l*34+154 jmp.a -(l*15+59+1),l*15+59 jmp.a -(l*6+153+1),l*6+153 jmp.a -(l*22+123+1),l*22+123 jmp.a -(l*42+21+1),l*42+21 jmp.a -(l*16+70+1),l*16+70 jmp.a -(l*8+15+1),l*8+15 wo dat.f stars,0 sdec jmp.a -(l+1),l cinc dat.f -1,1 cjump jmp.a -(ende+1-wo),ende+1 clear mov.i cjump,@cjump spl.a @cjump add.f cinc,cjump djn.b clear,#CORESIZE-laenge init mov.a #stars-wo,wo sub.f cinc,cinc schneller add.f empty,cinc anim mov.i *wo,d mov.i d,@d spl.a @d add.f cinc,d slt.b d,#7900 mov.i sdec,d mov.i wo,@d spl.a @d mov.i d,}wo jmn.b anim,}wo djn.b schneller,#4 mov.ab #4,-1 djn.b 0,#speed mov.ab #speed,-1 ende jmp.a init end ;redcode-94 ;name Life ;author Philip Kendall ;assert CORESIZE==8000 ;planar other width equ 13 height equ 13 first equ (2092-CURLINE) line equ 158 die equ (first-2) main mov.ab #(first-param1),param1 mov.ab #height,count32 loop32 mov.ab #width,count31 loop31 jmz.a count31,>param1 sub.ab #(line+2),param1 mov.ab #3,count12 loop1 mov.ab #3,count11 param1 nop.f >0,>0 count11 djn.b param1,#0 add.ab #(line-3),param1 count12 djn.b loop1,#0 sub.ab #(2*line-2),param1 count31 djn.b loop31,#0 add.ab #(line-width),param1 count32 djn.b loop32,#0 mov.ab #(first-param2),param2 mov.ab #height,count42 loop42 mov.ab #width,count41 loop41 mov.ab #0,storage param2 jmz.a 2,0 seq.ab #4,@param2 sne.ab #3,@param2 storage mov.ab #1,#0 jmn.b alive1,storage mov.i dead,@param2 jmp.a 3 alive1 mov.i alive,@param2 sub.ba param2,@param2 spl.a >param2 count41 djn.b loop41,#0 add.ab #(line-width),param2 count42 djn.b loop42,#0 jmp.a main dead dat.f 0,0 alive jmp.a (die-param2),0 start mov.i alive,(first+0*line+1) mov.i alive,(first+1*line+2) mov.i alive,(first+2*line+0) mov.i alive,(first+2*line+1) mov.i alive,(first+2*line+2) jmp.a main end start ;redcode ;name fireworks ;author Brian Haskin ;strat draw fireworks ;strat runs with a -v of 714 ;strat the width of the display should be 158 instructions ;assert CORESIZE==8000 org star first equ 2880 fcirc equ 1800 row equ 158 sinc dat 1041,1041 ;567,567 sptr dat star,star cinc dat 521,521 cptr dat circ,circ star mov first,first+row+1 mov star+first+row-1,star+first-row-1 mov star+first-row+1,star+first+(row*2)+2 mov star+first-(row*2)-2,star+first-(row*2)+2 mov star+first-(row*3)+3,star+first+(row*2)-2 mov star+first+(row*3)+2,star+first-(row*3)+4 mov star+first+(row*3)-2,star+first-(row*3)-3 mov star+first+(row*4)-3,star+first+(row*4)+3 mov star+first-(row*3)-4,star+first+(row*6)-3 mov star+first+(row*6)+3,star+first-(row*2)-5 mov star+first-(row*2)+5,star+first add.f sinc,>sptr djn -1,#11 mov #11,-1 mov.ab sptr,sptr djn 0,#2000 mov #2000,-1 circ sne fcirc-row,fcirc+row sne circ+fcirc-1,circ+fcirc+1 sne circ+fcirc+(row*2)+2,circ+fcirc+(row*2)-2 sne circ+fcirc-(row*2)+2,circ+fcirc-(row*2)-2 sne circ+fcirc+3,circ+fcirc-3 sne circ+fcirc+(row*3),circ+fcirc-(row*3) sne circ+fcirc+5,circ+fcirc-5 sne circ+fcirc+(row*5),circ+fcirc-(row*5) sne circ+fcirc+(row*4)+4,circ+fcirc-(row*4)-4 sne circ+fcirc+(row*4)-4,circ+fcirc-(row*4)+4 add.f cinc,>cptr djn -1,#10 mov #10,-1 mov.ab cptr,cptr djn 0,#2000 mov #2000,-1 djn star,#20 end