Let's Play Bingo - British Style

Just BASIC Games
Gearce
Posts: 10
Joined: Sun Apr 15, 2012 8:20 am

Let's Play Bingo - British Style

Post by Gearce »

Let's Play Bingo - British Style

What is British Bingo?
There are many references to the game on the internet but briefly, Bingo or housey-housey (former name in the United Kingdom) is a gambling game that began in Italy in the 1500s. The game is believed to have migrated to France, Great Britain, and other parts of Europe in the 1700s. In UK Bingo, players mark off numbers on a ticket as they are randomly called out, in order to achieve a winning combination. It is not to be confused with the similar American version of bingo, as the tickets and the calling are different.

Playing British Bingo.

Bingo Books:
Books are designed for playing multiple games and come in various forms consisting of 2,3,4,5,6 or even 10 strips. Each strip is of a different colour and consists of 6 tickets. Colours may vary between manufacturers.

Details:
Each ticket has 15 random numbers in all spread over nine vertical columns and three horizontal rows. Each row contains not more than five numbers and each column contains up to three numbers, which are arranged as follows,
The first column contains numbers from 1 to 9,
The second column numbers from 10 to 19,
The third, 30 to 40 and so on up until the last column, which contains numbers from 80 to 90.
Every number from 1 to 90 appears once per strip, so every number called will appear on any one strip. Perforations between each ticket provide for easy splitting.

Play:
Any one of the following combinations can be applied to each ticket.
1 line, 2 lines and Full House
1 line and Full House
2 lines and Full House
1 line and two lines
1 line only
2 lines only
Full House only

You can either purchase tickets from a Bingo supplies store or print your own from any one of the sites on the internet where this is on offer. There are are a number of such sites, but the one which I found most favourable is this one.

The programme has been designed for use with a 6 strip book (12 games, applying the 1 line and Full House combination) but can be modified by changing the total number of games to equal the number of strips per book times two, using the same combination of play. Any other combination would require a rewrite of the programme.

I have used the colours Red, Orange, Yellow, Green, Blue and Pink for the tickets but reference to these can be quite easily changed by using the find/replace (magnifying glass) option in the JB toolbar.

I have used three fonts, Windsordemi (purely for appearance) Arial and Arial Black. The two Arial fonts are generally pre-installed but you may have to install Windsordemi. However, should you not wish to install another font, reference to that font can be changed by using the find/replace option but then the appearance would change.

The programme provides for a randomly generated Special Prize session, in which case the the player with the least number of calls to Full House over the 12 games is declared the winner. Should there be more than one player with the same least number of calls, the winner is selected randomly.

CODE

