Redcoders Frenzy 20 : The "Frankenstein" Round

G

Guest

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

...................................................................
.
_____ _ _ .
| __ \ | | | | .
| |__) |___ __| | ___ ___ __| | ___ _ __ ___ .
| _ // _ \/ _` |/ __/ _ \ / _` |/ _ \ '__/ __| .
| | \ \ __/ (_| | (_| (_) | (_| | __/ | \__ \ .
|_| \_\___|\__,_|\___\___/ \__,_|\___|_| |___/ .
.
______ .
| ____| .
| |__ _ __ ___ _ __ _____ _ .
| __| '__/ _ \ '_ \|_ / | | | .
| | | | | __/ | | |/ /| |_| | .
|_| |_| \___|_| |_/___|\__, | .
__/ | .
|___/ .
...................................................................

The ongoing corewar tournament

____ ____
|__ \ / __ \
) | / \ |
/ /| | | |
/ /_| \__/ |
|___________/


.............................................
. .
. The Code Creator's "Frankenstein" Round .
. .
.............................................


This is the 20th round of the ongoing corewar tournament. Further
information are available on Fizmo's Corewar Info Page:

http://www.corewar.info/tournament/cwt.htm

The "Frankenstein" Round homepage is:

http://www.corewar.info/tournament/20.htm

...................................................................
_ .
_ _ _ _| |___ ___ .
| '_| || | / -_|_-< .
|_| \_,_|_\___/__/ .
.
...................................................................

Hill spec:

Coresize : 8000
Maxprocess : 8000
Cycles : 80000
Lenght : 100+
Distance : 500
Rounds : 250 Round Robin
pSpace : 500

Two entry's for each participant.

I hope this round is tricky enough to break the Summerhole of CW.

For your entry you can choose one of three instruction-pools.
Out of this pool you must create a Warrior. In the creators code all
instruction are allowed, but the a-field (the source) must always be
one of the instructionpools labels ( PA1, PB1, PC4 etc ). Note the
magic of the immediate-adressing !

Example:

mov.i $PB1,label+2

or

add.ab *PB4,label+9


Exception from this is the p-switcher code.

If your first instruction is called start, then between start and
start+500 you can do anything you want. But after start+500 until
start only read-access is allowed. Note that predrement or
postinkrement reading is even a write-access.

Shortcut's

Instruction-pool-instruction : A
Creator-code-instruction : B
Created-warrior-instruction : C


The last instruction of the creator must be a

jmp $....

At the moment the execution is on this instruction all instructions A
and B, except the jmp-instruction must be deleted. It's allowed to
overwrite A or B with C. It's allowed to embed A in C. Means

CCCCCCCAACCCCCC

is allowed.

For each entry you have 15 actionpoints (AP). After choosing and
copy'n'paste the pool to your source you can do some changes at it.
Take the possible change and it's cost from the list below.

======= I M P O R T A N T =====================

Each not used AP will be added to entry's score

===============================================

Actions:

============================================

Flip modifier : A -> B -> A
AB -> BA -> AB
F -> X -> F
Cost 2 AP

============================================

Flip adressing mode : # -> $ -> #
* -> @ -> *
{ -> } -> {
< -> > -> <

Cost 2 AP

============================================

Flip instruction : add -> sub -> add
seq -> sne -> seq
jmz -> jmn -> jmz
div -> mul -> div
dat -> nop -> dat

Cost 4 AP

============================================

Change modifier : Cost 3 AP
Change addressing mode : Cost 4 AP
Change instruction : Cost 9 AP

============================================

Swap two constants : Cost 2 AP
Swap two instructions : Cost 3 AP

============================================

Increase entry's length for 5 instruktions : Cost 2 AP

============================================

Save B-instruction from clear : Cost 1 AP
( Last means that more than the jmp-instruction can be visible at the
end of creators code ). Example

Use this action two times, it's allowed that following snippet is
visible

spl 1
spl 1
spl 1
jmp $...

============================================

Please comment each action in your entry's source.

Example:

;Flip modifier of A-field PB01 : n points
;Swap constants A😛B04 with B😛B03 : n points
;Change instruction PB8 to spl : n points

Here are the pool's ( Please copy'n'paste )

; ========================
; Pool A - 10 Instructions
; ========================

PA00 spl $ 199 , # 17
PA01 jmp @ 11 , < 47
PA02 mov.i * -3 , } -3
PA03 mul.ab # 367 , $ 0
PA04 spl @ -10 , # 10
PA05 mov.i > 2667 , } -5
PA06 mov.i # 1143 , $ -2
PA07 mod.f $ -1 , $ 16
PA08 sne.b $ 22 , $ 3044
PA09 sub.a $ 0 , $ 2365

; ========================
; Pool B - 15 Instructions
; ========================

PB00 spl @ 1 , # 2667
PB01 mov.i # 2 , * 1143
PB02 dat < 3 , < 889
PB03 sne.i < 1000 , @ 1006
PB04 seq.i < 4 , $ 17
PB05 add.f $ 5 , $ 7
PB06 jmp @ 6 , < 61
PB07 jmz.f $ -6 , > 95
PB08 mov.i * -5 , < 13
PB09 djn.b $ -4 , # 0
PB10 spl # 3044 , # 2365
PB11 mov.ab < -3 , $ 12
PB12 slt.a $ -3 , $ -9
PB13 mov.i > -2 , } -8
PB14 jmp $ -1 , { -7

; ========================
; Pool C - 25 Instructions
; ========================

PC00 spl @ 3077 , # 2
PC01 spl $ -3 , # 3
PC02 mov.i > -1 , } -1
PC03 mov.i } 22 , > 5
PC04 dat < 2667 , < 5334
PC05 mov.ab # 0 , > 7
PC06 sne.i $ 3044 , $ 3364
PC07 sne.x $ 20 , $ 11
PC08 seq.f * 1143 , * 13
PC09 seq.b $ 1203 , < 17
PC10 mov.i $ 2376 , $ -7
PC11 mov.ab $ 4 , @ 19
PC12 jmz.f $ 1 , $ 23
PC13 djn.x $ 1111 , < 29
PC14 djn.a $ -4 , # 1000
PC15 spl # 12 , # 31
PC16 add.ba # 2365 , $ -3
PC17 add.x $ 0 , $ 37
PC18 slt.a $ 889 , $ (joker)
PC19 jmp $ -2667 , $ 41
PC20 mul.ab # -8 , $ 43
PC21 mov.i # 3315 , * 47
PC22 mov.i # -1 , $ 53
PC23 spl $ (joker) , < 2936
PC24 jmn $ -2 , @ 59

