Welcome to GameHourz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Concept: FixedV2 (with very simple reviver ! ;) :))

 
   Game Forums (Home) -> Core War RSS
Related Topics:
Score Surface for 94nop - Hi, some anonymous person (still called for ;-) is so kind to provide access to a pile of I have suggested to calculate one score surface for standard settings. It takes roughly 1000 times the time of one surface to..

Bug in pMARS - Hi, either I don't know how EQUs work or I have found a bug in the parser of pMARS. So far I cound pin it down to: ;name test ;assert CORESIZE == 800 v3 EQU 3 * (3 / 2 + 1) + 3 v4 EQU (CORESIZE - v3) dat.f v3, v4 With the..

KOTH.ORG: Status - ICWS Experimental 94 03/06/06 - Weekly Status on 03/06/06 -=- is up! Meetings held in #corewars -=- Tons of new features on pages -=- *FAQ* page located at: Current Status of the KOTH.ORG ICWS 94..

KOTH.ORG: Status - MultiWarrior 94 03/06/06 - Weekly Status on 03/06/06 -=- is up! Meetings held in #corewars -=- Tons of new features on pages -=- *FAQ* page located at: Current Status of the KOTH.ORG 94 CoreWar..

KOTH.ORG: Status - 94 No Pspace 03/06/06 - Weekly Status on 03/06/06 -=- is up! Meetings held in #corewars -=- Tons of new features on pages -=- *FAQ* page located at: Current Status of the KOTH.ORG 94 No Pspace CoreWar Hill:..
Next:  Core War: Concept: FixerV1 (detects bombed instructions, and fixes i..  
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Fri Dec 21, 2007 10:18 am
Post subject: Concept: FixedV2 (with very simple reviver ! ;) :))
Archived from groups: rec>games>corewar (more info?)

This reviver is very simple.

It tells the program to run once.

The program waits until it's told to run.

When the program is done running once it reset the run to zero.

Then the reviver waits and checks if it was zero.

If it was not zero the program did not complete and the reviver knows the
program died.

So it spawns a new thread to run the program !

So simple !

The fixer takes care of fixing the instructions !

Nice and simple !

Could be further optimized to make programs shorter.

Only problem now is:

1. Who gonna fix the reviver ?

2. Who gonna revive the reviver ?

Another copy might have to do that... or some robustness or something.

;redcode
;name FixerV2
;author Skybuck Flying
;strategy threads-serialized-fixer. One thread per instruction.
;version 2
;date 21 december 2007
; pretty cool could come in handy to fix stuns quite fast
spl Program
spl ReviveProgramBegin
spl 1 ; 2
spl 1 ; 4
spl 1 ; 8
spl 1 ; 16
jmp ScanIt

; New idea: use a jmx combo with mov from other warrior or so.


ReviveProgramBegin

RunIt

; tell program to run
mov.ab #1, Run

mov.ab #17, wait

; wait
wait djn 0, #20

; if program is done then run again
jmz RunIt, Run

; else program died, respawn
spl Program

; jmp to run it
jmp RunIt

; or just build in double robustness.

ReviveProgramEnd

ScanIt
mov.ab #1, ThreadCounter
jmz.f DoFixIt, >ThreadCounter

DontFixIt
mov.ab #1, ThreadCounter
nop $0, >ThreadCounter
jmp ScanIt

DoFixIt
mov.ab #1, ThreadCounter
mov Fix, >ThreadCounter
jmp ScanIt

Fix nop $777

ThreadCounter dat $0, $1
Run dat $0, $0

Program
jmz 0, Run
nop 1
nop 2
nop 3
nop 4
nop 5
nop 6
nop 7
nop 8
nop 9
nop 10
nop 11
nop 12
nop 13
nop 14
nop 15
nop 16
mov #0, Run
jmp Program

 >> Stay informed about: Concept: FixedV2 (with very simple reviver ! ;) :)) 
Back to top
Login to vote
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 2) Posted: Fri Dec 21, 2007 10:19 am
Post subject: Re: Concept: FixedV2 (with very simple reviver ! ;) :)) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ignore the "new idea comment", that was a left over.

Bye,
Skybuck.

 >> Stay informed about: Concept: FixedV2 (with very simple reviver ! ;) :)) 
Back to top
Login to vote
Display posts from previous:   
   Game Forums (Home) -> Core War All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]