Code: Select all

    '-----------------------------------------------------------------
    '                           LET'S PLAY BINGO
    '                        A programme by Gearce
    '                              June 2012
    '-----------------------------------------------------------------
    '-----------------------------------------------------------------
    ' Declare array/s
    '-----------------------------------------------------------------
    dim the(90),a(90)
    '-----------------------------------------------------------------
    ' Set up
    '-----------------------------------------------------------------
    NOMAINWIN

    WindowWidth = 800
    WindowHeight = 600
    UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
    UpperLeftY=INT((DisplayHeight-WindowHeight)-300)
    '-----------------------------------------------------------------
    ' This part is originally by cassiope01 in French, and translated
    ' by me. It gives the day, date, month, year and time when the
    ' programme is run
    '-----------------------------------------------------------------
    month$ = "January February March April May June July August September October November December"
    today$ = date$("mm/dd/yyyy")
    j = date$(today$)
    day$ = word$("Tuesday Wednesday Thursday x Friday Saturday x Sunday Monday",int((j/7-int(j/7))*10)+1)
    date$ = day$+"  "+mid$(today$,4,2)+"  "+word$(month$, val(today$))+"  "+mid$(today$,7,4)+"  at  "+left$(time$(),5)

    open "LET'S PLAY BINGO"+space$(60)+date$ for graphics_nf_nsb as #main
    #main "trapclose [quit]"

    #main "down"
    #main "fill black"
    #main "down; backcolor black"
    #main "flush"
    #main "when leftButtonDown [clickit]"
    #main "when rightButtonDown [begin]"
    #main "when characterInput [letter]"

    #main "color 246, 150, 48;font windsordemi 30 bold"
    #main "place 185 40;|LET'S PLAY BINGO"
    '-----------------------------------------------------------------
    ' Randomly determine if special prize session and go to welcome
    ' subroutine
    '-----------------------------------------------------------------
    sp=int(2*rnd(1))
    gosub [welcome]
    [begin]
    '-----------------------------------------------------------------
    ' Pre-determined total games to play (2 games on each of 6 tickets)
    '-----------------------------------------------------------------
    total=12
    '-----------------------------------------------------------------
    ' Come here on odd games
    '-----------------------------------------------------------------
    [nextgame]
    clickit=0
    call erasetext1
    '-----------------------------------------------------------------
    ' Determine odd or even game
    '-----------------------------------------------------------------
    game=game+1
    gosub [gameplay]
    #main "color 246, 150, 48;font arial 12 bold"
    #main "place 30 80;|";play$;colour$
    select case game
        case 1,3,5,7,9,11:game$="odd"
        case else:game$="even"
    end select
    if sp=1 then #main "place 280 80;|SPECIAL PRIZE SESSION"
    '-----------------------------------------------------------------
    ' Shuffle numbers
    '-----------------------------------------------------------------
    for nextnumber=1 to 90
        do
            the(nextnumber)=int(90*rnd(1)+1)
            alreadyfound=0
            '---------------------------------------------------------
            ' Check if a number is already found and if yes, generate
            ' another
            '---------------------------------------------------------
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then
                    alreadyfound=1
                    exit for
                end if
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
    next nextnumber
    '-----------------------------------------------------------------
    ' Go to bingoboard subroutine
    '-----------------------------------------------------------------
    gosub [bingoboard]
    #main "color 246, 150, 48;font arial 12 bold"
    #main "place 30 500;|Left mouse click when ready."
    #main "flush"
    wait
    '-----------------------------------------------------------------
    ' Come here on mouseclick
    '-----------------------------------------------------------------
    [clickit]
    clickit=clickit+1
    if clickit=1 then
        call erasetext2
        #main "place 30 460;|Playing for ANY LINE."
        call Pause 2000
        #main "place 30 500;|Eyes down - First number. Left mouse click to start."
        #main "flush"
    end if
    if clickit=2 then [start]
    if clickit>2 then [nextall]
    wait
    '-----------------------------------------------------------------
    ' Start game play
    '-----------------------------------------------------------------
    [start]
    '-----------------------------------------------------------------
    ' Determine odd/even game
    '-----------------------------------------------------------------
    select case game
        case 1,3,5,7,9,11:game$="odd"
        case else:game$="even"
    end select
    '-----------------------------------------------------------------
    ' Place numbered discs on board and count calls to FULL HOUSE
    '-----------------------------------------------------------------
    for all=1 to 90
        call$="":r$=""
        if sp=1 then
            #main "color 246, 150, 48;font arial 12 bold"
            #main "place 550 80;|Calls to FULL HOUSE    ";str$(all)
            draws$(ticket)=str$(all)
        end if
        gosub [call]
        call erasetext3
        #main "place 700 500;|";str$(a(all))
        #main "color black; font arial_black 18 bold"
        '-------------------------------------------------------------
        ' Define numbers to determine group
        '-------------------------------------------------------------
        a=1:b=16:c=31:d=46:e=61:f=76:g=90

        across=20
        for x=a to b-1
            if x=1 then
                across=across+25:down=93
            else
                across=across+50:down=93
            end if
            gosub [placediscs]
        next x

        across=20
        for x=b to c-1
            if x=16 then
                across=across+25:down=143
            else
                across=across+50:down=143
            end if
            gosub [placediscs]
        next x

        across=20
        for x=c to d-1
            if x=31 then
                across=across+25:down=193
            else
                across=across+50:down=193
            end if
            gosub [placediscs]
        next x

        across=20
        for x=d to e-1
            if x=46 then
                across=across+25:down=243
            else
                across=across+50:down=243
            end if
            gosub [placediscs]
        next x

        across=20
        for x=e to f-1
            if x=61 then
                across=across+25:down=293
            else
                across=across+50:down=293
            end if
            gosub [placediscs]
        next x

        across=20
        for x=f to g
            if x=76 then
                across=across+25:down=343
            else
                across=across+50:down=343
            end if
            gosub [placediscs]
        next x

        #main "flush"
        '-------------------------------------------------------------
        ' Go to select subroutine
        '-------------------------------------------------------------
        gosub [select]
        '-------------------------------------------------------------
        ' Loop to scan for keypresses
        '-------------------------------------------------------------
        [loopHere]
        'make sure #main has input focus
        #main, "setfocus"
        'scan for events
        scan
        goto [loopHere]
        '-----------------------------------------------------------------
        ' Come here when key pressed
        '-----------------------------------------------------------------
        [letter]
        if Inkey$=chr$(13) then [quit]
        if Inkey$=chr$(32) then gosub [check]
        if Inkey$=chr$(110) then
            call erasetext4
            call erasetext2
            call erasetext5
            #main "place 30 460;|Sorry! We have a false claim."
            call Pause 4000
            call erasetext5
            if game$="odd" then
                #main "place 30 460;|Continuing for ANY LINE."
                #main "place 30 500;|Left mouse click."
            else
                #main "place 30 460;|Continuing for FULL HOUSE."
                #main "place 30 500;|Left mouse click."
            end if
            wait
            goto[nextall]
        end if
        if Inkey$=chr$(121) then
            game=game+1
            if game>total and Inkey$=chr$(121) then
                if sp=1 then
                    call erasetext4
                    call erasetext2
                    call erasetext3
                    call erasetext5
                    #main "backcolor black"
                    #main "color 246, 150, 48;font arial 12 bold"
                    #main "place 30 500;|";"Please wait for the winner of tonight's Special Prize for the least number of calls to FULL HOUSE"
                    call Pause 4000
                    goto [finish]
                else
                    call erasetext4
                    call erasetext2
                    goto [closeit]
                end if
            end if
            game$="even"
            call erasetext4
            call erasetext2
            call erasetext3
            call erasetext5
            #main "place 30 460;|Congratulations! We have a winner."
            call Pause 4000
            gosub [gameplay]
            #main "color 246, 150, 48;font arial 12 bold"
            #main "place 30 80;|";play$;colour$
            select case game
                case 3,5,7,9,11
                game=game-1
                goto [nextgame]
            end select
        end if
        if game$="odd" then
            call erasetext4
            call erasetext2
            call erasetext5
            #main "place 30 460;|Congratulations! We have a winner."
            call Pause 4000
        end if
        #main "place 30 460;|Same ticket.   Continuing for FULL HOUSE."
        if game=total then #main "place 400 460;|Last game"
        call Pause 2000
        #main "place 30 500;|Left mouse click for next number"
        wait
        goto [nextall]
        goto [loopHere]

        #main "flush"

    [nextall]
    next all
    wait
    '-----------------------------------------------------------------
    ' Special Prize session end
    '-----------------------------------------------------------------
    [finish]
    call erasetext1
    #main "place 30 100;|Number of calls to FULL HOUSE in order most to least."

    '-----------------------------------------------------------------
    ' Enter elements into array
    '-----------------------------------------------------------------
    max=total/2
    for i=1 to max
        win(i)=val(draws$(i))
    next i
    '-----------------------------------------------------------------
    ' Sort calls most to least
    '-----------------------------------------------------------------
    for k=1 to max-1
        for i=k+1 to max
            if win(i)<=win(k) then [nexti]
            t$=colour$(k)
            colour$(k)=colour$(i)
            colour$(i)=t$ 
            t=win(k)
            win(k)=win(i)
            win(i)=t
            [nexti]
        next i
    next k
    '-----------------------------------------------------------------
    ' Display result
    '-----------------------------------------------------------------
    for i=1 to max
        select case i
            case 1:#main "place 30 150;|Calls to FULL HOUSE ";colour$(1);" ";win(1)
            case 2:#main "place 30 170;|Calls to FULL HOUSE ";colour$(2);" ";win(2)
            case 3:#main "place 30 190;|Calls to FULL HOUSE ";colour$(3);" ";win(3)
            case 4:#main "place 30 210;|Calls to FULL HOUSE ";colour$(4);" ";win(4)
            case 5:#main "place 30 230;|Calls to FULL HOUSE ";colour$(5);" ";win(5)
            case 6:#main "place 30 250;|Calls to FULL HOUSE ";colour$(6);" ";win(6)
        end select
    next i
    '-----------------------------------------------------------------
    ' If two or more same least calls select winner randomly
    '-----------------------------------------------------------------
    for g=1 to 5
        if win(g)=win(6) then
            least=least+1
        end if
    next g

    t=least+1
    if t=6 then
        [six]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [six]
            case 1,2,3,4,5,6:win=x
        end select
        goto [winner]
    end if
    if t=5 then
        [five]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [five]
            case 1,2,3,4,5:win=x+1
        end select
        goto [winner]
    end if
    if t=4 then
        [four]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [four]
            case 1,2,3,4:win=x+2
        end select
        goto [winner]
    end if
    if t=3 then
        [three]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [three]
            case 1,2,3:win=x+3
        end select
        goto [winner]
    end if
    if t=2 then
        [two]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [two]
            case 1,2:win=x+4
        end select
        goto [winner]
    end if
    if t=1 then win=6

    [winner]
    if t>1 then
        #main "place 30 320;|Tonight we have ";str$(t);" players with ";str$(win(6));" calls so, picked at random, tonight's winner is ";colour$(win)
    else
        #main "place 30 320;|Tonight's winner is ";colour$(win)
    end if
    [closeit]
    if sp<>1 then
        call erasetext1
        #main "color 246, 150, 48;font windsordemi 22 bold"
        #main "place 36 240;|Hope you had a pleasant evening. GOOD NIGHT"
        #main "|and see you next time."
        goto [continue]
    end if
    #main "color 246, 150, 48;font windsordemi 22 bold"
    #main "place 36 380;|Hope you had a pleasant evening. GOOD NIGHT"
    #main "|and see you next time."
    [continue]
    #main "color 246, 150, 48;font arial 12 bold"
    #main "place 30 500;|Quit by clicking the 'x' Close button top right."
    #main "when characterInput"
    #main "when leftButtonDown"
    #main "when rightButtonDown"
    #main "flush"
    wait
    '-----------------------------------------------------------------
    ' End programme
    '-----------------------------------------------------------------
    [quit]
        Close #main
    END
    '-----------------------------------------------------------------
    ' Welcome
    '-----------------------------------------------------------------
    [welcome]
        #main "color 246, 150, 48;font windsordemi 22 bold"
        #main "place 52 240;|Hello! and welcome. Hope you have a pleasant"
        #main "|evening and GOOD LUCK."
        #main "color 246, 150, 48;font arial 12 bold"
        if sp=1 then #main "place 260 340;|Tonight is a Special Prize session."
        #main "place 30 500;|Right mouse click to continue."
        #main "flush"
        wait
    return
    '-----------------------------------------------------------------
    ' Draw bingo board subroutine
    '-----------------------------------------------------------------
    [bingoboard]
        #main "color 246, 150, 48"
        '-------------------------------------------------------------
        ' Draw vertical grid lines
        '-------------------------------------------------------------
        for x=20 to 770, step 50
            #main "line "; x; " "; 100; " "; x; " "; 400
        next x
        '-------------------------------------------------------------
        ' Draw horizontal grid lines
        '-------------------------------------------------------------
        for y=100 to 400, step 50
            #main "line "; 20; " "; y; " "; 770;" "; y
        next y
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Game and ticket to play subroutine
    '-----------------------------------------------------------------
    [gameplay]
        select case game
            case 1,2:play$="Game "+str$(game):colour$="      Red ticket":ticket=1:colour$(ticket)=" RED ticket"
            case 3,4:play$="Game "+str$(game):colour$="      Orange ticket":ticket=2:colour$(ticket)=" ORANGE ticket "
            case 5,6:play$="Game "+str$(game):colour$="      Yellow ticket":ticket=3:colour$(ticket)=" YELLOW ticket "
            case 7,8:play$="Game "+str$(game):colour$="      Green ticket":ticket=4:colour$(ticket)=" GREEN ticket "
            case 9,10:play$="Game "+str$(game):colour$="      Blue ticket":ticket=5:colour$(ticket)=" BLUE ticket "
            case 11,12:play$="Game "+str$(game):colour$="      Pink ticket":ticket=6:colour$(ticket)=" PINK ticket "
        end select
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Pause subroutine
    '-----------------------------------------------------------------
    sub Pause mil
        t=time$("milliseconds")
        while time$("milliseconds")<t+mil
        wend
    end sub
    '-----------------------------------------------------------------
    ' Place discs on board subroutine
    '-----------------------------------------------------------------
    [placediscs]
        if a(all)=x then
            #main "place ";across;" ";down;";";"|"
            #main "backcolor 246, 150, 48; circlefilled 25"
            if x<10 then
                #main "place ";across-7;" ";down+42;";";"|";str$(a(all))
            else
                #main "place ";across-16;" ";down+42;";";"|";str$(a(all))
            end if
        end if
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Make call subroutine
    '-----------------------------------------------------------------
    [call]
        select case a(all)
            select case right$(str$(a(all)),1)
                case "1":r$="one"
                case "2":r$="two"
                case "3":r$="three"
                case "4":r$="four"
                case "5":r$="five"
                case "6":r$="six"
                case "7":r$="seven"
                case "8":r$="eight"
                case "9":r$="nine"
            end select
            case 1,2,3,4,5,6,7,8,9:call$="On its own number "+right$(str$(a(all)),1)
            case 10:call$="1 and "+right$(str$(a(all)),1)+"          Ten"
            case 11:call$="All the ones          Eleven"
            case 12:call$="1 and "+right$(str$(a(all)),1)+"          Twelve"
            case 13:call$="1 and "+right$(str$(a(all)),1)+"          Thirteen"
            case 14:call$="1 and "+right$(str$(a(all)),1)+"          Fourteen"
            case 15:call$="1 and "+right$(str$(a(all)),1)+"          Fifteen"
            case 16:call$="1 and "+right$(str$(a(all)),1)+"          Sixteen"
            case 17:call$="1 and "+right$(str$(a(all)),1)+"          Seventeen"
            case 18:call$="1 and "+right$(str$(a(all)),1)+"          Eighteen"
            case 19:call$="1 and "+right$(str$(a(all)),1)+"          Nineteen"
            case 20,21:call$="2 and "+right$(str$(a(all)),1)+"         Twenty "+r$
            case 22:call$="All the twos          Twenty two"
            case 23,24,25,26,27,28,29:call$="2 and "+right$(str$(a(all)),1)+"          Twenty "+r$
            case 30,31,32:call$="3 and "+right$(str$(a(all)),1)+"          Thirty "+r$
            case 33:call$="All the threes          Thirty three"
            case 34,35,36,37,38,39:call$="3 and "+right$(str$(a(all)),1)+"          Thirty "+r$
            case 40,41,42,43:call$="4 and "+right$(str$(a(all)),1)+"          Forty "+r$
            case 44:call$="All the fours          Forty four"
            case 45,46,47,48,49:call$="4 and "+right$(str$(a(all)),1)+"          Forty "+r$
            case 50,51,52,53,54:call$="5 and "+right$(str$(a(all)),1)+"          Fifty "+r$
            case 55:call$="All the fives          Fifty five"
            case 56,57,58,59:call$="5 and "+right$(str$(a(all)),1)+"          Fifty "+r$
            case 60,61,62,63,64,65:call$="6 and "+right$(str$(a(all)),1)+"          Sixty "+r$
            case 66:call$="All the sixes          Sixty six"
            case 67,68,69:call$="6 and "+right$(str$(a(all)),1)+"          Sixty "+r$
            case 70,71,72,73,74,75,76:call$="7 and "+right$(str$(a(all)),1)+"          Seventy "+r$
            case 77:call$="All the sevens          Seventy seven"
            case 78,79:call$="7 and "+right$(str$(a(all)),1)+"          Seventy "+r$
            case 80,81,82,83,84,85,86,87:call$="8 and "+right$(str$(a(all)),1)+"          Eighty "+r$
            case 88:call$="All the eights          Eighty eight"
            case 89:call$="8 and "+right$(str$(a(all)),1)+"          Eighty "+r$
            case 90:call$="Top of the house number 90"
        end select
        #main "backcolor black"
        call erasetext2
        #main "place 30 500;|";call$
        across=708:down=460

        #main "color black; font arial_black 18 bold"
        #main "place ";across;" ";down;";";"|"
        #main "backcolor 246, 150, 48; circlefilled 25"
        if a(all)<10 then
            #main "place ";across-7;" ";down+42;";";"|";str$(a(all))
        else
            #main "place ";across-16;" ";down+42;";";"|";str$(a(all))
        end if
        call Pause 1500
        #main "backcolor black"
        #main "color 246, 150, 48;font arial 12 bold"

        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Make selection subroutine
    '-----------------------------------------------------------------
    [select]
        #main "backcolor black"
        call erasetext2
        call Pause 500
        if game$="odd" then
            #main "place 30 500;|Press Spacebar on LINE call or left mouse click for next number."
        else
            #main "place 30 500;|Press Spacebar on HOUSE call or left mouse click for next number."
        end if
        #main "color black; font arial 18 bold"
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Check call subroutine
    '-----------------------------------------------------------------
    [check]
        #main "backcolor black"
        #main "color 246, 150, 48;font arial 12 bold"
        #main "place 30 540;|";"Checking call - Press 'Y' if correct or 'N' if incorrect."
        wait

    return
    '-----------------------------------------------------------------
    ' Erase text subroutines
    '-----------------------------------------------------------------
    sub erasetext1
        #main "color black; place 0 47; boxfilled 800 600"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext2
        #main "color black; place 0 480; boxfilled 600 520"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext3
        #main "color black; place 670 460; boxfilled 800 520"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext4
        #main "color black; place 0 510; boxfilled 600 550"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext5
        #main "color black; place 0 440; boxfilled 600 470"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub
