Mini challenge #7. "Harmless overrun"

4 views
Skip to first unread message

neog...@gmail.com

unread,
Oct 17, 2008, 7:26:18 AM10/17/08
to
Okay here is another Mini challenge. This one is quite simple and will
keep busy idle redcoders while i think on something better :)

This time you have to write an imp than can pass through a wimp, (imp
gate), but the gate's process must survive.
And you have to make your code as small as possible and use the less
processes possible.

The imp can have the form you want, it can mutate, whatever... but
must be clearly an imp. Imp guns are not allowed, (spl 0/mov.i 1,1).

The gate:

gate: jmp 0,<-5
end gate

Try to obtain the highest Tie rate and e-mail them to me (). I'll test
and post all the recivied entries here.

Check the MiniChallene web page for more details:
http://labarga.atspace.com/mc7.html

I have set deadline november, 2nd but can be extended i someone needs.

Plese post your ideas for next mini challenges, at the moment i like
synchronizing
multiple processes the most.

Ilmari Karonen

unread,
Oct 18, 2008, 4:41:52 PM10/18/08
to
On 2008-10-17, neog...@gmail.com <neog...@gmail.com> wrote:
> Okay here is another Mini challenge. This one is quite simple and will
> keep busy idle redcoders while i think on something better :)
>
> This time you have to write an imp than can pass through a wimp, (imp
> gate), but the gate's process must survive.
> And you have to make your code as small as possible and use the less
> processes possible.
>
> The imp can have the form you want, it can mutate, whatever... but
> must be clearly an imp. Imp guns are not allowed, (spl 0/mov.i 1,1).
>
> The gate:
>
> gate: jmp 0,<-5
> end gate

Okay...

imp: mov.i #1, *1
end imp

Do I win?

--
Ilmari Karonen
To reply by e-mail, please replace ".invalid" with ".net" in address.

neog...@gmail.com

unread,
Oct 18, 2008, 7:12:26 PM10/18/08
to
Hrm.... i would prefer if you send it by mail instead of posting it
where everyone can see it.
Let beginners think a bit!
(Maybe i should have written this detail...)

>
> Okay...
>
> imp: mov.i #1, *1
> end imp
>
> Do I win?
>
> --
> Ilmari Karonen
> To reply by e-mail, please replace ".invalid" with ".net" in address.

Yeah, that's ok.
I'll post all the entries at the page. Well, i better do it now, its
over. <:|

Roy

unread,
Oct 20, 2008, 3:37:08 AM10/20/08
to
> Hrm.... i would prefer if you send it by mail instead of posting it
> where everyone can see it.
> Let beginners think a bit!
> (Maybe i should have written this detail...)

Ok, this spoiled the challenge a bit... but we can extend it..?

Lets try to find a solution for this gate:
djn.f #0,>-5

(I haven't got one yet)

Skybuck Flying

unread,
Oct 20, 2008, 7:31:45 AM10/20/08
to
Here's my nasty imp which kills both stupid gates LOL.

;redcode
;name Skybuck's Nasty Imp V1
;date 20 october 2008
;history Written for the imp mini challenge.
;history I don't understand why the gate would have to survive ;)
;history I like killing better :)
;history this imp kills the fricking gate ! LOL.
;strategy kills the gate first
;strategy goes on and on.
;strategy kills both gate types ;) :)
spl 1
spl 1
mov.i 0, >1

Skybuck Flying

unread,
Oct 20, 2008, 7:44:34 AM10/20/08
to
V2 YES ! =D

;redcode
;name Skybuck's Nasty Imp V2


;date 20 october 2008
;history Written for the imp mini challenge.
;history I don't understand why the gate would have to survive ;)
;history I like killing better :)
;history this imp kills the fricking gate ! LOL.
;strategy kills the gate first
;strategy goes on and on.
;strategy kills both gate types ;) :)

;strategy EVEN MORE NASTY against duplicators like the millenium falcon !
LOL ! =D
spl 1
spl 1
spl 1
spl 1
mov.i #0, >1


neog...@gmail.com

unread,
Oct 21, 2008, 6:03:45 AM10/21/08
to

Well, the goal was to have 100% ties instead of wins, (that challenge
was done already long ago), using only one process.
Roy's gate proposal looked more difficult, ( djn.f #0,>-5), and
interesting but the solution has appeared very fast.
Aaah, redcode maniacs, we need a harder challenge... :)

