_Title "Lucky Numbers by Donald L. Foster Jr."

Screen _NewImage(1035, 735, 256)

Randomize Timer

_PaletteColor 1, _RGB32(0, 0, 90) '      Blue Playing Board
_PaletteColor 2, _RGB32(0, 155, 155) '   Cyan Board Spacer
_PaletteColor 3, _RGB32(235, 195, 0) '   Gold Card
_PaletteColor 4, _RGB32(50, 185, 30) '   Green Card
_PaletteColor 5, _RGB32(32, 110, 170) '  Blue Card
_PaletteColor 6, _RGB32(138, 43, 226) '  Purple Card

Dim R As Integer
Dim S As Integer
Dim T As Integer
Dim U As Integer
Dim V As Integer
Dim W As Integer
Dim X As Integer
Dim Y As Integer
Dim Z As Integer

Dim X1 As Integer
Dim X2 As Integer
Dim X3 As Integer
Dim X4 As Integer

Dim Player As Integer
Dim Players As Integer
Dim Row As Integer
Dim Column As Integer
Dim Winner As Integer
Dim Card As Integer
Dim CardColor As Integer
Dim Board As Integer
Dim Variation As Integer
Dim DeckCards As Integer
Dim TableCards As Integer
Dim PlayCard As Integer
Dim PlayColor As Integer
Dim OldCard As Integer
Dim OldColor As Integer
Dim LowCard As Integer
Dim Occupied As Integer
Dim CanPlay As Integer
Dim DrawPile As Integer
Dim Table As Integer
Dim Position As Integer
Dim Routine As Integer

Dim DeckColor(80) As Integer
Dim DeckCard(80) As Integer
Dim CardColor(5) As Integer
Dim Placed(80) As Integer
Dim BoardCenterX(5) As Integer
Dim BoardCenterY(5) As Integer
Dim TableCard(12) As Integer
Dim TableColor(12) As Integer
Dim TableX(12) As Integer
Dim TableY(12) As Integer

Dim HoldCard(4, 4) As Integer
Dim HoldColor(4, 4) As Integer
Dim Sorted(4, 4) As Integer
Dim BoardX(5, 4, 4) As Integer
Dim BoardY(5, 4, 4) As Integer
Dim BoardCard(5, 4, 4) As Integer
Dim BoardColor(5, 4, 4) As Integer

CardColor(1) = 3: CardColor(2) = 4: CardColor(3) = 5: CardColor(4) = 6

fontpath$ = Environ$("SYSTEMROOT") + "\fonts\Arialbd.ttf"
fontpath1$ = Environ$("SYSTEMROOT") + "\fonts\Arial.ttf"

Color 2, 0: font& = _LoadFont(fontpath$, 80): _Font font&
Locate 3, 295: Print "L  U  C  K  Y";
Locate 5, 175: Print "N  U  M  B  E  R  S";

Color 15, 0: font& = _LoadFont(fontpath$, 30): _Font font&
Locate 17, 315: Print "How Many Players?  ( 1 to 4 )";

GetPlayers:
A$ = InKey$: If A$ = "" GoTo GetPlayers
If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
If Val(A$) < 1 Or Val(A$) > 4 GoTo GetPlayers
Players = Val(A$)

' Setup Deck of Cards
DeckCards = Players * 20
For Z = 1 To DeckCards: Placed(Z) = 0: Next
For Z = 1 To 20
    For Y = 1 To Players
        Placed: X = Int(Rnd * DeckCards) + 1: If Placed(X) = 0 Then Placed(X) = 1: DeckCard(X) = Z: DeckColor(X) = Y Else GoTo Placed
    Next
Next

Cls

' Get Board X, Y Positions
If Players = 4 Then

    X = 186: Board = 1
    For Z = 1 To 2
        W = 186
        For Y = 1 To 2
            U = X - 122
            For T = 1 To 4
                V = W - 122
                For S = 1 To 4
                    BoardX(Board, T, S) = V: BoardY(Board, T, S) = U
                    V = V + 81
                Next
                U = U + 81
            Next
            BoardCenterX(Board) = W: BoardCenterY(Board) = X
            Board = Board + 1
            W = W + 363
        Next
        X = X + 363
    Next

