Welcome to GameHourz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Concept: DoubleTroubleV4 (programs now alternating, using ..

 
   Game Forums (Home) -> Core War RSS
Next:  Concept: DoubleTroubleV1 ( Alternating programs, ..  
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Fri Dec 21, 2007 11:11 am
Post subject: Concept: DoubleTroubleV4 (programs now alternating, using the switch trick from the minideathstar ;))
Archived from groups: rec>games>corewar (more info?)

;redcode
;name DoubleTroubleV4
;author SkybuckFlying
;strategy alternates programs to detect dead programs and revives the dead
programs.
;version 4
;date 21 december 2007

; Let's alternate between programs, this assures that programs are
functioning and gives insight into if the program is intact or dead.
; Works splendedly, program1 keeps reviving program2, while program2 is
d.e.a.d
; Now only thing to do is to incorporate a fixer and the program will be on
their way again ! =D
;
; Ok programs are now alternating, while still using 2 threads. ofcourse if
the running thread dies, the other one will never run
; maybe use wait loops instead...
; also it keeps trying to respawn dead programs... I had some trouble
getting it to work but finally figured it out.. the wait has to be cancelled
; maybe a future version will give up trying to respawn the second
program... and just run itself instead. I could do that.
; for now I am gonna keep things simple. But I am gonna develop the idea as
well incase I need it to see if it could work Wink yeah probably.

spl Program1Begin
spl Program2Begin
dat #0, #0

; program 1 will use A
; program 2 will use B

Program1Begin
jmz.a 0, ProgramRun
nop 1
nop 2
nop 3
nop 4
nop 5
nop 6

; we are done running signal the other program to run
; switch
mov.x ProgramRun, ProgramRun

; if he is in a wait state then cancel the wait to force him to immediatly
continue
mov.ab #1, Program2Wait


Program1WaitAgain
; reset wait time
mov.ab #10, Program1Wait

; wait for the other program to complete
Program1Wait djn 0, #0

; check if it completed, if it did ok simply run us.
jmz.b Program1Begin, ProgramRun

; else revive program 2
spl Program2Begin

; try waiting again, or alternative run ourselfs after wait is over
jmp Program1WaitAgain

jmp Program1Begin
Program1End

ProgramRun dat #1, #0

Program2Begin
jmz.b 0, ProgramRun
nop 1
nop 2
nop 3
; dat 3 ; pretend program 2 died.
nop 4
nop 5
nop 6

; we are done running signal the other program to run
; if both switch then this will always make program 1 run.. hmmm
; no this one wont be running it's ok hehe.
mov.x ProgramRun, ProgramRun

; if he is in a wait state then cancel the wait to force him to immediatly
continue
mov.ab #1, Program1Wait


Program2WaitAgain
; reset wait time
mov.ab #10, Program2Wait

; wait for the other program to complete
Program2Wait djn 0, #0

; check if it completed, if it did ok simply run us.
jmz.a Program2Begin, ProgramRun

; else revive program 1
spl Program1Begin

; program 1 might be dead so run ourselfs

; try waiting again, or alternative run ourselfs after wait is over
jmp Program2WaitAgain


jmp Program2Begin
Program2End

 >> Stay informed about: Concept: DoubleTroubleV4 (programs now alternating, using .. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Score Surface for 94nop - Hi, some anonymous person (still called "bvowk" for simplicity ;-) is so kind to provide access to a pile of computers. I have suggested to calculate one score surface for standard settings. It takes roughly 1000 times the time of one "no...

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: ;redcode-tiny ;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 -=- irc.KOTH.org is up! Meetings held in #corewars -=- Tons of new features on www.KOTH.org/koth.html pages -=- *FAQ* page located at: www.KOTH.org/corewar-faq.html Current Status of the KOTH.ORG ICWS Experimental 94..

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

KOTH.ORG: Status - 94 No Pspace 03/06/06 - Weekly Status on 03/06/06 -=- irc.KOTH.org is up! Meetings held in #corewars -=- Tons of new features on www.KOTH.org/koth.html pages -=- *FAQ* page located at: www.KOTH.org/corewar-faq.html Current Status of the KOTH.ORG 94 No Pspace CoreWar Hill...
   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 ]