LANG MEY YER LUM REEK


Life is a coin. You can spend it any way you wish but you can spend it only once
Gearce
Posts: 10
Joined: Sun Apr 15, 2012 8:20 am

Re: Let's Play Bingo - British Style

Post by Gearce »

Here's the programme with an alternative Bingo board for which I 'borrowed' the idea from Point-and-Click Keno by Welopez.

Code: Select all

    '-----------------------------------------------------------------
    '                         NEW LET'S PLAY BINGO
    '                        A programme by Gearce
    '                              July 2012
    '-----------------------------------------------------------------
    '-----------------------------------------------------------------
    ' Declare array/s
    '-----------------------------------------------------------------
    dim the(90),a(90)
    '-----------------------------------------------------------------
    ' Set up
    '-----------------------------------------------------------------
    NOMAINWIN

    WindowWidth = 800
    WindowHeight = 600
    UpperLeftX=INT((DisplayWidth-WindowWidth)/2)
    UpperLeftY=INT((DisplayHeight-WindowHeight)-300)
    '-----------------------------------------------------------------
    ' This part is originally by cassiope01 in French, and translated
    ' by me. It gives the day, date, month, year and time when the
    ' programme is run
    '-----------------------------------------------------------------
    month$ = "January February March April May June July August September October November December"
    today$ = date$("mm/dd/yyyy")
    j = date$(today$)
    day$ = word$("Tuesday Wednesday Thursday x Friday Saturday x Sunday Monday",int((j/7-int(j/7))*10)+1)
    date$ = day$+"  "+mid$(today$,4,2)+"  "+word$(month$, val(today$))+"  "+mid$(today$,7,4)+"  at  "+left$(time$(),5)

    open "LET'S PLAY BINGO"+space$(60)+date$ for graphics_nf_nsb as #main
    #main "trapclose [quit]"

    #main "down"
    #main "fill black"
    #main "down; backcolor black"
    #main "flush"
    #main "when leftButtonDown [clickit]"
    #main "when rightButtonDown [begin]"
    #main "when characterInput [letter]"

    #main "color 246, 150, 48;font windsordemi 30 bold"
    #main "place 185 40;|LET'S PLAY BINGO"
    '-----------------------------------------------------------------
    ' Randomly determine if special prize session and go to welcome
    ' subroutine
    '-----------------------------------------------------------------
    sp=int(2*rnd(1))
    gosub [welcome]
    [begin]
    '-----------------------------------------------------------------
    ' Pre-determined total games to play (2 games on each of 6 tickets)
    '-----------------------------------------------------------------
    total=12
    '-----------------------------------------------------------------
    ' Come here on odd games
    '-----------------------------------------------------------------
    [nextgame]
    clickit=0
    call erasetext1
    '-----------------------------------------------------------------
    ' Determine odd or even game
    '-----------------------------------------------------------------
    game=game+1
    gosub [gameplay]
    #main "color 246, 150, 48;font arial 12 bold"
    #main "place 30 80;|";play$;colour$
    select case game
        case 1,3,5,7,9,11:game$="odd"
        case else:game$="even"
    end select
    if sp=1 then #main "place 280 80;|SPECIAL PRIZE SESSION"
    '-----------------------------------------------------------------
    ' Shuffle numbers
    '-----------------------------------------------------------------
    for nextnumber=1 to 90
        do
            the(nextnumber)=int(90*rnd(1)+1)
            alreadyfound=0
            '---------------------------------------------------------
            ' Check if a number is already found and if yes, generate
            ' another
            '---------------------------------------------------------
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then
                    alreadyfound=1
                    exit for
                end if
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
    next nextnumber
    '-----------------------------------------------------------------
    ' Go to bingoboard subroutine
    '-----------------------------------------------------------------
    gosub [bingoboard]
    #main "color 246, 150, 48;font arial 12 bold"
    #main "place 30 500;|Left mouse click when ready."
    #main "flush"
    wait
    '-----------------------------------------------------------------
    ' Come here on mouseclick
    '-----------------------------------------------------------------
    [clickit]
    clickit=clickit+1
    if clickit=1 then
        call erasetext2
        #main "place 30 460;|Playing for ANY LINE."
        call Pause 2000
        #main "place 30 500;|Eyes down - First number. Left mouse click to start."
        #main "flush"
    end if
    if clickit=2 then [start]
    if clickit>2 then [nextall]
    wait
    '-----------------------------------------------------------------
    ' Start game play
    '-----------------------------------------------------------------
    [start]
    '-----------------------------------------------------------------
    ' Determine odd/even game
    '-----------------------------------------------------------------
    select case game
        case 1,3,5,7,9,11:game$="odd"
        case else:game$="even"
    end select
    '-----------------------------------------------------------------
    ' Count calls to FULL HOUSE
    '-----------------------------------------------------------------
    for all=1 to 90
        call$="":r$=""
        if sp=1 then
            #main "color 246, 150, 48;font arial 12 bold"
            #main "place 550 80;|Calls to FULL HOUSE    ";str$(all)
            draws$(ticket)=str$(all)
        end if
        gosub [call]
        '-------------------------------------------------------------
        ' Define numbers to determine group
        '-------------------------------------------------------------
        a=1:b=16:c=31:d=46:e=61:f=76:g=90

        across=20
        for x=a to b-1
            if x=1 then
                across=across+25:down=93
            else
                across=across+50:down=93
            end if
            gosub [highlight]
        next x

        across=20
        for x=b to c-1
            if x=16 then
                across=across+25:down=143
            else
                across=across+50:down=143
            end if
            gosub [highlight]
        next x

        across=20
        for x=c to d-1
            if x=31 then
                across=across+25:down=193
            else
                across=across+50:down=193
            end if
            gosub [highlight]
        next x

        across=20
        for x=d to e-1
            if x=46 then
                across=across+25:down=243
            else
                across=across+50:down=243
            end if
            gosub [highlight]
        next x

        across=20
        for x=e to f-1
            if x=61 then
                across=across+25:down=293
            else
                across=across+50:down=293
            end if
            gosub [highlight]
        next x

        across=20
        for x=f to g
            if x=76 then
                across=across+25:down=343
            else
                across=across+50:down=343
            end if
            gosub [highlight]
        next x

        #main "flush"
        '-------------------------------------------------------------
        ' Go to select subroutine
        '-------------------------------------------------------------
        gosub [select]
        '-------------------------------------------------------------
        ' Loop to scan for keypresses
        '-------------------------------------------------------------
        [loopHere]
        'make sure #main has input focus
        #main, "setfocus"
        'scan for events
        scan
        goto [loopHere]
        '-----------------------------------------------------------------
        ' Come here when key pressed
        '-----------------------------------------------------------------
        [letter]
        if Inkey$=chr$(13) then [quit]
        if Inkey$=chr$(32) then gosub [check]
        if Inkey$=chr$(110) then
            call erasetext4
            call erasetext2
            call erasetext5
            #main "place 30 460;|Sorry! We have a false claim."
            call Pause 4000
            call erasetext5
            if game$="odd" then
                #main "place 30 460;|Continuing for ANY LINE."
                #main "place 30 500;|Left mouse click."
            else
                #main "place 30 460;|Continuing for FULL HOUSE."
                #main "place 30 500;|Left mouse click."
            end if
            wait
            goto[nextall]
        end if
        if Inkey$=chr$(121) then
            game=game+1
            if game>total and Inkey$=chr$(121) then
                if sp=1 then
                    call erasetext4
                    call erasetext2
                    call erasetext3
                    call erasetext5
                    #main "backcolor black"
                    #main "color 246, 150, 48;font arial 12 bold"
                    #main "place 30 500;|";"Please wait for the winner of tonight's Special Prize for the least number of calls to FULL HOUSE"
                    call Pause 4000
                    goto [finish]
                else
                    call erasetext4
                    call erasetext2
                    goto [closeit]
                end if
            end if
            game$="even"
            call erasetext4
            call erasetext2
            call erasetext3
            call erasetext5
            #main "place 30 460;|Congratulations! We have a winner."
            call Pause 4000
            gosub [gameplay]
            #main "color 246, 150, 48;font arial 12 bold"
            #main "place 30 80;|";play$;colour$
            select case game
                case 3,5,7,9,11
                game=game-1
                goto [nextgame]
            end select
        end if
        if game$="odd" then
            call erasetext4
            call erasetext2
            call erasetext5
            #main "place 30 460;|Congratulations! We have a winner."
            call Pause 4000
        end if
        #main "place 30 460;|Same ticket.   Continuing for FULL HOUSE."
        if game=total then #main "place 400 460;|Last game"
        call Pause 2000
        #main "place 30 500;|Left mouse click for next number"
        wait
        goto [nextall]
        goto [loopHere]

        #main "flush"

    [nextall]
    next all
    wait
    '-----------------------------------------------------------------
    ' Special Prize session end
    '-----------------------------------------------------------------
    [finish]
    call erasetext1
    #main "place 30 100;|Number of calls to FULL HOUSE in order most to least."

    '-----------------------------------------------------------------
    ' Enter elements into array
    '-----------------------------------------------------------------
    max=total/2
    for i=1 to max
        win(i)=val(draws$(i))
    next i
    '-----------------------------------------------------------------
    ' Sort calls most to least
    '-----------------------------------------------------------------
    for k=1 to max-1
        for i=k+1 to max
            if win(i)<=win(k) then [nexti]
            t$=colour$(k)
            colour$(k)=colour$(i)
            colour$(i)=t$ 
            t=win(k)
            win(k)=win(i)
            win(i)=t
            [nexti]
        next i
    next k
    '-----------------------------------------------------------------
    ' Display result
    '-----------------------------------------------------------------
    for i=1 to max
        select case i
            case 1:#main "place 30 150;|Calls to FULL HOUSE ";colour$(1);" ";win(1)
            case 2:#main "place 30 170;|Calls to FULL HOUSE ";colour$(2);" ";win(2)
            case 3:#main "place 30 190;|Calls to FULL HOUSE ";colour$(3);" ";win(3)
            case 4:#main "place 30 210;|Calls to FULL HOUSE ";colour$(4);" ";win(4)
            case 5:#main "place 30 230;|Calls to FULL HOUSE ";colour$(5);" ";win(5)
            case 6:#main "place 30 250;|Calls to FULL HOUSE ";colour$(6);" ";win(6)
        end select
    next i
    '-----------------------------------------------------------------
    ' If two or more same least calls select winner randomly
    '-----------------------------------------------------------------
    for g=1 to 5
        if win(g)=win(6) then
            least=least+1
        end if
    next g

    t=least+1
    if t=6 then
        [six]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [six]
            case 1,2,3,4,5,6:win=x
        end select
        goto [winner]
    end if
    if t=5 then
        [five]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [five]
            case 1,2,3,4,5:win=x+1
        end select
        goto [winner]
    end if
    if t=4 then
        [four]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [four]
            case 1,2,3,4:win=x+2
        end select
        goto [winner]
    end if
    if t=3 then
        [three]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [three]
            case 1,2,3:win=x+3
        end select
        goto [winner]
    end if
    if t=2 then
        [two]
        x=int(t*rnd(1)+1)
        select case x
            case 0:goto [two]
            case 1,2:win=x+4
        end select
        goto [winner]
    end if
    if t=1 then win=6

    [winner]
    if t>1 then
        #main "place 30 320;|Tonight we have ";str$(t);" players with ";str$(win(6));" calls so, picked at random, tonight's winner is ";colour$(win)
    else
        #main "place 30 320;|Tonight's winner is ";colour$(win)
    end if
    [closeit]
    if sp<>1 then
        call erasetext1
        #main "color 246, 150, 48;font windsordemi 22 bold"
        #main "place 36 240;|Hope you had a pleasant evening. GOOD NIGHT"
        #main "|and see you next time."
        goto [continue]
    end if
    #main "color 246, 150, 48;font windsordemi 22 bold"
    #main "place 36 380;|Hope you had a pleasant evening. GOOD NIGHT"
    #main "|and see you next time."
    [continue]
    #main "color 246, 150, 48;font arial 12 bold"
    #main "place 30 500;|Quit by clicking the 'x' Close button top right."
    #main "when characterInput"
    #main "when leftButtonDown"
    #main "when rightButtonDown"
    #main "flush"
    wait
    '-----------------------------------------------------------------
    ' End programme
    '-----------------------------------------------------------------
    [quit]
        Close #main
    END
    '-----------------------------------------------------------------
    ' Welcome
    '-----------------------------------------------------------------
    [welcome]
        #main "color 246, 150, 48;font windsordemi 22 bold"
        #main "place 52 240;|Hello! and welcome. Hope you have a pleasant"
        #main "|evening and GOOD LUCK."
        #main "color 246, 150, 48;font arial 12 bold"
        if sp=1 then #main "place 260 340;|Tonight is a Special Prize session."
        #main "place 30 500;|Right mouse click to continue."
        #main "flush"
        wait
    return
    '-----------------------------------------------------------------
    ' Draw bingo board subroutine
    '-----------------------------------------------------------------
    [bingoboard]
        #main "color 246, 150, 48"
        '-------------------------------------------------------------
        ' Draw vertical grid lines
        '-------------------------------------------------------------
        for x=20 to 770, step 50
            #main "line "; x; " "; 100; " "; x; " "; 400
        next x
        '-------------------------------------------------------------
        ' Draw horizontal grid lines
        '-------------------------------------------------------------
        for y=100 to 400, step 50
            #main "line "; 20; " "; y; " "; 770;" "; y
        next y
        #main "flush"
        '-------------------------------------------------------------
        ' Write numbers
        '-------------------------------------------------------------
        a=1:b=16:c=31:d=46:e=61:f=76:g=90
        for k=1 to 6
            select case k
                case 1:a=1:b=16:across=20:down=93
                case 2:a=16:b=31:across=20:down=143
                case 3:a=31:b=46:across=20:down=193
                case 4:a=46:b=61:across=20:down=243
                case 5:a=61:b=76:across=20:down=293
                case 6:a=76:b=91:across=20:down=343
            end select
            for x=a to b-1
                select case x
                    case 1:across=across+25:#main "place ";across-5;" ";down+40;";";"|";str$(x)
                    case 10,11,12,13,14,15:across=across+50:#main "place ";across-10;" ";down+40;";";"|";str$(x)
                    case 16,31,46,61,76:across=across+20:#main "place ";across-5;" ";down+40;";";"|";str$(x)
                    case else:across=across+50:#main "place ";across-5;" ";down+40;";";"|";str$(x)
                end select
            next x
        next k
    return
    '-----------------------------------------------------------------
    ' Game and ticket to play subroutine
    '-----------------------------------------------------------------
    [gameplay]
        select case game
            case 1,2:play$="Game "+str$(game):colour$="      Red ticket":ticket=1:colour$(ticket)=" RED ticket"
            case 3,4:play$="Game "+str$(game):colour$="      Orange ticket":ticket=2:colour$(ticket)=" ORANGE ticket "
            case 5,6:play$="Game "+str$(game):colour$="      Yellow ticket":ticket=3:colour$(ticket)=" YELLOW ticket "
            case 7,8:play$="Game "+str$(game):colour$="      Green ticket":ticket=4:colour$(ticket)=" GREEN ticket "
            case 9,10:play$="Game "+str$(game):colour$="      Blue ticket":ticket=5:colour$(ticket)=" BLUE ticket "
            case 11,12:play$="Game "+str$(game):colour$="      Pink ticket":ticket=6:colour$(ticket)=" PINK ticket "
        end select
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Pause subroutine
    '-----------------------------------------------------------------
    sub Pause mil
        t=time$("milliseconds")
        while time$("milliseconds")<t+mil
        wend
    end sub
    '-----------------------------------------------------------------
    ' Highlight called numbers
    '-----------------------------------------------------------------
    [highlight]
        if a(all)=x then

        #main "color 246, 150, 48; font arial_black 18 bold"
            #main "place ";across;" ";down;";";"|"
            #main "color green; place ";across;" ";down;" boxfilled ";across+50;" ";down+50
            if x<10 then
                #main "place ";across-7;" ";down+42;";";"|";str$(a(all))
            else
                #main "place ";across-16;" ";down+42;";";"|";str$(a(all))
            end if
        end if
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Call subroutine
    '-----------------------------------------------------------------
    [call]
        select case a(all)
            select case right$(str$(a(all)),1)
                case "1":r$="one"
                case "2":r$="two"
                case "3":r$="three"
                case "4":r$="four"
                case "5":r$="five"
                case "6":r$="six"
                case "7":r$="seven"
                case "8":r$="eight"
                case "9":r$="nine"
            end select
            case 1,2,3,4,5,6,7,8,9:call$="On its own number "+right$(str$(a(all)),1)
            case 10:call$="1 and "+right$(str$(a(all)),1)+"          Ten"
            case 11:call$="All the ones          Eleven"
            case 12:call$="1 and "+right$(str$(a(all)),1)+"          Twelve"
            case 13:call$="1 and "+right$(str$(a(all)),1)+"          Thirteen"
            case 14:call$="1 and "+right$(str$(a(all)),1)+"          Fourteen"
            case 15:call$="1 and "+right$(str$(a(all)),1)+"          Fifteen"
            case 16:call$="1 and "+right$(str$(a(all)),1)+"          Sixteen"
            case 17:call$="1 and "+right$(str$(a(all)),1)+"          Seventeen"
            case 18:call$="1 and "+right$(str$(a(all)),1)+"          Eighteen"
            case 19:call$="1 and "+right$(str$(a(all)),1)+"          Nineteen"
            case 20,21:call$="2 and "+right$(str$(a(all)),1)+"         Twenty "+r$
            case 22:call$="All the twos          Twenty two"
            case 23,24,25,26,27,28,29:call$="2 and "+right$(str$(a(all)),1)+"          Twenty "+r$
            case 30,31,32:call$="3 and "+right$(str$(a(all)),1)+"          Thirty "+r$
            case 33:call$="All the threes          Thirty three"
            case 34,35,36,37,38,39:call$="3 and "+right$(str$(a(all)),1)+"          Thirty "+r$
            case 40,41,42,43:call$="4 and "+right$(str$(a(all)),1)+"          Forty "+r$
            case 44:call$="All the fours          Forty four"
            case 45,46,47,48,49:call$="4 and "+right$(str$(a(all)),1)+"          Forty "+r$
            case 50,51,52,53,54:call$="5 and "+right$(str$(a(all)),1)+"          Fifty "+r$
            case 55:call$="All the fives          Fifty five"
            case 56,57,58,59:call$="5 and "+right$(str$(a(all)),1)+"          Fifty "+r$
            case 60,61,62,63,64,65:call$="6 and "+right$(str$(a(all)),1)+"          Sixty "+r$
            case 66:call$="All the sixes          Sixty six"
            case 67,68,69:call$="6 and "+right$(str$(a(all)),1)+"          Sixty "+r$
            case 70,71,72,73,74,75,76:call$="7 and "+right$(str$(a(all)),1)+"          Seventy "+r$
            case 77:call$="All the sevens          Seventy seven"
            case 78,79:call$="7 and "+right$(str$(a(all)),1)+"          Seventy "+r$
            case 80,81,82,83,84,85,86,87:call$="8 and "+right$(str$(a(all)),1)+"          Eighty "+r$
            case 88:call$="All the eights          Eighty eight"
            case 89:call$="8 and "+right$(str$(a(all)),1)+"          Eighty "+r$
            case 90:call$="Top of the house number 90"
        end select
        #main "backcolor black"
        call erasetext2
        #main "place 30 500;|";call$
        call erasetext3
        #main "color 246, 150, 48;font arial_black 18 bold"
        #main "place 700 500;|";str$(a(all))

        call Pause 2000
        across=708:down=460
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Make selection subroutine
    '-----------------------------------------------------------------
    [select]
        #main "backcolor black"
        call erasetext2
        if game$="odd" then
            #main "place 30 500;|Press Spacebar on LINE call or left mouse click for next number."
        else
            #main "place 30 500;|Press Spacebar on HOUSE call or left mouse click for next number."
        end if
        #main "flush"
    return
    '-----------------------------------------------------------------
    ' Check call subroutine
    '-----------------------------------------------------------------
    [check]
        #main "backcolor black"
        #main "color 246, 150, 48;font arial 12 bold"
        #main "place 30 540;|";"Checking call - Press 'Y' if correct or 'N' if incorrect."
        wait

    return
    '-----------------------------------------------------------------
    ' Erase text subroutines
    '-----------------------------------------------------------------
    sub erasetext1
        #main "color black; place 0 47; boxfilled 800 600"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext2
        #main "color black; place 0 480; boxfilled 600 520"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext3
        #main "color black; place 670 460; boxfilled 800 520"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext4
        #main "color black; place 0 510; boxfilled 600 550"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub

    sub erasetext5
        #main "color black; place 0 440; boxfilled 600 470"
        #main "color 246, 150, 48;font arial 12 bold"
    end sub