ElseIf Players = 3 Then

    X = 186: Board = 1
    For Z = 1 To 2
        If Z = 1 Then R = 2: W = 186 Else R = 1: W = 367
        For Y = 1 To R
            U = X - 122
            For T = 1 To 4
                V = W - 122
                For S = 1 To 4
                    BoardX(Board, T, S) = V: BoardY(Board, T, S) = U
                    V = V + 81
                Next
                U = U + 81
            Next
            BoardCenterX(Board) = W: BoardCenterY(Board) = X
            Board = Board + 1
            W = W + 363
        Next
        X = X + 363
    Next

Else

    X = 186: W = 186: Board = 1
    For Z = 1 To 2
        U = X - 122
        For T = 1 To 4
            V = W - 122
            For S = 1 To 4
                BoardX(Board, T, S) = V: BoardY(Board, T, S) = U
                V = V + 81
            Next
            U = U + 81
        Next
        BoardCenterX(Board) = W: BoardCenterY(Board) = X
        Board = Board + 1
        X = X + 363: W = W + 363
    Next

End If

' Draw Board
For Z = 1 To Players
    V = BoardCenterX(Z): U = BoardCenterY(Z)
    Line (V - 175, U - 175)-(V + 175, U + 175), 1, BF
    For Y = 1 To 4
        For X = 1 To 4
            X1 = BoardX(Z, Y, X): X2 = BoardY(Z, Y, X): X3 = 0: X4 = 0: DrawCard X1, X2, X3, X4
        Next
    Next
Next

' Setup Table Locations
X = 1: V = 360
For Z = 1 To 4
    U = 800
    For Y = 1 To 3
        TableX(X) = U: TableY(X) = V
        X = X + 1: U = U + 81
    Next
    V = V + 81
Next

Color 2, 0: font& = _LoadFont(fontpath$, 25): _Font font&
_PrintString (812, 10), "L  U  C  K  Y"
_PrintString (774, 35), "N  U  M  B  E  R  S"

Color 15, 0: font& = _LoadFont(fontpath$, 16): _Font font&
Locate 45, 760: Print "Use Michael's Variation?  Y or N";

GetVariation:
A$ = UCase$(InKey$): If A$ = "" GoTo GetVariation
If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
If A$ = "Y" Then Variation = 1 Else If A$ = "N" Then Variation = 0 Else GoTo GetVariation

' Add Starting Cursors for Michael's Variation
If Variation = 1 Then

    For Z = 1 To Players
        For R = 1 To 4
            Color 15, 0: font& = _LoadFont(fontpath1$, 16): _Font font&
            Locate 45, 750: Print "Place Starting Card on Your Board";

            V = BoardCenterX(Z): U = BoardCenterY(Z)
            Line (V - 176, U - 176)-(V + 176, U + 176), 15, B

            For Y = 1 To 4
                V = BoardX(Z, Y, Y): U = BoardY(Z, Y, Y)
                If BoardCard(Z, Y, Y) = 0 Then
                    Line (V - 39, U - 39)-(V + 39, U + 39), 15, B
                Else
                    Line (V - 39, U - 39)-(V + 39, U + 39), 1, B
                End If
            Next

            X1 = 881: X2 = 110: X3 = Z: X4 = CardColor(Z): DrawCard X1, X2, X3, X4
            Color 15, 0: font& = _LoadFont(fontpath$, 25): _Font font&
            _PrintString (833, 155), "Player " + Str$(Z)

            Card = DeckCard(DeckCards): CardColor = DeckColor(DeckCards): DeckCards = DeckCards - 1
            X1 = 881: X2 = 350: X3 = Card: X4 = CardColor: DrawCard X1, X2, X3, X4

            PlaceStartingCard:
            Do While _MouseInput
                For Y = 1 To 4
                    For X = 1 To 4
                        If BoardCard(Z, Y, X) = 0 And ((Y = 1 And X = 1) Or (Y = 2 And X = 2) Or (Y = 3 And X = 3) Or (Y = 4 And X = 4)) Then
                            If _MouseX > BoardX(Z, Y, X) - 40 And _MouseX < BoardX(Z, Y, X) + 40 And _MouseY > BoardY(Z, Y, X) - 40 And _MouseY < BoardY(Z, Y, X) + 40 And _MouseButton(1) = -1 Then
                                GoSub ReleaseButton: Line (841, 310)-(921, 390), 0, BF: X1 = BoardX(Z, Y, X): X2 = BoardY(Z, Y, X): X3 = Card: X4 = CardColor: DrawCard X1, X2, X3, X4
                                Line (BoardX(Z, Y, X) - 39, BoardY(Z, Y, X) - 39)-(BoardX(Z, Y, X) + 39, BoardY(Z, Y, X) + 39), 1, B
                                Line (BoardCenterX(Z) - 176, BoardCenterY(Z) - 176)-(BoardCenterX(Z) + 176, BoardCenterY(Z) + 176), 0, B
                                BoardCard(Z, Y, X) = Card: BoardColor(Z, Y, X) = CardColor: GoTo EndPlaceCard
                            End If
                        End If
                    Next
                Next
            Loop
            A$ = InKey$: If A$ <> "" Then If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
            GoTo PlaceStartingCard

            EndPlaceCard:
        Next
    Next