pauld...@aol.com

unread,
Oct 21, 2008, 10:17:24 AM10/21/08
to
> Aaah, redcode maniacs, we need a harder challenge... :)

On Oct 21, 5:03 am, neogry...@gmail.com wrote:
> Aaah, redcode maniacs, we need a harder challenge... :)

Thanks Neo for volunteering to run some tournaments ;)

How about:

-- Each person submits both a replicator and an anti-replicator, each
replicator fights all the anti-replicators but reps do not battle reps
and antis do not battle antis.

-- Generalize the above, where each person submits an X-type program
and an anti-X.

Scoring could be simply adding the two scores, or multiplying them, or
square root of the sum of their squares, or...

No p-space allowed, to prevent win-trading.

The beauty is that while people could submit already-published
programs, they may have code stashed away that couldn't make it on a
Hill but might just steal this kind of challenge. Also it is kind of
a challenge to understand the relationships between X and anti-X
programs and the counter-measures taken on both sides which could lead
to some interesting discussion.

--

I had another idea long time back, I don't remember posting it... A
set of hills where the warriors on a hill do not fight each other but
do fight the warriors on all the other hills. Like Italian city-
states they could develop their own personalities. One hill might be
dominated by replicators and tiny stones, another by all imps. Say
there were 12 spots each on 5 hills to start with. When a warrior is
submitted to a hill it fights 48 (60 - 12) battles. The warrior with
the smallest score is dropped off and if it is on a different hill
that hill shrinks by one spot. The last hill standing is the winner.
Might take months, depending on how clever authors are about defending
their territory from infiltration, blitz attacks, etc.

To encourage 'loyalty', an author can have warriors on no more than 2
hills at a time. That might also encourage 'cooperation' and even..
'treachery' :)

Can you visualize "fantasy league" Corewars?

P. Kline


Skybuck Flying

unread,
Oct 21, 2008, 10:33:06 AM10/21/08
to
Hmm reading your idea, gives me an idea:

Different hill types, for example:

Imp hill
Paper hill
Stone hill
Replicator hill

Then each hill fights the other hills.

The best imps remain on the imp hill.
The best papers remain on the paper hill.
The best stones remain on the stone hill.
The best replicators remain on the replicator hill.

And so forth :)

Sounds like a kinda fun idea :)

So it's forbidden to make a warrior that can do everything... it must either
be an imp, paper, stone, replicator or whatever ! ;)

Bye,
Skybuck.


pauld...@aol.com

unread,
Oct 21, 2008, 11:31:55 AM10/21/08
to
> So it's forbidden to make a warrior that can do everything... it must either
> be an imp, paper, stone, replicator or whatever ! ;)

The boundaries are a little fuzzy. Does Vampire count as stone or
scissors?
What about bomb-dodgers? Self-healing programs? Imp-bombers?
Even chickens have spurs.
How do you enforce the rules, does someone have to moderate? That
would be a thankless task, but you could limit the length of warriors
to throttle the swiss-army-knife strategy.

---

In my scenario a hill might be initialized with one kind of program
but would mature into something else with submissions.

Here is a way to implement teams using a single hill. Every warrior
must include a statement like:
;strategy myteamis N
where N is in the range of 1-5 and warriors do not fight members of
their own team.

Because it is a ;strategy line everyone can see the team rosters.
There is no need to track the number of spots on any team, it is
automatic.

It would have to be no-pspace to prevent win-trading between teams,
though there are less efficient ways to do this.
I like setting the length limit low to eliminate qscanning and
encourage specialization.
A team's score would be the average of its members.
After each season we could decide whether to expand the league or not.
Does a big team become more dominant or less?

P. Kline

digital.w...@googlemail.com

unread,
Oct 21, 2008, 1:50:39 PM10/21/08
to
On Oct 20, 8:37 am, Roy <roy.van.r...@gmail.com> wrote:
> Lets try to find a solution for this gate:
> djn.f #0,>-5
>
> (I haven't got one yet)

I have a solution ;-)

Cheers,

John

Roy

unread,
Oct 21, 2008, 3:50:29 PM10/21/08
to
> > So it's forbidden to make a warrior that can do everything... it must either
> > be an imp, paper, stone, replicator or whatever ! ;)
>
> The boundaries are a little fuzzy.  Does Vampire count as stone or
> scissors?
> What about bomb-dodgers?  Self-healing programs?  Imp-bombers?
> Even chickens have spurs.
> How do you enforce the rules, does someone have to moderate?  That
> would be a thankless task, but you could limit the length of warriors
> to throttle the swiss-army-knife strategy.

