system "Oscars_Grind_II"
{
Oscar's grind II - Revised from Oscar's Grind that make bets are Even money layouts
The layout pair (ie. Red/Black, Odd/Even) is selected by the User when a New Session has started

When even or ahead, make a unit flat bet (determine from Store # 12) or the difference between the Pairs
For each loss, keep bet the same as the last
For each win, make the same bet again + 1 unit - not to exceed loss of +1 unit

To Start, you must place a bet on both pairs resulting in a 0 Win, 0 Loss until a Zero hits.
Then, you apply Oscar's Rule and take the difference.  The Bet the difference on
the Dominant number.

Note: Store # 12 holds the starting bet amount.  If you want to increase the starting
amount, change it here.  The higher the increase, the more aggressive.
}
method "main"
begin
    While Starting a New Session
    begin
        Set List [0,0] for Record "Temp Amount List" data;
        Set List [0,0] for Record "Layout List" data;
        Clear Record "Layout number" data;
        Clear Record "Baseline (high bankroll)" data;
        Clear Record "Amount behind (if any)" data;
        Clear Record "Layout List" layout;
        Clear Record "Original Bet List" data;
        Clear Record "Starting Bet Amount" data;
        Put 1  on Record "Starting Bet Amount" data;
        Call "Input Layout";
        Call "Setup Layout";
    end

    //Keep track of high bankroll
    While Bankroll > Record "Baseline (high bankroll)" data
    begin
        Put 100 % of Bankroll on Record "Baseline (high bankroll)" data;
    end

    //Calculate amount behind from high bankroll
    Put 100 % of Record "Baseline (high bankroll)" data on Record "Amount behind (if any)" data;
    Subtract 100 % of Bankroll on Record "Amount behind (if any)" data;
    Put 1 on record "Layout List" data index;
    Put 1 on record "Layout List" layout index;
    Put 1 on record "Original Bet List" data index;
    Put 1 on record "Temp Amount List" data index;
    Call "Calc Layout";
    Put 2 on record "Layout List" data index;
    Put 2 on record "Layout List" layout index;
    Put 2 on record "Original Bet List" data index;
    Put 2 on record "Temp Amount List" data index;
    Call "Calc Layout";
    Call "Make Bet";
end

method "Calc Layout"
begin
    Put 100% of Record "Original Bet List" data on Record "Layout List" data;
    Put 100% of Record "Layout List" data on Record "Temp Amount List" data;
    
    While Record "Layout 1" layout has won each time
    And  Record "Amount behind (if any)" data > 0
    And  Record "Amount behind (if any)" data < Record "Temp Amount List" data
    begin
        Put 100 % of Record "Amount behind (if any)" data on Record "Layout List" data;
        Put 100 % of Record "Layout List" data on Record "Temp Amount List" data;
    end
    
    While Record "Layout List" layout has won each time
    And  Record "Amount behind (if any)" data > 0
    begin
        Add 1 on Record "Layout List" Data;
    end
    
    While Record "Temp Amount List" data = 0
    Or Record "Amount behind (if any)" data <= 0
    begin
        Put 100% of Record "Starting Bet Amount" data on Record "Layout List" data;
        Put 100% of Record "Layout List" Data index to record "Temp Amount List" data Index;
        Put 100% of Record "Layout List" data on Record "Temp Amount List" data;
    end
end

method "Make Bet"
begin
    Put 1 on Record "Layout List" data index;
    Put 1 on Record "Layout List" Layout index;
    Put 1 on Record "Original Bet List" data index;
    Put 100% of Record "Layout List" data on Record "Original Bet List" data;
    Put 100% of Record "Layout List" data on Record "Layout List" Layout;

    Put 2 on Record "Layout List" data index;
    Put 2 on Record "Layout List" Layout index;
    Put 2 on Record "Original Bet List" data index;
    Put 100% of Record "Layout List" data on Record "Original Bet List" data;
    Put 100% of Record "Layout List" data on Record "Layout List" Layout;
    Put 100% of Record "Layout List" data on Record "temp data" data;

    Put 1 on Record "Layout List" data index;
    Put 1 on Record "Layout List" layout index;

    While Record "Layout List" data > Record "temp data" data
    begin
        Subtract 100% of Record "temp data" data on Record "Layout List" data;
        Put 100% of Record "Layout List" data on Record "Layout List" layout;
        Put 2 on Record "Layout List" layout index;
        Put 0  on Record "Layout List" layout;
    end
    
    Put 100% of Record "Layout List" data on Record "temp data" data;
    Put 2 on Record "Layout List" data index;
    Put 2 on Record "Layout List" layout index;

    While Record "Layout List" data > Record "temp data" data
    begin
        Subtract 100% of Record "temp data" data on Record "Layout List" data;
        Put 100% of Record "Layout List" data on Record "Layout List" layout;
        Put 1 on Record "Layout List" Layout index;
        Put 0 on Record "Layout List" layout;
    end
end

method "Input Layout"
begin
    Input Dropdown "Make a Layout Pair Selection

              1:=Even/Odd
              2:=Red/Black
              3:=High(19-36)/Low (1-18)" to
            Record "Layout number" data;
end

method "Setup Layout"
begin
    While Record "Layout number" data = 1
    begin
        Copy List [Even,Odd] to Record "Layout List" layout;
    end
    Else
    begin
        While Record "Layout number" data = 2
        begin
            Copy List [Red,Black] to Record "Layout List" layout;
        end
        Else
        begin
            While Record "Layout number" data = 3
            begin
                Copy List [High,Low] to Record "Layout List" layout;
            end
        end
    end
end