Else

    ' Get Hold Cards
    For Z = 1 To 4
        For Y = 1 To Players
            HoldCard(Y, Z) = DeckCard(DeckCards): HoldColor(Y, Z) = DeckColor(DeckCards): DeckCards = DeckCards - 1
        Next
    Next

    ' Sort Hold Cards
    For Z = 1 To Players
        For Y = 1 To 4
            LowCard = 100
            For X = 1 To 4
                If HoldCard(Z, X) < LowCard And Sorted(Z, X) = 0 Then LowCard = HoldCard(Z, X): CardColor = HoldColor(Z, X): T = X
            Next
            Sorted(Z, T) = 1: X1 = BoardX(Z, Y, Y): X2 = BoardY(Z, Y, Y): X3 = LowCard: X4 = CardColor(CardColor): DrawCard X1, X2, X3, X4
            BoardCard(Z, Y, Y) = LowCard: BoardColor(Z, Y, Y) = CardColor
        Next
    Next

End If

Player = 1: Winner = 0

StartGame:
DrawPile = 0: Table = 0: Occupied = 0

' Draw Player Cursor
Line (BoardCenterX(Player) - 176, BoardCenterY(Player) - 176)-(BoardCenterX(Player) + 176, BoardCenterY(Player) + 176), 15, B
Line (BoardCenterX(Player) - 177, BoardCenterY(Player) - 177)-(BoardCenterX(Player) + 177, BoardCenterY(Player) + 177), 15, B

X1 = 881: X2 = 110: X3 = Player: X4 = CardColor(Player): DrawCard X1, X2, X3, X4
Color 15, 0: font& = _LoadFont(fontpath$, 25): _Font font&
_PrintString (833, 155), "Player " + Str$(Player)

' Display Deck
X1 = 821: X2 = 240: X3 = 100: X4 = 0: DrawCard X1, X2, X3, X4: Line (777, 196)-(865, 284), 15, B
Color 15, 0: font& = _LoadFont(fontpath1$, 16): _Font font&
Locate 43, 750: Print "       Draw a Card From the Deck       ";

'Draw Cursor Around Table If Not Empty
If TableCards > 0 Then
    Color 15, 0: Locate 45, 750: Print "     Or Play a Card From the Table       ";
    Line (756, 316)-(1006, 646), 15, B
Else
    Locate 45, 750: Print String$(70, 32);
End If

ChooseAPlay:
Do While _MouseInput

    ' Draw a Card From the Deck
    If _MouseX > 777 And _MouseX < 865 And _MouseY > 196 And _MouseY < 284 And _MouseButton(1) = -1 Then
        GoSub ReleaseButton: Line (777, 196)-(865, 284), 0, B: Line (756, 316)-(1006, 646), 15, B
        PlayCard = DeckCard(DeckCards): PlayColor = DeckColor(DeckCards): DeckCards = DeckCards - 1
        X1 = 941: X2 = 240: X3 = PlayCard: X4 = CardColor(PlayColor): DrawCard X1, X2, X3, X4: GoTo PlayDeckCard
    End If

    ' Choose Table Cards
    If _MouseX > 756 And _MouseX < 1006 And _MouseY > 316 And _MouseY < 646 And _MouseButton(1) = -1 And TableCards > 0 Then
        GoSub ReleaseButton: GoTo ChooseTableCard
    End If