Doesn't this automagically happen? If you start (for example) with
three hills, stone/paper and scanner, then chain them rock-paper-
scissors style.

If you submit a warrior, its submitted to all three hills, so:

- Submission 1 (some scanner warrior)

Its send to Paper Hill, so it fights the Rocks for a good score (it
fails)
Its also send to the Stone hill, so it fights Scanners, it'll get a
50/50 score, but not as good as the stones on the hill will have.
Its also send to the Scanner hill, so it fights the Papers, and if its
good enough, it will make it on this hill.

This will work with all the warrior-types right? The scoring will only
work on the 'correct' hill. And if seeded correctly we can steer the
hills into the right position. Hell, to keep it seeded right we could
place some "un-pushable" warriors on the hill, like 5 of the 25
warriors that can't be killed, but do determine the score (for the
other hill).

What are your opinions on this?

Roy

pauld...@aol.com

unread,
Oct 21, 2008, 5:55:28 PM10/21/08
to
Roy, that's a good observation. You could run a pure stone/scanner/
paper ring. It might not be as stable as expected however, a bomb-
dodger might make it on the papers hill and corrupt the system. On
the other hand, a few silent bombers on the stones hill could limit
this.

How about these hills, using all seven possible combinations:

1. best 20 scores against hill 2
2. best 20 scores against hill 3
3. best 20 scores against hill 1
4. best 20 scores against hills 2-3 combined
5. best 20 scores against hills 3-1 combined
6. best 20 scores against hills 1-2 combined
7. best 20 scores against hills 1-2-3 combined

Hills 1-3 represent stone/scanner/paper and are pre-seeded
Hills 4-6 represent dual-purpose warriors
Hill 7 represents best all-around

You fight all existing warriors on the first three hills and your
seven scores are computed. If you beat out warriors on more than one
hill you move on to the one which ranks you the highest. Once on a
hill you stay there until you get pushed off.

Now you can focus on specialization, dual-purpose, or all-round,
choose your poison :-)

OK, I kind of like it except...

There is no incentive for stones to develop paper-resistance, their
only purpose in life is to kill the programs on the scanner hill.
Three-line core-filling stones dominate and what is the value of a 4-
line self-splitting stone?
Could stones develop a selective paper-resistance in order to weaken
some class of scanners that they do not like?

Maybe you count kills against the downstream hill and ties against the
upstream one. Or is that no change from what we have now?

P. Kline

Skybuck Flying

unread,
Oct 21, 2008, 9:33:43 PM10/21/08
to
Well to answer your questions....

Some combination hills might exist too.

That answers your first question.

Then the answer to the other question:

I am for open-source hills so that everybody can inspect the other warriors.

If my warrior looses against some other warrior on the hill then I can start
looking
at the warrior on the other hill...

If I believe the warrior doesn't belong on that hill I can file a complaint
! :)

As can do others... so if there is agreement or if the moderator agrees it
can be removed from the hill and maybe placed
somewhere else ! ;)

Bye,
Skybuck.


Skybuck Flying

unread,
Oct 21, 2008, 9:40:07 PM10/21/08
to
What you guys are discussing is way too advanced for newbies to follow !

My impression was this thread is for newbies.

The mini challenges are ment for newbies... !

So my idea is much more simple and nice for newbies ! ;)

Even you advanced experts can play on the newbie hills... but you gotta
follow the simple newby rules ! :)

Bye,
Skybuck ! ;)


pauld...@aol.com

unread,
Oct 22, 2008, 9:41:25 AM10/22/08
to
On Oct 21, 8:40 pm, "Skybuck Flying" <BloodySh...@hotmail.com> wrote:
> What you guys are discussing is way too advanced for newbies to follow !
>
> My impression was this thread is for newbies.

Ouch! You are correct, I seem to have hijacked your thread.

But I digress :) I read an article years ago about a then-new program
for mapping relationships between individuals and sorting them out
into communities based on similarities. Now it is being used widely,
including the regrouping of species based on dna similarities (instead
of the old system of classification based on gross anatomy). I think
someone tried to run a program like this on a subset of corewars
programs with some interesting results. Something like that could
tell us how many species of warriors there are today. A bit more than
three I am sure.