LANG MEY YER LUM REEK


Life is a coin. You can spend it any way you wish but you can spend it only once
Gearce
Posts: 10
Joined: Sun Apr 15, 2012 8:20 am

Re: Let's Play Bingo - British Style

Post by Gearce »

Let's Play Bingo British Style - Ticket Generator.

If you like to make your own Bingo tickets rather than buying them, then perhaps you might like to use the same method as I do. It's not that difficult really. All you need is either MS Excel or MS Works to generate your worksheet and a programme to generate the numbers.

The programme below generates the numbers and the 'Let's Play Bingo Ticket Generator zip' file contains two folders MS Excel and MS Works. Each folder contains an MS WordPad document and a respective spreadsheet.

The programme will generate the 90 numbers required in random order.
1 - 9 for use in the first column of the tickets
10 - 19 for use in the second column of the tickets
20 - 29 for use in the third column of the tickets
30 - 39 for use in the fourth column of the tickets
40 - 49 for use in the fifth column of the tickets
50 - 59 for use in the sixth column of the tickets
60 - 69 for use in the seventh column of the tickets
70 - 79 for use in the eighth column of the tickets
80 - 90 for use in the ninth column of the tickets

Code: Select all

' -------------------------------------------
' Let's Play Bingo Ticket Number Generator
'          A programme by Gearce
'                July 2012
' ------------------------------------------

