system "Lupo following the dozens v1"
{
*************************************
*      System by luposlipphobia     *
*         on the VIP Lounge         *
*************************************
          Rx-ed by St0rm0r
-------------------------------------
           00-c0mpatible
-------------------------------------
Choose a win goal (e.g. 5 units)
Put 1 unit on 1st dozen.
Then play follow the last dozen.

Bets are increased above 1 unit when a dozen has won 2 times in a row and we
are below the goal. Then go back to 1 unit.

Restart when we reach our goal.
-------------------------------------
}
method "main"
begin
// section 1: do this once
while starting new session
    begin
    call "init"
    end

// section 2: do the tracking
if flag "start" is false
    begin
    track last dozen for 1 record"play"layout
    end

add 100% net record"loss"data

// section 3: act on a loss
if net < 0
    begin
    put 0 record"win"data
    put 1 record"pro"data
    end

// section 4:act on a win
if net > 0
    begin
    add 1 record"win"data
    if record"win"data > 0
        begin
        put 100% record"W"data record"pro"data
        subtract 100% record"loss"data record"pro"data
        put 1000% record"pro"data record"pro"data
        add 5 record"pro"data
        put 5% record"pro"data record"pro"data
        end
    end

if record"loss"data >= record"W"data
    begin
    put 0 record"loss"data
    put 1 record"pro"data
    put 0 record"win"data
    end

//bet
put 100% record"pro"data record"play"layout
set flag "start" is false
end

// subroutines
method "init"
begin
group
    begin
    display "Lupo following the dozens"
    display "----------------------------------------"
    input data "starting bankroll:" bankroll
    input data "win goal (e.g. 5):" record"W"data
    end
put 0 record"loss"data
put 1 record"pro"data
copy 1st dozen record"play"layout
set flag "start" true
put 0 record"win"data
end