To address the issue of properly classifying warriors:
- a moderator could oversee the classifications
- you could have some kind of voting system, on the basis of 2-3
witnesses a program would automatically be reclassified
- you could just select those programs you want to fight

P. Kline

"Only AI's only quote online material."

Ilmari Karonen

unread,
Oct 22, 2008, 10:04:41 AM10/22/08
to
On 2008-10-18, neog...@gmail.com <neog...@gmail.com> wrote:
> Hrm.... i would prefer if you send it by mail instead of posting it
> where everyone can see it.
> Let beginners think a bit!
> (Maybe i should have written this detail...)

Oops, sorry. :( Anyway, I've sent my response to Roy's version to you
by e-mail.

Roy

unread,
Oct 22, 2008, 10:50:20 AM10/22/08
to

Hmm, if we want this to work we need to have some kind of automatic
system. A self-balancing mechanism (like the one I described) must
exist, and anyway, you can only go on one of the three hills I
described, the one you score best. So you do have automatic grouping
there.

But this will cause another problem like you said. A simple three-line
single process stone can kill almost all scanners easily. So will
those rule the Stone-Hill? Probably yeah... What to do about it:
- The hills are rock-paper-scissor
- To determine your score, fight one hill back (paper beats rock, rock
beats scissors, scissors beat paper)
- Second part of the score you fight the hill forwards (to test your
survival skills)
- Scoring is based on both those results (50/50? 75/25? Other magic
formula?)

So if you create a superfast 99% killer stone, and kill all scissors,
but loose against all papers, your score isn't very good. But the
point is: What do you want with these hills, if you want specific
warriors that are good at beating one other specific warrior-type,
only fight backwards. If you want to seperate warriors into different
structures/classes... other methods are probably better. You should
also look into the grouping maps, somebody made them some time ago
(5-10 years?), plotting all the warriors in groups based on different
variables.

Grouping of warriors is a core feature in some modern evolvers too...
this helps to keep diversity in the species. I once tried to make an
evolver based on my own three-hill system, but never got very far
hehe.

Roy

neog...@gmail.com

unread,
Oct 22, 2008, 11:38:31 AM10/22/08
to
By the way, just to make it official.
Mini challenge 7 has been extended following Roy's idea.
See details at http://labarga.atspace.com/mc7.html#extend.
Come on, there aren't many newbies taking part.

Skybuck Flying

unread,
Oct 22, 2008, 12:59:59 PM10/22/08
to
I didn't know this website existed ;)

Thanks for the link ! :)

Bye,
Skybuck ! ;)

<neog...@gmail.com> wrote in message
news:f9c45062-2dcf-4e3b...@f63g2000hsf.googlegroups.com...

digital.w...@googlemail.com

unread,
Oct 22, 2008, 1:31:40 PM10/22/08
to
On Oct 22, 3:04 pm, Ilmari Karonen <usen...@vyznev.invalid> wrote:
> Oops, sorry. :( Anyway, I've sent my response to Roy's version to you
> by e-mail.
>
> --
> Ilmari Karonen

I'm curious whether or not your two line solution is the same as
mine :-)

Also, I was wondering what the smallest solution only using MOV
instructions is.

John

Skybuck Flying

unread,
Oct 22, 2008, 1:53:59 PM10/22/08
to
Mini challenge six was very cool !

You provided three strategy warriors, and we had to write the brain to
switch between them ! ;)

So all contenders/competitors would use the same strategies/warriors except
for the brain ! LOL =D

I never got around to writing a good brain... but I have a good idea now...
and some time...

So tomorrow or maybe even today... but probably tomorrow I am going to write
me a new/good brain ! LOL.

My current crappy brain (which is in the worst of skybuck v1 warrior) did
score better than the two worst ones on that "mini hill" :):):):):)
LOLOLOLOLOL.

I hope my new brain will do much better otherwise I won't be the one
laughing anymore LOL ;) :)

(Seeing the imp spiral from mini challenge 3 was also kinda cool... it could
come in handy for newbies if they want an imp spiral in their warriors...
However I think I have always written my own code for warriors up to this
day... except for maybe a spawn macro or so ! ;):) but I think I am gonna
let go of that... it's too much like incest lol... too much inbreading going
on lol... I can seriously learn from you guys and these mini challenges...

