Article View: rec.games.corewar
Article #282Magic Numbers & Killing Imps
From: pk6811s
Date: Sat, 19 Dec 1992 19:52
Date: Sat, 19 Dec 1992 19:52
56 lines
2927 bytes
2927 bytes
There are magic numbers and then there are magic numbers. The only
characteristic that the posted 'magic' numbers have is the ability
to reduce large free-space gaps to small chunks efficiently. This
is a useful function, but there are other features that may be
desirable.
Let's say your program is 12 lines long, and you can't
stand to drop one of your own bombs on yourself; either you check
before bombing, or you look for a bombing increment that reduces
free-space gaps rapidly to 12's, then cuts them all in half. Of
course you position your program in the last such space, and
enter your core-clear just before the bomb hits.
Or maybe you can stand a single bomb on line 5 of the code. Then
you want an increment that reduces free-space to 7's, allowing
one bomb on line 5, then continue bombing until just before
another line is bombed.
Now let's talk about killing imps. We know if we bomb with an
increment of 2667 we can run down imps from behind - given enough
time. But there are other numbers that also work, like 889. In fact
there are a host of numbers that run down imps, if they are moving
slowly enough. Since the top imp-programs use a stone component
that gobbles up most of the cycles, the imp-rings themselves are moving
very slowly. What you want is an increment that shortly after
bombing location N, also bombs location N+2667. Of course,
if you kill the stone component, the imps will run faster and
you may not catch them.
Then again, if you are dropping stun-bombs you increase your chances
greatly. If you stun the stone, or happen to catch the tail of
the imp, the imp-rings will slow to a crawl, maybe give a twitch
every thousand cycles or so, allowing time to drop lots of
bombs before returning to N+2667. Here's a little basic program
to find increments that eventually get around to N+2667:
FOR I=11 TO 4000
FOR J=0 TO 50
K=(J*8000)+2667
IF K MOD I = 0 THEN PRINT I,K/I
NEXT J
NEXT I
You'll need to use double-word integers to hold K. The number K/I
tells how many bombs you'll drop between N and N+2667.
Other numbers that could be explored are N+5334, N-2667, and N-5334.
Note that to use this strategy, you will have to bomb/scan for a
-very- long time, to make sure all the MOV 0,2667 instructions are
hit. Can't afford to miss one!
* * * * * * Merry Christmas to All * * * * * *
Paul Kline
pk6811s@acad.drake.edu
Technical Details
Message-ID:
<1992Dec19.135237.1@acad.drake.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!uwm.edu!caen!destroyer!news.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811sShow Full Headers
Complete Article Headers
Newsgroups: rec.games.corewar Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!uwm.edu!caen!destroyer!news.iastate.edu!dunix.drake.edu!acad.drake.edu!pk6811s From: pk6811s@acad.drake.edu Subject: Magic Numbers & Killing Imps Message-ID: <1992Dec19.135237.1@acad.drake.edu> Lines: 56 Sender: news@dunix.drake.edu (USENET News System) Nntp-Posting-Host: acad.drake.edu Organization: Drake University, Des Moines, Iowa, USA Date: Sat, 19 Dec 1992 19:52:37 GMT