* (joker) constants can be choosed by you.

...................................................................
_ _ _ _ .
__| |___ __ _ __| | (_)_ _ ___ .
/ _` / -_) _` / _` | | | ' \/ -_) .
\__,_\___\__,_\__,_|_|_|_||_\___| .
.
...................................................................

September 18, 2004

Please don't send entries before September 1, 2004 because i would
take part too.

--------------------------------------------------------------
Please notify: You have to send your entries to Sascha Zapf
(nc-zapfsa@netcologne.de)
--------------------------------------------------------------

This round is dedicated to Son of Vain - the most famous warrior
in CW's history



Good luck, may be the core with you!
--
Parlez vous Redcode?
 
Archived from groups: rec.games.corewar (More info?)

The rules are a bit complicated, and I'm sure I didn't get them right..
Maybe you could post an example warrior (not necessarily competitive)
that would demonstrate them?

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

Michal Janeczek wrote:

> The rules are a bit complicated, and I'm sure I didn't get them right..
> Maybe you could post an example warrior (not necessarily competitive)
> that would demonstrate them?
>
> Michal

Howdy,

here is an examplewarrior, he wouldn't take part, it's not one of my
entry's.

He creates a little stone, should not score so good, but is created
very fast. 10 AP are saved, so the score would be raised by 10 Points
after the fight.

In the moment when the jmp position would be executed only the jmp and
the dat ( which is the result of an action ) are left from creators
code and the pool )

You can clear like you want. I know it's hard to clear anything
without leaf any instruction..But you can buy one or two instructions
for leave left. But if you can, you should try to kill anything.

It doesn't matter how many process are on the jmp-instruction.

So, insert the pool in your code, and do the changes you need. Please
comment them like i have done.

Any questions are welcome

Sascha


;redcode-rf20
;name stoneclone
;author clonestone
;strategy kind of stone
;assert CORESIZE==8000

position EQU start + 400 ;position of the created Warrior


start mov.i $PA00, position
mov.i $PA02, position+1
sub.f $PA09, position+1
mov.i $PA09, position+2
mov.ab $PA07, position+2
mov.a $PA02, position+2

; created the warrior, now clear anything

spl 2
spl 1
spl 1
spl 1
mov.i start-1,>jl ; to get rid of the code pool
mov.i start-1,>ptr
jl jmp position, PA00
ptr dat 0,start


; ========================
; Pool A - 10 Instructions
; ========================

PA00 spl # 199 , # 17
PA01 jmp @ 11 , < 47
PA02 mov.i * -3 , } -3
PA03 mul.ab # 367 , $ 0
PA04 spl @ -10 , # 10
PA05 mov.i > 2667 , } -5
PA06 mov.i # 1143 , $ -2
PA07 mod.f $ -1 , $ 16
PA08 sne.b $ 22 , $ 3044
PA09 sub.b $ 0 , $ 2365

; List of actions i have done.

;1) Flip A-Field adressing of PA00 : 2 AP
;2) Flip Modifier of PA09 : 2 AP
;3) Save 1 instruction of the creator : 1 AP

end start


--
Parlez vous Redcode?
 
Archived from groups: rec.games.corewar (More info?)

Please correct me. I know I still missing something:

STEP 1 - select either instruction pool A, B or C
STEP 2 - create a warrior out of this at other cores. Use the given
rules.
STEP 3 - make sure use only 15 AP
STEP 4 - delete the instruction pool and creation code instuction
STEP 5 - execute the created codes and win the round (step 5 can be
parallel to step 4)
 
Archived from groups: rec.games.corewar (More info?)

Zul Nadzri wrote:

> Please correct me. I know I still missing something:
>
> STEP 1 - select either instruction pool A, B or C
> STEP 2 - create a warrior out of this at other cores. Use the given
> rules.
> STEP 3 - make sure use only 15 AP
> STEP 4 - delete the instruction pool and creation code instuction
> STEP 5 - execute the created codes and win the round (step 5 can be
> parallel to step 4)

Step 5 must be after Step 4, the instruction pool and the creation code must
be deleted when jmp to the created code. ( Exception : If you have used
some AP to save creationcode instruction from deleting.

Note: Step 3: For each AP you don't use, your score will be increased by 1
Point.

Sascha

--
Parlez vous Redcode?
 
Archived from groups: rec.games.corewar (More info?)

> start mov.i $PA00, position
> mov.i $PA02, position+1
> sub.f $PA09, position+1
> mov.i $PA09, position+2
> mov.ab $PA07, position+2
> mov.a $PA02, position+2

So this is "Creator Code" and has to have A fields pointing into pool.
Could it also point B fields into the pool, and make changes, like
MOV.x $PA00, $PA00 or
NOP $PA00, <PA00 ?

> spl 2
> spl 1
> spl 1
> spl 1
> mov.i start-1,>jl ; to get rid of the code pool
> mov.i start-1,>ptr
> jl jmp position, PA00
> ptr dat 0,start

This doesn't have restricted A fields because it is "P Code" rather than
"Creator Code"?

Aside from the restriction of not writing outside the 500 cells, what are
the restrictions on "P Code" -- for example, presumably it can't modify the
pool?

Presumably the created warriors have to contain only pool instructions, and
these can be modified only by spending action points?

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

> mov.i $PA02, position+1
> sub.f $PA09, position+1

So creator code MAY modify the created warrior, subject only to the A field
pointing into the pool. Can P Code also modify the created warrior?

Does the Pool have to appear in the order given, or can it be permuted?

Must the Pool appear in full if only a subset of the instructions are used?

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

> You can clear like you want. I know it's hard to clear anything
> without leaf any instruction..But you can buy one or two instructions
> for leave left. But if you can, you should try to kill anything.

Presumably the instructions that are left cannot be active parts of the
warrior? Otherwise you could just pay 14 points, delete the pool and enter
an arbitrary 7-instruction warrior...

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

Robert Macrae wrote:

>> mov.i $PA02, position+1
>> sub.f $PA09, position+1
>
> So creator code MAY modify the created warrior, subject only to the A
> field
> pointing into the pool. Can P Code also modify the created warrior?

You can have a p-switcher without code limitations.

You can have a code creator, with the limitation that he had to have always
one of the pool's labels at the source.

After creating you must clean the core without any code limitation.

All parts can read all over the core, but write only in the first 500
instructions.

>
> Does the Pool have to appear in the order given, or can it be permuted?
>
> Must the Pool appear in full if only a subset of the instructions are
> used?

You must use the complete pool in the given order...

>
> Robert

--
Parlez vous Redcode?
 
Archived from groups: rec.games.corewar (More info?)

Robert Macrae wrote:

>> start mov.i $PA00, position
>> mov.i $PA02, position+1
>> sub.f $PA09, position+1
>> mov.i $PA09, position+2
>> mov.ab $PA07, position+2
>> mov.a $PA02, position+2
>
> So this is "Creator Code" and has to have A fields pointing into pool.
> Could it also point B fields into the pool, and make changes, like
> MOV.x $PA00, $PA00 or
> NOP $PA00, <PA00 ?
>
>> spl 2
>> spl 1
>> spl 1
>> spl 1
>> mov.i start-1,>jl ; to get rid of the code pool
>> mov.i start-1,>ptr
>> jl jmp position, PA00
>> ptr dat 0,start
>
> This doesn't have restricted A fields because it is "P Code" rather than
> "Creator Code"?

The P-switcher and the clear code after the creators code aren't under the
A-field restrictions.

>
> Aside from the restriction of not writing outside the 500 cells, what are
> the restrictions on "P Code" -- for example, presumably it can't modify
> the pool?

creators code or p-switcher code can modify the pool. with the AP you can do
it faster without runtime cost.

>
> Presumably the created warriors have to contain only pool instructions,
> and these can be modified only by spending action points?
>

like wrote above you can modify the pool with ap and with the creators code.

But - example.

If your warrior you have to create works fine with an instruction from the
pool, but one of the constants is not so good but you need that constants
in another part of the warrior, you can use some AP for swapping the
constants instead of three mov's for swapping and erasing another constant
of the pool. AP's are good for things you absolutely need or thing that are
to long to code in the creator. But it is always a good idea to save some
AP because they would be added to your entry's points after the fight.

> Robert

Sascha



--
Parlez vous Redcode?
 
Archived from groups: rec.games.corewar (More info?)

"Robert Macrae" <ff95@dial.pipex.com> wrote in message news:<4116ab7a$0$29930$cc9e4d1f@news.dial.pipex.com>...
> > You can clear like you want. I know it's hard to clear anything
> > without leaf any instruction..But you can buy one or two instructions
> > for leave left. But if you can, you should try to kill anything.
>
> Presumably the instructions that are left cannot be active parts of the
> warrior? Otherwise you could just pay 14 points, delete the pool and enter
> an arbitrary 7-instruction warrior...
>
> Robert

I am still not clear. Please give another example...p-warrior with a
4-line dwarf and scanner Rave.