For example I could reduce one instruction for my strategy jump table... at
least I think so... it's a little improvement... but these little
improvements are nice... :)

I like these mini challenges... and explanations and such... it allows
newbies to learn little bit by little bit...

Just copieing somebody elses big warrior, and then modifieing that and
sending that to a hill is lame... (especially if newbies do that !)
thankfully I have never done that ! Shame on those who do lol ! ;) :) Unless
you already an expert or so and have good warriors ! :)

If my new brain turns out to be good I might not supply it though !

I do not want my competitors to get my BRAIN LOL ! ;) :)

Even if it's not the number one I might still not submit it... because the
top brain do use a lot of instructions might be impractical for little
warriors !

And since 8000 instruction hills are popular I would be contributing more
valuable code than those really big brain ! ;) :P*.

Ofcourse in the future the big brain might be interesting for the
experimental large hill... but it's entries are never broadcasted on this
newsgroup... so no fortune and fame for me... since I have a warrior on it !
:) DivideAndConquer it's called ! ;) :)

Anyway... maybe you should repeat that challenge but then set a brain limit
for example:

X instructions for the brain ! ;)

And maybe something like
N cycles for the brain :)

That would be much more interesting for real 8000-instruction hill warriors
!

But ok... this site is for learning so it's ok ! ;)

I am such an asshole lol by not wanting to submit my to-be-written brain...
but that's coreWAR ! ;) :)

Gotta have an adventage here and there LOL :)

Bye,
Skybuck =D


Lukasz Adamowski

unread,
Oct 22, 2008, 2:22:07 PM10/22/08
to
Dnia 22-10-2008 o godz. 3:49 Skybuck Flying napisal:

> What you guys are discussing is way too advanced for newbies to follow !

I told you about the brain-storms. You have been warned! ;]

I think we can make some mini challenges for newbies. Making exotic
hills and hill-rings may be much more interesting, but too difficult to
understand what it CoreWar about. It looks more like a chaos controlling
(in scientific meaning) than playing a game.

BTW I've got another "solution" to our gate busting problem, but it acts
strange in pMARS (AFAIR 0.9.2) on my PDA. It does not tie, just win and
lose alternately. The score (W/L/T) is 50%/50%/0%. I know we want to
have 0%/0%/100%, that's why I publish this imp - it's about strange
acting, not solving the challenge. And it goes like this:
MOV.I {1, }0
Looks like boh imp and gate die at the same time, but pMARS declares win
for this warrior, which was run second. Just like in chess - you may
need only one move to checkmate, but it's useless if your opponent
checkmate you in his turn.

Greetings
Lukasz Adamowski

-= "War is a problem, never a solution" =-
-= "Wojna jest problemem, a nie rozwiazaniem" =-

----------------------------------------------------
Niezwykła i egzotyczna chińska saga, w której realizm splata się z
bajkowością. To powieść o dojrzewaniu, miłości, zemście i
przeznaczeniu."Bracia" - Da Chen. Już w księgarniach!
http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fbracia2.html&sid=527


Ilmari Karonen

unread,
Oct 22, 2008, 3:13:48 PM10/22/08
to
On 2008-10-22, digital.w...@googlemail.com <digital.w...@googlemail.com> wrote:
>
> I'm curious whether or not your two line solution is the same as
> mine :-)
>
> Also, I was wondering what the smallest solution only using MOV
> instructions is.

My two-liner uses only MOVs. I'm fairly sure a single-MOV solution is
impossible.

Ilmari Karonen

unread,
Oct 22, 2008, 3:50:34 PM10/22/08
to
On 2008-10-22, Lukasz Adamowski <core...@wp.pl> wrote:
>
> BTW I've got another "solution" to our gate busting problem, but it acts
> strange in pMARS (AFAIR 0.9.2) on my PDA. It does not tie, just win and
> lose alternately. The score (W/L/T) is 50%/50%/0%. I know we want to
> have 0%/0%/100%, that's why I publish this imp - it's about strange
> acting, not solving the challenge. And it goes like this:
> MOV.I {1, }0
> Looks like boh imp and gate die at the same time, but pMARS declares win
> for this warrior, which was run second. Just like in chess - you may
> need only one move to checkmate, but it's useless if your opponent
> checkmate you in his turn.

That's... a tricky one. Took me a while in cdb to figure out what it
does.