Loop
A$ = InKey$: If A$ <> "" Then If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
GoTo ChooseAPlay

PlayDeckCard:
Color 15, 0: font& = _LoadFont(fontpath1$, 16): _Font font&
Locate 43, 750: Print "         Play Card on Your Board         ";
Locate 45, 750: Print "        Or Move Card to the Table        ";

ChoosePlay:
Do While _MouseInput

    ' Place Card on Table
    If _MouseX > 756 And _MouseX < 1006 And _MouseY > 316 And _MouseY < 646 And _MouseButton(1) = -1 Then
        GoSub ReleaseButton: Line (897, 196)-(985, 284), 0, BF: Line (756, 316)-(1006, 646), 0, B:
        TableCards = TableCards + 1: TableCard(TableCards) = PlayCard: TableColor(TableCards) = PlayColor:
        X1 = TableX(TableCards): X2 = TableY(TableCards): X3 = PlayCard: X4 = CardColor(PlayColor): DrawCard X1, X2, X3, X4: GoTo EndTurn
    End If

    ' Place Card on Board
    For Z = 1 To 4
        For Y = 1 To 4
            If _MouseX > BoardX(Player, Z, Y) - 35 And _MouseX < BoardX(Player, Z, Y) + 35 And _MouseY > BoardY(Player, Z, Y) - 35 And _MouseY < BoardY(Player, Z, Y) + 35 And _MouseButton(1) = -1 Then
                GoSub ReleaseButton: Row = Z: Column = Y: DrawPile = 1: Table = 0: Routine = 1: GoTo CheckBoardPosition
            End If
        Next
    Next

Loop
A$ = InKey$: If A$ <> "" Then If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
GoTo ChoosePlay


ChooseTableCard:
Color 15, 0: font& = _LoadFont(fontpath1$, 16): _Font font&
Locate 43, 750: Print "       Choose a Table Card to Play       ";
Locate 45, 750: Print "      Or Draw a Card From the Deck       ";

GetTableCard:
Do While _MouseInput

    ' Choose a Card From the Table
    For Z = 1 To TableCards
        If _MouseX > TableX(Z) - 35 And _MouseX < TableX(Z) + 35 And _MouseY > TableY(Z) - 35 And _MouseY < TableY(Z) + 35 And _MouseButton(1) = -1 Then
            GoSub ReleaseButton: Line (756, 316)-(1006, 646), 0, B: Line (777, 196)-(865, 284), 0, B
            Line (TableX(Z) - 41, TableY(Z) - 41)-(TableX(Z) + 41, TableY(Z) + 41), 15, B
            PlayCard = TableCard(Z): PlayColor = TableColor(Z): Position = Z: Table = 1: DrawPile = 0: GoTo ChooseBoardPosition
        End If
    Next

    ' Choose Draw a Card From the Deck
    If _MouseX > 777 And _MouseX < 865 And _MouseY > 196 And _MouseY < 284 And _MouseButton(1) = -1 Then
        GoSub ReleaseButton: Line (777, 196)-(865, 284), 0, B: Line (756, 316)-(1006, 646), 15, B
        PlayCard = DeckCard(DeckCards): PlayColor = DeckColor(DeckCards): DeckCards = DeckCards - 1
        X1 = 941: X2 = 240: X3 = PlayCard: X4 = CardColor(PlayColor): DrawCard X1, X2, X3, X4: GoTo PlayDeckCard
    End If

Loop
A$ = InKey$: If A$ <> "" Then If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
GoTo GetTableCard

ChooseBoardPosition:
Color 15, 0: font& = _LoadFont(fontpath1$, 16): _Font font&
Locate 43, 750: Print "         Play Card on Your Board         ";
If TableCards > 0 Then Locate 45, 750: Print "          Or a Choose Table Card         ";

