;redcode-94
;name DeathRayV2
;author Skybuck Flying
;version 2
;assert 1
;strategy unknown ? massive bombing, DEATH RAY ! =D unfinished yet though.
;date 8 december 2007
;history version 1 and 2 created on 8 december 2007
; There I have had enough now of writing all kinds of concepts.
; Time to write some nice warriors, who are fun too look at and might still be interesting ideas.
; I had an idea for a warrior: A death ray across the screen, fun too look at it and might be efficient as well.
; since normal little bomber waste 50 procent of their time own executing a loop and 50 procent placing bomb.
; Skybuck's death ray will use 63 threads or so to bomb a vertical line, and one thread to tell the bomber where to bomb on the next horizontal line
; since all threads go right... the next instruction will need to be placed right so that all threads execute that.
; there will only be one thread which will place the instruction on the right side at just the right time... right after all threads executed nice eh.
; actually only the last thread has to copy such an instruction.
; so let's see how we could write something like that...
; first I need a vertical bomber.
;
; add #128 comes to mind. however this is not atomic...
; hmm seems nasty... seems only way to make a vertical bomber real fast is eh.. multiple threads executing on a horizontal line on different cells...
; could be done by will make the warrior big. big benefit however is that all threads constantly place a bomb and only one thread needs to loop back nice idea.
;
; Let's write something that works that way first we need a bomb at the back of the program
; then we need a jump to jump back to somewhere on the bomber begin :)
;
; now we need instructions to bomb a vertical line...
; it would be nice if the instructions can be modified so that the will bomb the next vertical line on the next round.
; this would mean some auto increment. and that can only be done with indirect increment...
; so some parts of the program might need to be data indexes containing stuff.
; let's write a mini version first to see how it could work.
;
; Excellent it works exactly as I thought it could/should/would work ! =D YEAH =D
;
; There is now little benefit to doing in multi threaded...
;
; Let's create a program initializer which can copy these things or something.
;
;
; Let's first create 63 mov instructions and 63 dat instructions then we figure out how to modify them.
; data must be at the start of the program because the back of the program will be overwritten with instructions to be used ! ;) :)
;
; YES A NEW WARRIOR IS IN THE MAKING ! =D
;
; STAY TUNED FOR MORE DEATH RAY IN THE FUTURE =D
;
; IMPROVEMENT SUGGESTIONS AND IDEAS ARE WELCOME ! =D ARGHAARGHARGHAHAHAHAHA EVIL LAUGH =D
;
; For now the warrior kills itself on the long run. (Untested yet versus other warriors but I expect it should win a few ;))
;
; Just testing the concept/idea for now =D Soon I will do some warior fights after posting this ;) :)
;
DeathRayBegin
jmp DeathRayConstructorBegin
DeathRayConstantsBegin
DeathRaySize equ 61
DeathRayConstantsEnd
DeathRayDataBegin
DeathRayBomb dat $0, $0
DeathRayMovInstruction mov $0, >DeathRaySize + 1 ; plus 1 for jump instruction
DeathRayJmpInstruction jmp $-DeathRaySize
DeathRayDatInstruction dat $0, $0
DeathRayIndex dat $0, #DeathRayEnd
DeathRayDataEnd
DeathRayConstructorBegin
DeathRayConstructMovInstructionsBegin
DeathRayConstructMovInstructionWhileGreaterThanZeroBegin
; create mov instructions
; place the mov instruction, and increment to next position
mov DeathRayMovInstruction, >DeathRayIndex
; decrement death ray counter and repeat until zero
djn DeathRayConstructMovInstructionWhileGreaterThanZeroBegin, #DeathRaySize
DeathRayConstructMoveInstructionWhileEnd
DeathRayConstructJmpInstructionBegin
; place a jmp instruction at the end
mov DeathRayJmpInstruction, >DeathRayIndex
DeathRayConstructJmpInstructionEnd
DeathRayConstructMovInstructionsEnd
DeathRayConstructDatInstructionsBegin
DeathRayConstructDatInstructionWhileGreaterThanZeroBegin
; create dat instructions
; change dat instruction in b
add.ab #127, DeathRayDatInstruction
; place dat instruction, and increment to next position
mov DeathRayDatInstruction, >DeathRayIndex
; decrement death ray counter and repeat until zero
djn DeathRayConstructDatInstructionWhileGreaterThanZeroBegin, #DeathRaySize
DeathRayConstructDatInstructionWhileEnd
DeathRayConstructDatInstructionEnd
DeathRayConstructorEnd
DeathRayEnd
nop $0, $0