Learning to learn...

G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

Hello all,

I've been reading some corewar info for now, and decided that it would
be nice to study some expert code for broading my horizons (or should I
begin coding right away?).

I picked Reepicheep [1] to start, but I wonder if it's a good starting
choice (maybe there are other more instructive warriors). The quickscan
part is bold (for me at least), but I could learn many nice tricks.

I've read the Corewar Book [2], but it doesn't cover Papers and
Quickscanners (I've read an intro about papers somewhere else I can't
remember now).

I've recently found the Corewarrior Index [3], but as for Reepicheep,
you may have some recomendations; I'm asking for them.

Thanks in advance,

--
Ítalo Cunha.

References:

[1] Reepicheep, Grabun/Metcalf
http://www.ociw.edu/~birk/COREWAR/TOP50/HILL/reepicheep.red

[2] Corewar Book, Chapter 1, Steven Morell
http://www.ociw.edu/~birk/COREWAR/DOCS/chapter1.txt

[3] Corewarrior Index
http://www.srcf.ucam.org/~pak21/corewar/warrior.html
 
G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

On Mon, 12 Apr 2004 14:53:28 -0300, Italo Fernando Scota Cunha wrote:

> I've been reading some corewar info for now, and decided that it would
> be nice to study some expert code for broading my horizons (or should I
> begin coding right away?).

Studying warrior's code and trying to modify it (which may or may
not mean improving it) is the best way, IMO, to learn redcode. Thus, a
really good beginning, I think.

> I picked Reepicheep [1] to start, but I wonder if it's a good starting

Very good choice :))

> choice (maybe there are other more instructive warriors). The quickscan
> part is bold (for me at least), but I could learn many nice tricks.

As far as you want to hear my opinnion: simplest warriors are
stone/imps. Reepicheep is a stone/paper - this combo *may* sound a bit
weird for a newbie and its effectiveness may confuse as well. But in
stone/imp combo you know what to expect: to beat scanner, shrug off
papers attack, tie (or win, depending on warrior tactique and scheme)
with other s/i. Stones are good warriors to start your voyage from as
there are many tutorials one can read: Morrell's book, my own article
on Carbonite, Joonas' paper about Skew Dwarf and Core Warrior issues.

Papers, OTOH, are througtly covered in Fizmo's lexicon so you may
also find this worth looking at. However, papers are somewhat dumb and
except optimization they do not need any serious treatment. Not much
to learn here.

Scanners are most complicated warriors as many hidden tricks are
programmed in the code. I don't think a good tutorial has been written
yet.

> I've read the Corewar Book [2], but it doesn't cover Papers and
> Quickscanners (I've read an intro about papers somewhere else I can't
> remember now).

It does not. Papers are described in aforementioned Fizmo's lexicon,
whilst Quickscanners were covered in one of recent CW issues.

> I've recently found the Corewarrior Index [3], but as for Reepicheep,
> you may have some recomendations; I'm asking for them.

Write a warrior and post its source. We will provide you with few
tips, you may be positive about that. :)

Welcome to the newsgroup and our small geeky society. :)