GetBoardPosition:
Do While _MouseInput

    ' Reselect Card on Table
    If _MouseX > TableX(Position) - 41 And _MouseX < TableX(Position) + 41 And _MouseY > TableY(Position) - 41 And _MouseY < TableY(Position) + 41 And _MouseButton(1) = -1 Then
        GoSub ReleaseButton: Line (TableX(Position) - 41, TableY(Position) - 41)-(TableX(Position) + 41, TableY(Position) + 41), 0, B
        Line (777, 196)-(865, 284), 15, B: Line (756, 316)-(1006, 646), 15, B: GoTo ChooseTableCard
    End If

    ' Place Card on Board
    For Z = 1 To 4
        For Y = 1 To 4
            If _MouseX > BoardX(Player, Z, Y) - 35 And _MouseX < BoardX(Player, Z, Y) + 35 And _MouseY > BoardY(Player, Z, Y) - 35 And _MouseY < BoardY(Player, Z, Y) + 35 And _MouseButton(1) = -1 Then
                GoSub ReleaseButton: Row = Z: Column = Y:: Routine = 2: GoTo CheckBoardPosition
            End If
        Next
    Next

Loop
A$ = InKey$: If A$ <> "" Then If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
GoTo GetBoardPosition


CheckBoardPosition:
If BoardCard(Player, Row, Column) > 0 Then Occupied = 1: OldCard = BoardCard(Player, Row, Column): OldColor = BoardColor(Player, Row, Column)

X = 1: X1 = 0: X2 = 0: X3 = 0: X4 = 0

Up: If Row - X >= 1 Then
    If BoardCard(Player, Row - X, Column) = 0 Then X = X + 1: GoTo Up Else If PlayCard > BoardCard(Player, Row - X, Column) Then X1 = 1
Else
    X1 = 1
End If

X = 1
Dn: If Row + X <= 4 Then
    If BoardCard(Player, Row + X, Column) = 0 Then X = X + 1: GoTo Dn Else If PlayCard < BoardCard(Player, Row + X, Column) Then X2 = 1
Else
    X2 = 1
End If

X = 1
Lt: If Column - X >= 1 Then
    If BoardCard(Player, Row, Column - X) = 0 Then X = X + 1: GoTo Lt Else If PlayCard > BoardCard(Player, Row, Column - X) Then X3 = 1
Else
    X3 = 1
End If

X = 1
Rt: If Column + X <= 4 Then
    If BoardCard(Player, Row, Column + X) = 0 Then X = X + 1: GoTo Rt Else If PlayCard < BoardCard(Player, Row, Column + X) Then X4 = 1
Else
    X4 = 1
End If

CanPlay = 0
If X1 = 1 And X2 = 1 And X3 = 1 And X4 = 1 Then
    CanPlay = 1
Else
    If Routine = 1 Then GoTo ChoosePlay
    If Routine = 2 Then GoTo GetBoardPosition
End If

' Place Card on Board
If CanPlay = 1 Then

    ' Move Card to the Board
    BoardCard(Player, Row, Column) = PlayCard: BoardColor(Player, Row, Column) = PlayColor
    X1 = BoardX(Player, Row, Column): X2 = BoardY(Player, Row, Column): X3 = PlayCard: X4 = CardColor(PlayColor): DrawCard X1, X2, X3, X4

    ' Move Card from Draw Pile
    If DrawPile = 1 Then Line (897, 196)-(985, 284), 0, BF

    ' Move Card from Table
    If Table = 1 Then

        Line (TableX(Position) - 41, TableY(Position) - 41)-(TableX(Position) + 41, TableY(Position) + 41), 0, BF

        While Position < TableCards

            TableCard(Position) = TableCard(Position + 1): TableColor(Position) = TableColor(Position + 1)
            Line (TableX(Position + 1) - 41, TableY(Position + 1) - 41)-(TableX(Position + 1) + 41, TableY(Position + 1) + 41), 0, BF
            X1 = TableX(Position): X2 = TableY(Position): X3 = TableCard(Position): X4 = CardColor(TableColor(Position)): DrawCard X1, X2, X3, X4
            Position = Position + 1

        Wend

        TableCards = TableCards - 1

    End If

    ' Move Old Card to Table
    If Occupied = 1 Then
        TableCards = TableCards + 1: TableCard(TableCards) = OldCard: TableColor(TableCards) = OldColor
        X1 = TableX(TableCards): X2 = TableY(TableCards): X3 = OldCard: X4 = CardColor(OldColor): DrawCard X1, X2, X3, X4
    End If