What _actually happens is that, when the imp is about to overwrite
gate - 5, the instruction it moves there is whatever the a-field of
gate - 5 points to (after the predecrement). If that instruction
happens to be within the trail of the imp, it passes safely and
eventually wins. If not, it suicides.

As it just happens, the gate is decrementing that a-field at exactly
the same rate as the imp is advancing. If the imp gets the first
move, the a-field will end up pointing to the very first instruction
of the imp trail. But if the gate executes first, it gets one extra
decrement in, causing the a-field to point to empty core instead.

digital.w...@googlemail.com

unread,
Oct 22, 2008, 3:56:21 PM10/22/08
to
On Oct 22, 8:13 pm, Ilmari Karonen <usen...@vyznev.invalid> wrote:

> On 2008-10-22, digital.wildern...@googlemail.com <digital.wildern...@googlemail.com> wrote:
>
>
>
> > I'm curious whether or not your two line solution is the same as
> > mine :-)
>
> > Also, I was wondering what the smallest solution only using MOV
> > instructions is.
>
> My two-liner uses only MOVs.  I'm fairly sure a single-MOV solution is
> impossible.
>
> --
> Ilmari Karonen
> To reply by e-mail, please replace ".invalid" with ".net" in address.

I was pretty sure a two MOV solution was impossible! I have a three
MOV solutions and a two line MOV / JMP solution.

Back to the drawing board :-)

John

Skybuck Flying

unread,
Oct 22, 2008, 5:29:39 PM10/22/08
to
On CoreWin the gate always wins at least on the few 100 tests or so I did...

Euhm there is another little weird thingy though for example:

warrior1:

mov 0, 0
dat 0

warrior2:

mov 0, 0
dat 0

I think these two warriors should tie.... but they don't.

Because warrior1 is executed internally before warrior2, warrior2 will win,
because warrior1 died.

I don't agree with that... all warriors are supposed to execute in parallel
conceptually so they should both die.

This can be verified by placing the warriors 100 cells apart and then
running this code:

warrior1:
add #50, $50
dat 0

warrior2:
sub #50, $-40
dat 0

the end result after one step will be $10 in cell 50.

So this shows that it more or less executes in parallel and simply adds
together whatever happened during that "time frame".

So if you extrapolate that thinking... then they should both have died as
well... since that also happened in "one time frame"

Bye,
Skybuck.


Lukasz Adamowski

unread,
Oct 23, 2008, 9:30:52 AM10/23/08
to
Dnia 22-10-2008 o godz. 22:50 Ilmari Karonen napisal:

> On 2008-10-22, Lukasz Adamowski <core...@wp.pl> wrote:
> >
> > MOV.I {1, }0

>
> That's... a tricky one. Took me a while in cdb to figure out what
> it does.
>
> What _actually happens is that, when the imp is about to overwrite
> gate - 5, the instruction it moves there is whatever the a-field of
> gate - 5 points to (after the predecrement). If that instruction
> happens to be within the trail of the imp, it passes safely and
> eventually wins. If not, it suicides.
>
> As it just happens, the gate is decrementing that a-field at exactly
> the same rate as the imp is advancing. If the imp gets the first
> move, the a-field will end up pointing to the very first instruction
> of the imp trail. But if the gate executes first, it gets one extra
> decrement in, causing the a-field to point to empty core instead.

Damn, you're right! I've only looked at the results, now I've done some
debugging (it's not so comfortable on my PDA pMARS version, you know ;)
and I see this imp acts different way each time executed first or
second. That's not what I was expecting! As Skybuck wrote CoreWin gives
different results, so maybe we should consider it as a bug in pMARS?

BTW excellent idea for tour, Skybuck! I mean this evolver one. But it
takes a lot of time to write an evolver so it should take long time till
deadline. ;) Anyway I'm waiting for a webside with specific rules. You
should set CORESIZE, MAXPROCESS and other parameters to make the
evolvers comparable.

Lukasz Adamowski

-= "War is a problem, never a solution" =-
-= "Wojna jest problemem, a nie rozwiazaniem" =-

----------------------------------------------------
ATRAKCYJNE NIERUCHOMOŚCI W ZAKOPANEM !!!
Apartamenty, Domy, Działki, Pensjonaty, Hotele, Lokale użytkowe...
Kliknij: http://klik.wp.pl/?adr=www.bachledanieruchomosci.pl&sid=528


Ilmari Karonen

