• [94nop] Discord

    From John Metcalf@21:1/5 to All on Sun Apr 10 08:54:32 2022
    Discord is an Agony-style scanner which ended up looking very similar to Excalibur (.8c scan, .67c wipe, dat clear and an anti-imp step). It's optimized against a paper/imp benchmark and saves one instruction by
    creating dbmb with the instruction at x.



    ;redcode-94nop
    ;name Discord
    ;author John Metcalf
    ;strategy scanner
    ;assert CORESIZE==8000

    st equ 7599 ; 3147 ; 1161 ; 493 ; 903
    gap equ 10 ; 8 ; 8 ; 10 ; 8
    count equ 9 ; 8 ; 8 ; 9 ; 8

    self equ dbmb+gap+3-ptrs

    org scan+1

    scan add inc, ptrs
    ptrs sne scan+st, scan+st-gap
    add.x inc, ptrs
    seq *ptrs, @ptrs
    slt.a #self, ptrs
    jmz scan, #0

    wptr mov.ab ptrs, #4000
    x mov.x #15, dbmb

    wipe mov inc, <wptr
    mov inc, <wptr
    djn.a wipe, dbmb
    jmz scan, scan-1

    inc spl #st, st
    clear mov dbmb, >wipe+2
    djn.f clear, {wipe+2

    dbmb equ x+count

    end



    There's a study of Agony-style scanners in CoreOps issue 1 and a program
    to calculate anti-imp steps below:

    * http://inversed.ru/CoreWar/CoreOps_01.txt



    /* anti-imp - lists anti 3- and 7-point imp steps for CORESIZE 8000 */

    #include <stdio.h>

    int inverse( int b, int m, int s0, int s1 )
    {
    return !m ? s0 : inverse( m, b % m, s1, s0 - s1 * ( b / m ) );
    }

    int gcd( int a, int b )
    {
    return !b ? a : gcd( b, a % b );
    }

    void main()
    {
    unsigned x, coresize = 8000;
    for ( x = 1; x < 50; x++ )
    {
    if ( gcd( x, coresize ) == 1 )
    {
    printf ("%d\n",inverse( 3 * 7 * x, coresize, 1, 0));
    }
    }
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)