system "Tim's 10 number system"
{ Designed Feb 11, 2005 by ShanksComp

The idea is to spin the wheel from spin #1 to spin #10.  Then place 1 unit on
those numbers that came up.  If we loose, we add 1 unit to the bet.  Progression
is up to 5.  Once we win, we spin the wheel until spin #20, and the bet on the
last 10 numbers.}

method "main"
begin
while starting a new session begin
// for use later if progression bets are needed
put 100% of bankroll on record "high" data ;
put 1 on record "spins" data ;
put 1 on record "units" data ;
clear record "spin" layout;
clear record "BetList" layout;
clear record "SpinCount" layout;
clear record "Bet" layout;
end

while on each spin
begin

while any number bet won each time begin
clear record "Bet" layout;
clear record "units" data;
end


while any number bet lost each time begin
if record "units" data = 6 then
// This is set to 6 because of the counter...  Bets will only show 5.
begin
    clear record "Bet" layout;
    clear record "units" data;
end
add 1 to record "units" data;
call "Place Bets";
end

    copy Last Number to record "spin" layout;
//    add 1 to record "SpinCount" layout index;
        if record "spin" layout is not found in record "BetList" layout then
        begin
            set max record to "BetList" layout index;
            add 1 to record "BetList" layout index;
            copy record "spin" layout to record "BetList" layout;
            if record "BetList" layout count > 10 then
            begin
                Move List Up by 1 to record "BetList" layout;
            end
        end
    if record "SpinCount" layout index = 10
    then
    begin
        clear record "SpinCount" layout;
        put 1 on record "Bet" layout index;
        put 1 on record "BetList" layout index;
        loop until record "BetList" layout index > record "BetList" layout count
        begin
            copy record "BetList" layout to record "Bet" layout;
            add 1 to record "BetList" layout index;
            add 1 to record "Bet" layout index;
        end
        call "Place Bets";
    end
    add 1 to record "SpinCount" layout index;
end
end

method "Place Bets"
begin
    // Placing 10 bets
        put 1 on record "Bet" layout index;
        loop until record "Bet" layout index > record "Bet" layout count
        begin
            put 100% of record "units" data on record "bet" layout;
            add 1 to record "Bet" layout index;
            end
end