--
Lukasz Grabun (My CW page: http://www.corewar.ehost.pl/)
(reply-to field is fake, use grabek (at) acn dot waw dot pl to reply)
 
G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

Lukasz Grabun <grabek@purgatory.abyss> wrote in message news:<slrn.pl.c7lvdn.qtr.grabek@purgatory.abyss>...

Wow! that is interesting! What are papers and quickscanners? i am
guessing that scanners check the core for bombs or something.

Also what are stones/imps and stuff?
 
G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

cj_lukas@hotmail.com (Chris Lukas) wrote in message news:<99b21fb3.0404121852.412b6c38@posting.google.com>...
> Lukasz Grabun <grabek@purgatory.abyss> wrote in message news:<slrn.pl.c7lvdn.qtr.grabek@purgatory.abyss>...
>
> Wow! that is interesting! What are papers and quickscanners? i am
> guessing that scanners check the core for bombs or something.
>
> Also what are stones/imps and stuff?


yes, you are right. scaner check the core befor doing something. a
very easy scaner is this one:


org start

start seq v, v+1 ;compares to lines
mov v, @start ; and skips this instruction if they are equal
; otherwise it moves the bomb to the compared field

;then it should compare the next instruction
;therefore it should change the b-field of "start" and go back to
start
add #1, start
jmp start

;this is the line which every other line is compared with
v dat 0, 0


a guess this is the basic information to understand scaners.

but how could i explain quickscaners easily? let's try it this way:
quickscaners are a special type of scaners which dont uses loops like
the simple scaner above. the instructions are written right behind
another like this:
seq v, v+1
mov v, @-1
seq v, v+2
mov v, @-1
seq v, v+3
mov v, @-1
.... and so one. therefore quickscaners used to be bigger but much
faster than others.


papers are warriors which replicate itselfs. it's very hard to
understand for beginners.

stones are warriors which throw bombs. (i guess you already know the
dwarf) and you should already know about imps (mov 0,1) too.

el kauka
 
G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

kaukasius@yahoo.de (el kauka) wrote in message news:<f889e2e6.0404130401.2d34a807@posting.google.com>...
> cj_lukas@hotmail.com (Chris Lukas) wrote in message news:<99b21fb3.0404121852.412b6c38@posting.google.com>...
> > Lukasz Grabun <grabek@purgatory.abyss> wrote in message news:<slrn.pl.c7lvdn.qtr.grabek@purgatory.abyss>...
> >
> > Wow! that is interesting! What are papers and quickscanners? i am
> > guessing that scanners check the core for bombs or something.
> >
> > Also what are stones/imps and stuff?
>
>
> yes, you are right. scaner check the core befor doing something. a
> very easy scaner is this one:
>
>
> org start
>
> start seq v, v+1 ;compares to lines
> mov v, @start ; and skips this instruction if they are equal
> ; otherwise it moves the bomb to the compared field
>
> ;then it should compare the next instruction
> ;therefore it should change the b-field of "start" and go back to
> start
> add #1, start
> jmp start
>
> ;this is the line which every other line is compared with
> v dat 0, 0
>
>
> a guess this is the basic information to understand scaners.
>
> but how could i explain quickscaners easily? let's try it this way:
> quickscaners are a special type of scaners which dont uses loops like
> the simple scaner above. the instructions are written right behind
> another like this:
> seq v, v+1
> mov v, @-1
> seq v, v+2
> mov v, @-1
> seq v, v+3
> mov v, @-1
> ... and so one. therefore quickscaners used to be bigger but much
> faster than others.
>
>
> papers are warriors which replicate itselfs. it's very hard to
> understand for beginners.
>
> stones are warriors which throw bombs. (i guess you already know the
> dwarf) and you should already know about imps (mov 0,1) too.
>
> el kauka

so mine would be a stone? (iit throws bombs)
;start
mov 5, -1
mov 4, 5
add #-2, -2
add #2, -2
jmp -4
dat #0, #0
;end
 
G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

A usual scan loop uses a 'seq' or 'sne' instruction for scan, but also
needs 'add' to increase pointers in steps and a jumping instrucion,
(jmp, djn, jmn...), to close the loop.
Qscans are a secuence of 'seq' and 'sne' instructions with no loop
wich allows to scan extremely fast: 2c (2 scanned locations per
cycle). But not looping means that you have a big piece of code and
only a few scanned locations. Quickscanners are used as an initial
fast scan and then, the main strategy is booted away, leaving the
Qscan and the boot code as a decoy.

> > seq v, v+1
> > mov v, @-1
> > seq v, v+2
> > mov v, @-1
> > seq v, v+3
> > mov v, @-1
> > ... and so on. therefore quickscaners used to be bigger but much
> > faster than others.

Well, modern Qscans look like this:

qGo sne ;\
seq ;/ scans and skip the jmp if nothing was detected
jmp ;jumps to the decoder
sne
seq
jmp ;(or djn...)

The decoder is a piece of code that calculates wich of the scans
detected something, and then a bombing loop performs the attack.

Quickscanners are really tricky. A Q^3 Qscan can be cut and pasted.

> >
> > papers are warriors which replicate itselfs. it's very hard to
> > understand for beginners.

Bah, not so much.
Just think of a program that makes two or three copies of itself. Also
every copy is making copies, ovewritting all the core after a while.
They usually containg mov instructions for bombing, making them more
agressive.
Modern papers use the silk-engine.
spl 1 ; a basic paper
spl 1 ; using 4 paralel processes. As many as instructions the paper
has.
spl 1250,0 ; The paper itself
mov >-1,}-1
mov <-2,{1
jmp 350


> so mine would be a stone? (iit throws bombs)
> ;start
> mov 5, -1
> mov 4, 5
> add #-2, -2
> add #2, -2
> jmp -4
> dat #0, #0
> ;end

Yes, yours is a 0.4c stone.

Try this:
step equ (19*5) ;mod 5 constant. Can be just 5
loop: mov bmb,@ref
ref: mov bmb,@bmb+step
add #step,ref
jmp loop,<loop-3 ;decrements can kill incoming imps
bmb: dat 0,2*step ;the bomb carries a pointer

You can increase the anti-imp cappability by this:

step equ (19*5) ;mod 5 constant. Can be just 5

bmb: dat step,0
dat 0,0
dat 0,0
loop: mov >bmb,@ref ; '>' and '<' can damage/kill imps
ref: mov <bmb,*3 ;also }3+step or { acts as core clear after
killing imp
add #2*step,ref
jmp loop,<loop-3 ;decrements can kill incoming imps
end loop

There are many tricks to improve stones and bombers, like
self-splitting, mutation, adding imps, self-check/airbag...

You'll find many different stones and other strategies and hints in
the Corewarrior issues.

Neogryzor
 
G

Guest

Guest
Archived from groups: rec.games.corewar (More info?)

I'll finish understanding Reepicheep then, I'll read the cited
references for background. Thank you very much.

I'm thinking about building a webpage about it's workings; let's wait
and see if I can get some time for this.

Thanks for the welcoming message.

--
Ítalo Cunha.

Lukasz Grabun wrote:
> On Mon, 12 Apr 2004 14:53:28 -0300, Italo Fernando Scota Cunha wrote:
>
>
>>I've been reading some corewar info for now, and decided that it would
>>be nice to study some expert code for broading my horizons (or should I
>>begin coding right away?).
>
>
> Studying warrior's code and trying to modify it (which may or may
> not mean improving it) is the best way, IMO, to learn redcode. Thus, a
> really good beginning, I think.
>
>
>>I picked Reepicheep [1] to start, but I wonder if it's a good starting
>
>
> Very good choice :))
>
>
>>choice (maybe there are other more instructive warriors). The quickscan
>>part is bold (for me at least), but I could learn many nice tricks.
>
>
> As far as you want to hear my opinnion: simplest warriors are
> stone/imps. Reepicheep is a stone/paper - this combo *may* sound a bit
> weird for a newbie and its effectiveness may confuse as well. But in
> stone/imp combo you know what to expect: to beat scanner, shrug off
> papers attack, tie (or win, depending on warrior tactique and scheme)
> with other s/i. Stones are good warriors to start your voyage from as
> there are many tutorials one can read: Morrell's book, my own article
> on Carbonite, Joonas' paper about Skew Dwarf and Core Warrior issues.
>
> Papers, OTOH, are througtly covered in Fizmo's lexicon so you may
> also find this worth looking at. However, papers are somewhat dumb and
> except optimization they do not need any serious treatment. Not much
> to learn here.
>
> Scanners are most complicated warriors as many hidden tricks are
> programmed in the code. I don't think a good tutorial has been written
> yet.
>
>
>>I've read the Corewar Book [2], but it doesn't cover Papers and
>>Quickscanners (I've read an intro about papers somewhere else I can't
>>remember now).
>
>
> It does not. Papers are described in aforementioned Fizmo's lexicon,
> whilst Quickscanners were covered in one of recent CW issues.
>
>
>>I've recently found the Corewarrior Index [3], but as for Reepicheep,
>>you may have some recomendations; I'm asking for them.
>
>
> Write a warrior and post its source. We will provide you with few
> tips, you may be positive about that. :)
>
> Welcome to the newsgroup and our small geeky society. :)
>