End If

EndTurn:

' Check for Winner
X = 0
For Z = 1 To 4
    For Y = 1 To 4
        If BoardCard(Player, Z, Y) > 0 Then X = X + 1
    Next
Next

If X = 16 Then
    Color 15, 0: font& = _LoadFont(fontpath1$, 16): _Font font&
    Locate 43, 750: Print "            Player"; Player; "is the Winner!          ";
    Locate 45, 750: Print "       Play Another Game?  Y or N        ";

    GetYorN: A$ = UCase$(InKey$): If A$ = "" GoTo GetYorN
    If Asc(A$) = 27 And FullScreen = 0 Then FullScreen = -1: _FullScreen _SquarePixels , _Smooth Else If Asc(A$) = 27 Then FullScreen = 0: _FullScreen _Off
    If A$ = "Y" Then Run
    If A$ = "N" Then System
    GoTo GetYorN
End If

Line (BoardCenterX(Player) - 176, BoardCenterY(Player) - 176)-(BoardCenterX(Player) + 176, BoardCenterY(Player) + 176), 0, B
Line (BoardCenterX(Player) - 177, BoardCenterY(Player) - 177)-(BoardCenterX(Player) + 177, BoardCenterY(Player) + 177), 0, B

If Player = Players Then Player = 1 Else Player = Player + 1
GoTo StartGame

ReleaseButton:
Do While _MouseInput
    If _MouseButton(1) = 0 Then Return
Loop
GoTo ReleaseButton

Sub DrawCard (X1, X2, X3, X4)

    fontpath$ = Environ$("SYSTEMROOT") + "\fonts\Arialbd.ttf"

    Line (X1 - 34, X2 - 26)-(X1 - 34, X2 + 26), 2: Line (X1 + 34, X2 - 26)-(X1 + 34, X2 + 26), 2: Line (X1 - 26, X2 - 34)-(X1 + 26, X2 - 34), 2: Line (X1 - 26, X2 + 34)-(X1 + 26, X2 + 34), 2
    Circle (X1 - 26, X2 - 26), 8, 2, 1.5, 3.0: Circle (X1 + 26, X2 - 26), 8, 2, 0, 1.6: Circle (X1 - 26, X2 + 26), 8, 2, 3.0, 4.8: Circle (X1 + 26, X2 + 26), 8, 2, 4.5,

    If X3 = 100 Then

        Paint (X1, X2), 15, 2: Color X4, 15: font& = _LoadFont(fontpath$, 13): _Font font&
        Color 2, 15: _PrintString (804, 225), "Lucky": _PrintString (793, 245), "Numbers"

    ElseIf X3 > 0 Then

        Paint (X1, X2), 2
        Line (X1 - 25, X2 - 22)-(X1 - 25, X2 + 22), 15: Line (X1 + 25, X2 - 22)-(X1 + 25, X2 + 22), 15: Line (X1 - 22, X2 - 25)-(X1 + 22, X2 - 25), 15: Line (X1 - 22, X2 + 25)-(X1 + 22, X2 + 25), 15
        Circle (X1 - 22, X2 - 22), 3, 15, 1.5, 3.0: Circle (X1 + 22, X2 - 22), 3, 15, 0, 1.6: Circle (X1 - 22, X2 + 22), 3, 15, 3.0, 4.8: Circle (X1 + 22, X2 + 22), 3, 15, 4.5, 0
        Paint (X1, X2), 15


        Color X4, 15: font& = _LoadFont(fontpath$, 40): _Font font&
        If X3 < 10 Then X = 20 Else X = 22
        _PrintString (X1 - X, X2 - 15), Right$(Str$(X3), 2)

    End If

End Sub