' ------------------------------------------
' declare array/s
' ------------------------------------------
 dim a(90),the(90)
' ------------------------------------------
' Numbers 1 to 9
' ------------------------------------------
 for nextnumber=1 to 9
        do
            the(nextnumber)=int(9*rnd(1)+1)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 10 to 19
' ------------------------------------------
 for nextnumber=10 to 19
        do
            the(nextnumber)=int(10*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 20 to 29
' ------------------------------------------
 for nextnumber=20 to 29
        do
            the(nextnumber)=int(20*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 30 to 39
' ------------------------------------------
 for nextnumber=30 to 39
        do
            the(nextnumber)=int(30*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber


print:print
' ------------------------------------------
' Numbers 40 to 49
' ------------------------------------------
 for nextnumber=40 to 49
        do
            the(nextnumber)=int(40*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 50 to 59
' ------------------------------------------
 for nextnumber=50 to 59
        do
            the(nextnumber)=int(50*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 60 to 69
' ------------------------------------------
 for nextnumber=60 to 69
        do
            the(nextnumber)=int(60*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 70 to 79
' ------------------------------------------
 for nextnumber=70 to 79
        do
            the(nextnumber)=int(70*rnd(1)+10)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber

print:print
' ------------------------------------------
' Numbers 80 to 90
' ------------------------------------------
 for nextnumber=80 to 90
        do
            the(nextnumber)=int(80*rnd(1)+11)
            alreadyfound=0
            rem  =============================================================
            rem    Check if a number is already found and if yes, generate
            rem    another
            rem  =============================================================
            for j=1 to nextnumber
                if a(j)=the(nextnumber) then alreadyfound=1:exit for
            next j
        loop until alreadyfound=0
            a(nextnumber)=the(nextnumber)
            if a(nextnumber)<a(nextnumber-1) then print "|";
            print a(nextnumber);" ";
    next nextnumber
You do not have the required permissions to view the files attached to this post.
LANG MEY YER LUM REEK


Life is a coin. You can spend it any way you wish but you can spend it only once