After experimenting a lot with quick scanners I had this crazy idea:competative after more iterations.
What if we could combine the speed of a qscan with for example a oneshot?
Sometimes it's refreshing to tinker around with new strategies and this is one I've tried before. Based on other failed attempts I didn't think it was possible. In the end however I managed to create something that works well enough to possibly be
To get this high scanning speed we need to create a table with all the positions that we want to have scanned. Like this:clear in a better spot. Including boot it just takes 166 cycles to accomplish this, approaching hyperspeed 1C.
n for 79
dat zero - (47*n) , zero + 50 + (49*n)
rof
Now we can scan using this cute tiny 1C scanner:
wPtr sne.i *tableEnd , @tableEnd
djn.f {0 , }0
When we find something, we translate back the position:
add.f *wPtr , wPtr ; move pointer over for clear
jmz.f clear , *wPtr ; jump if A-field is zero
mov.x wPtr , wPtr ; swap A - B, we attack B
jmp clear
Obviously the table is a giant target for scanners and quick scanners, so we quickly boot away our code and turn it all into a decoy. It has a rather limited scan run of course, just 79*2 = 158 positions. One is actually a self-scan to activate the
I'm not able to make it work well enough for a hill, but the idea is there and it scores about the same as other oneshots I've created.
It might be very benificial to have other ordering in the table or use mixed stepsizes, you're free to pick whatever numbers you like, where you like. I haven't dared to put it into an optimizer to tweak all 158 values.
Another idea I'd like to try is skipping "the compare and swap" and do a bi-clear style clear on both A/B fields at the same time... if anybody tries this let me know!
What do you think?
Here is the code:
;redcode-94nop
;name Hyperscan
;author Roy van Rijn
;strategy Rethinking what a qscan can be
;strategy Scans 158 positions in 166 cycles
;assert 1
zero equ wGo-100
bDist equ 4011
bPtr equ wPtr + bDist
; Big table with scan pointers, do whatever you like here:
n for 79
dat zero - (47*n) , zero + 50 + (49*n)
rof
; Boot the code using least possible lines:
wGo mov.i wPtr + 8 , bPtr + 10
mov.i wPtr + 7 , bPtr + 9
mov.i wPtr + 7 , bPtr + 8
mov.i wPtr + 6 , bPtr + 7
add.b wPtr + 6 , } bPtr + 6
mov.i wPtr + 5 , bPtr + 5
mov.i wPtr + 4 , bPtr + 4
mov.i wPtr + 3 , bPtr + 3
mov.i wPtr + 2 , bPtr + 2
mov.i wPtr + 1 , bPtr + 1
mov.i wPtr , bPtr
boot djn.f bPtr , bPtr + 9
; small scanner
wPtr sne.i *wGo-1-bDist , @wGo-1-bDist
djn.f {0 , }0
; set up the clear:
add.f *-2 , *0 ; move pointer over for clear
jmz.f 4 , *wPtr ; compare and
mov.x wPtr , wPtr ; swap
djn.b 2 , wPtr ; jump to clear and decrement scan
; simple SD clear:
; dat 1 , 13 ;generated by boot
spl #224 , 13
mov *-2 , >-8
; mov *-3 , >ptr ;generated by boot
djn.f -2 , }-3
end wGo
While I was working on round 4 of Christian's recent tournament I bumped into T-Scan and Afterglow where John M does something similar but I hadn't followed them up yet.
tablescan.red)While I was working on round 4 of Christian's recent tournament I
bumped into T-Scan and Afterglow where John M does something similar
but I hadn't followed them up yet.
Haha nice, I just looked up Table Scan (https://users.obs.carnegiescience.edu/birk/COREWAR/TINY/HILL/
and it does almost exactly the same thing, SNE/DJN, nice.
Perhaps I can use those warriors to improve the strategy further.
Thanks!
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 388 |
Nodes: | 16 (2 / 14) |
Uptime: | 05:10:44 |
Calls: | 8,219 |
Calls today: | 17 |
Files: | 13,122 |
Messages: | 5,872,259 |
Posted today: | 1 |