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

Demonstration: Skybuck's Strategy Switcher V2

 
   Game Forums (Home) -> Core War RSS
Related Topics:
Demonstration: SelfClearV1 - ;redcode ;name ;author Skybuck Flying ;strategy Clears the makes it invisible to jmz.f and jmn.f scanners. ;version 1 ;date 27 january 2008 ; I actually wanted to bomb the but for now do a clear instead. ;..

Demonstration: SelfBomberV1 (vanishes without a trace :) ;.. - ;redcode ;name ;author Skybuck Flying ;strategy Clears itself leaving no trace that it ever existed ! ;version 1 ;date 27 january 2008 ; to be cleared: ClearMe nop 1 nop 2 nop 3 nop 4 nop 5 nop 6 spl 1 spl 1 spl 1 spl..

Demonstration: Cloack/Decloack Technology V3 :) - ;redcode ;name ;author Skybuck Flying ;strategy ;version 3 ;date 26 january 2008 ; I am a bit bored right now, so let's do something usefull and write a ; little bit of code which I might re-use later or..

Demonstration: CloackTechnologyV4 (little optimization, tw.. - ;redcode ;name ;author Skybuck Flying ;strategy ;version 4 ;date 26 january 2008 ; I am a bit bored right now, so let's do something usefull and write a ; little bit of code which I might re-use later or..

Demonstration: CloackTechnologyV4Unrolled (possible ideas .. - ;redcode ;name ;author Skybuck Flying ;strategy ;version 4 ;date 26 january 2008 ; I am a bit bored right now, so let's do something usefull and write a ; little bit of code which I might re-use..
Next:  Core War: Something strange with jump, it says jump.b ?  
Author Message
Skybuck Flying

External


Since: May 25, 2006
Posts: 295



(Msg. 1) Posted: Wed Jan 30, 2008 2:39 pm
Post subject: Demonstration: Skybuck's Strategy Switcher V2
Archived from groups: rec>games>corewar (more info?)

;redcode
;name StrategySwitcherV2
;author Skybuck Flying
;strategy demonstration code to switch strategies based on previous result
;strategy or if p-space is not present just cycle through strategies
;strategy for now assume p-space is available.

;comments idea is to simply use a counter somewhere in p-space to keep track
of last used
;strategy, at start read if we won, tied or lost, if lost then switch to
next strategy.
;so let's say we have 5 strategies (like recycledbits) then simply use a
thread kind of jumper
;to jump to the correct strategy, we could simply start executing there or
possibly copy the thing
;to somewhere in the core to prevent scanners from finding as too soon Wink
also clear out the jumps Smile
; best would be to copy to somewhere in the core, so let's do that. (Not yet
implemented Smile)
; strategies start at zero to n-1.

StrategyPSpaceLocation equ 10
Strategies equ 4

; load previous round results
PreviousRoundResult ldp.ab #0, $0

; load strategy value since we have to execute it possibly.
LoadStrategyValue ldp.a #StrategyPSpaceLocation, $StrategyValue

; if previous round result is zero (=lost) then skip over jump to strategy
table so that first
; the strategy is changed/incremented.
; if it is not zero then don't skip the jump, and thus jump to strategy
table.
seq.ab $0, $PreviousRoundResult
jmp.a $StrategyTable

; increment the strategy value
add.a #1, $StrategyValue

; mod the strategy value to max strategies
mod.a #Strategies, $StrategyValue

; store the strategy value back into space
stp.ab $StrategyValue, #StrategyPSpaceLocation

StrategyTable
add.a #1, $StrategyValue
StrategyValue
jmp.a $0, $0
StrategyJumps
jmp.a Strategy0
jmp.a Strategy1
jmp.a Strategy2
jmp.a Strategy3

Strategy0
dat $0000, $0000

Strategy1
dat $1111, $1111

Strategy2
dat $2222, $2222

Strategy3
dat $3333, $3333

 >> Stay informed about: Demonstration: Skybuck's Strategy Switcher V2 
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 ]