unread,
Oct 23, 2008, 9:49:08 AM10/23/08
to
On 2008-10-23, Lukasz Adamowski <core...@wp.pl> wrote:
>
> Damn, you're right! I've only looked at the results, now I've done some
> debugging (it's not so comfortable on my PDA pMARS version, you know ;)
> and I see this imp acts different way each time executed first or
> second. That's not what I was expecting! As Skybuck wrote CoreWin gives
> different results, so maybe we should consider it as a bug in pMARS?

No, the way it works on pMARS is exactly as it should. (For a simple
example, consider the case where the imp starts at the instruction
just before gate - 5 and think about what happens when either the imp
or the gate executes first.) If CoreWin does something different, I'd
say it's the one with the bug.

Skybuck Flying

unread,
Oct 23, 2008, 10:32:29 AM10/23/08
to
Well...

Today I wrote my brain tester in Delphi... yes I am going to develop the
brain algorithm in Delphi ! ;)

Just for kicks...

Then later ofcourse I will try to make a redcode implementation of it ! :)

Seems like overkill ? I don't think so ! :)

This is really general strategy thinking that can be applied to any game
where there is a rock scissor paper kind of strategy-relationship :)

Very cool stuff =D

So far I have 5 simple brains:

A clear brain which always uses the clear strategy.
A imp brain which always uses the imp strategy.
A wimp brain which always uses the wimp strategy.
A switcher brain which starts with clear strategy and then iterates to imp,
wimp and then back to clear and so forth.
A counter brain which analyzes which strategy the opponent used and then
counter attacks it.

All are fighting in a tournament like fashion... they don't fight themselfes
as explained on the website.

Wins, Ties, Loses and Score is "printed" per battle (x rounds) and per
tournament (per warrior).

Finally a wins, ties, loses and score 2D tournament battle table is printed
which is nice to analyze how warrior x performed against warrior y :)

So now I am fully setup up for some serious brain algorithm
thinking/designing, implementing, debugging/testing and analyzing and
hopefully finally RULING THE COREWAR WORLD LOL or at least this little mini
challenge :):):) ! =D

It was also a very good exercise for Delphi programming in general... I used
all kinds of advanced language features like inheritance, virtual functions,
virtual abstract functions, override functions, classes of class, class
functions, class variables, everything worked out fine and fortunately no
stupid bugs in the delphi compiler :)

Also fortunately I did not have to figure out how to do a tournament...
since I already developed that algorithm for the evolver which I wrote some
time ago... thank god for that... because re-figuring that out would be
boring.

The tournament algorithm is quite simple:
for A:=1 to N do
begin
for B:= 1 to N do
begin
if A > B then
begin
Battle( A, B );
end;
end;
end;

The tournament algoritm can be expanded for evolvers/mutations to battle
against each other like so:
for A := 1 to N do
for A_mutation := 1 to M do
for B := 1 to N do
for B_mutation 1 to M do
if ((A=B) and a_mutation>b_mutation) or (A>B) then Battle(
A,A_mut, B,B_mut);

(All variables above are indexes/integers)

Good luck to you newbies with that ! ;) :)

Bye,
Skybuck.


Lukasz Adamowski

unread,
Oct 25, 2008, 1:12:29 PM10/25/08
to
Dnia 25-10-2008 o godz. 11:48 Skybuck Flying napisał(a):
> > I know in the first loop, when A = 1 something like
> > for B:= 1 to 0 do
> > may look strange, but it works (at least in C/C++).
>
> I know it works in Delphi, since that's Delphi code ;)
>
> But does it really work in C/C++ ? :)
>
> Prove it ! LOL.

OK, to be quite correct I should have used C syntax:
for ( B=1; B<=0; B++ )
but it doesn't change the meaning of what I wrote.

C/C++ allows that "buggy" code to exist, because it is designed to give
the programmer all the power and also all the responsibility of coding.
In this way it is similiar to assembler, because the assembler is about
understanding what the machine is to do. Programming in C/C++ you have
to understand the way it works and make it to work the way you want. But
in C/C++ you can write it in much more human readable way than in
assembler.
Computers don't make mistakes. The programmers do.

Greetings
Lukasz Adamowski

P.S. I love the way C/C++ allows to use "for" loop instead of "while",
"do/while" or even "if". But no one uses it since it makes code look
unfriendly.

Reply all
Reply to author
Forward
0 new messages