system "Humble Variation v1"
{
 Instructions:

}
method "main"
begin
    while starting a new session
    begin
        call "Initialize";
        exit;
    end

    call "Determine Win";

    copy last number to record "last number" layout;

    if Record "last number" layout has hit between 2 & 10 spins
    and flag "1st Bet" is true
    and flag "2nd Bet" is false
    begin
        //we found the second duplicate in the last 14 spins
        copy neighbors Record "last number" layout Record "Neighbor 2" layout
        add 1 Record "Neighbor 2" layout index
        copy last number Record "Neighbor 2" layout
        //tell the system we are betting on the second set of numbers
        set flag "2nd Bet" to true;
    end

    if Record "last number" layout has hit between 2 & 11 spins
    and flag "1st Bet" is false
    begin
        //we found the 1st duplicate in the last 15 spins
        copy neighbors Record "last number" layout Record "Neighbor 1" layout
        add 1 Record "Neighbor 1" layout index
        copy last number Record "Neighbor 1" layout
        //tell the system we are betting on the 1st set of numbers
        set flag "1st Bet" to true;
    end

    call "Make Bet";
end

method "Make Bet"
begin
    if flag "1st Bet" is true
    begin
        put 100% record"Progression"data on record "Neighbor 1"  layout list;
    end

    if flag "2nd Bet" is true
    begin
        put 100% record"Progression"data on record "Neighbor 2"  layout list;
    end
end

method "Determine Win"
begin
    if net > 0
    begin
        call "Initialize";
        Exit;
    end

    if net < 0
    begin
        add 1 record "Progression"data index
        if record "Progression"data index > record "Progression"data count
        begin
            put 1 record "Progression"data index
        end
    end

    if any inside bet lost 12 begin
        clear record "Neighbor 1" layout;
        clear record "Neighbor 2" layout;

        set flag "1st Bet" to false;
        set flag "2nd Bet" to false;
    end
end


method "Initialize"
begin
    set list of [1,1,1,1,2,2,2,3,3,4,5,6,7,8,10,12,14,17,21,25,30,36,43,52]record"Progression"data
    //set list of [1]record"Progression"data
    clear record "Neighbor 1" layout;
    clear record "Neighbor 2" layout;

    set flag "1st Bet" to false;
    set flag "2nd Bet" to false;
    put 1 neighbor count
end
