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

Concept Warrior: Skybuck's TheNightTrainV2 (moving warrior..

 
   Game Forums (Home) -> Core War RSS
Next:  Concept: Skybuck's BootProgramForThreadsV1 (allow..  
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Sun Dec 09, 2007 11:16 pm
Post subject: Concept Warrior: Skybuck's TheNightTrainV2 (moving warrior, with trail erasor, boot program, spawn program, possible payload)
Archived from groups: rec>games>corewar (more info?)

;redcode
;name TheNightTrainV2
;author Skybuck Flying
;strategy Concept Code for a moving warrior (Runs over enemy warriors like a
fricking freight train at night ! Smile erases it's trail).
;date 9 december 2007
;version 2
;history version 1 and 2 created on 9 december 2007

; Demonstrates how to move a warrior forward.
; Also demonstrates how to use a boot program for easy execution order and
stuff like that.
;
; This code will probably be used to construct the moving death star ! OH
YEAH ! =D
; which will probably be a very powerfull warrior in the future ! =D Wink Very Happy
;
; Version 1 left a trail behind and was trackable by scanners. (Version 1
worked without a boot program)
; Version 2 includes a trail erasor, a boot program was used to makes it
easier to get the correct thread order.
; The trail is now erased which should make us harder to track ! Wink Smile

TheStationBegin

TheStationThreadCreatorBegin

; initializes the reset variable with correct values to use for the loop
reset.
TheNightTrainDetermineCoalType mov.f TheNightTrainSourceDest,
TheNightTrainCoal

; The current length of the night train example is 10
; for each cell of the night train a thread is needed to copy it.
; so that means at least 10 threads.

; however one extra thread is needed to reset the engine at the end of
every copy
; and version 2 of the night train has a new feature which is called the
trail erasor
; to erase the trail that is left behind to prevent scanners from tracking
the train
; this requires another thread.

; so the total number of threads to spawn for this example is 10 + 1 for
reset + 1 for erase = 12
; the main thread already counts for 1
; so we need to create 11 additional threads, which is binary 1011

spl 1
mov -1, 0
spl 1
spl 1

TheStationThreadCreatorEnd

TheStationThreadExecutionOrderBootProgramBegin

jmp >ThreadCounter

ThreadCounter dat $0, $1
Thread1JumpTo jmp TheNightTrainEngine
Thread2JumpTo jmp TheNightTrainEngine
Thread3JumpTo jmp TheNightTrainEngine
Thread4JumpTo jmp TheNightTrainEngine
Thread5JumpTo jmp TheNightTrainEngine
Thread6JumpTo jmp TheNightTrainEngine
Thread7JumpTo jmp TheNightTrainEngine
Thread8JumpTo jmp TheNightTrainEngine
Thread9JumpTo jmp TheNightTrainEngine
Thread10JumpTo jmp TheNightTrainEngine
Thread11JumpTo jmp TheNightTrainInjectCoal + 1 ; the instructions will be
moved ahead by one, so compensate for it
Thread12JumpTo jmp TheNightTrainEraseTrail + 1

TheStationThreadExecutionOrderBootProgramEnd

TheStationEnd


TheNightTrainBegin

; not used TheNightTrainLength equ TheNightTrainEnd - TheNightTrainBegin

TheNightTrainLocomotiveBegin

TheNightTrainSourceDest dat #TheNightTrainEnd, #TheNightTrainEnd + 1
TheNightTrainEngine mov {TheNightTrainSourceDest,
<TheNightTrainSourceDest

TheNightTrainLocomotiveEnd

TheNightTrainPayloadBegin

; can be anything, extra threads could be spawned here to do extra stuff
like bomb stuff.
nop 1
nop 2
nop 3
nop 4

TheNightTrainPayloadEnd

TheNightTrainCoalBegin
TheNightTrainInjectCoal mov.f TheNightTrainCoal, TheNightTrainSourceDest
TheNightTrainEraseTrail mov TheNightTrainErasor,
TheNightTrainLocomotiveBegin - 1 ; compensate for moved instructions.

TheNightTrainCoal dat #0, #0
TheNightTrainErasor dat $0, $0

; data members must be behind otherwise movers will fail because move
instruction will be moved by then...
; move instruction must be the last one to be moved ! Smile except for the
source/dest
; data needs to be copied as well.

TheNightTrainCoalEnd

TheNightTrainEnd
dat $0, $0 ; included to make pmars compilers happy, wincore doesn't really
need it,
; however this changes some offsets, so code has been altered to
compensate for it
; so this empty/useless instruction is now needed for correct functioning
! so don't remove it ! Wink Smile

 >> Stay informed about: Concept Warrior: Skybuck's TheNightTrainV2 (moving warrior.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
My first warrior. - Watch him run in pMARS with the default window size for full effect. ;redcode-94 ;name HeathTest01 ;author Heath Caldwell ;assert 1 linelen equ (157) blocklen equ (5) org start x dat #0, #0 y dat ...

AI warrior. - Hi everybody. I'm totally new to this field, so I'm sorry if the question sounds silly...... Does anybody have designed a warrior using AI techniques (like fuzzy logic or Neural Network)? Do you think that such a technology could be too much "heavy...

tiny warrior: desTiny - R.I.P. Destiny After pushing off i would like to publish desTiny. desTiny was based on "Soft as Silk" which get an nice age on tiny. I have changed the decoymaker in front to an 2c-quickbomber which gave him nice extra points. After boot i ju...

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..
   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 ]