Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shogun Board Game
#1
Quote:Hello all,

Shogun is a 2 player board game. Each player has 7 pawns and 1 king piece. The object of the game is to either (1) capture your opponent's king or (2) capture 6 of your opponent's pawns. Pieces are captured by landing on them, like in chess. The pieces has a rotating disc inside with numbers from 1 to 4 on it. A window at the top of the piece reveals 1 of the digits on the disc. This number represents how many spaces that piece moves on that turn. There is a magnet located on the disc inside the piece and each positions on the board has a magnet in different locations. As the pieces move to different locations, the disc rotates an reveals a new number for that location. A piece can make 1 turn during it's move. There is a button at the bottom of the right hand side that allows the players to display the possible moves. This can be toggled on and off. When a player selects a piece, a white cursor surrounds that piece. If the player wishes to choose a different piece, they can select the same and the piece will be deselected. When the show moves is selected, gold cursors surround all then locations a piece can move to

I have included a photo which has a copy of the rules on it.

Hope you enjoy playing.


   

   

Code: (Select All)
_Title "Shogun 1976 - Programmed by Donald L. Foster Jr."

Screen _NewImage(1010, 736, 32)

_Limit 10: Randomize Timer

Black& = _RGB(0, 0, 0): White& = _RGB(255, 255, 255): Gold& = _RGB(255, 215, 0): Grey& = _RGB(120, 120, 120)

PlayerColor1&(1) = _RGB(200, 0, 0): PlayerColor1&(2) = _RGB(225, 198, 151)
PlayerColor2&(1) = _RGB(255, 0, 0): PlayerColor2&(2) = _RGB(255, 228, 181)

Player = 1: Opponent = 2
ShowMoves = 0: UdateMoves = 0: ButtonPressed = 0

PawnCount(1) = 7: PawnCount(2) = 7: Captured(1) = 0: Captured(2) = 0
CapturedX(1) = 797: CapturedX(2) = 938: X = 0: For Z = 1 To 6: CapturedY(Z) = 225 + X: X = X + 80: Next

BoardMagnetPosition$(1) = "1414323223234141141432322323414132321414414123233232141441412323"
BoardMagnetPosition$(2) = "2121434334341212212143432121434334341212434321214343212112123434"
BoardMagnetPosition$(3) = "3232141441412323323214144141232314143232232341411414323223234141"
BoardMagnetPosition$(4) = "4343212112123434434321211212343421214343343412122121434334341212"

PiecePattern$(1) = "14232314213423144213423142132112"
PiecePattern$(2) = "23143421342134211423314231421221"

Cursor$ = "D76R76U76L77D77R78U78L78"

Crown$(1) = "R16TA65R31TA220R19TA140R19TA220R19TA140R19TA295R31TA0R16"
Crown$(2) = "L16TA65L31TA220L19TA140L19TA220L19TA140L19TA295L31TA0L18"

Piece$(1) = "TA0R29TA135R39TA225R39TA0R29BU10"
Piece$(2) = "TA0L29TA135L39TA225L39TA0L29BD10"

Number$(1) = "BR2BU10L4D20R4U20"
Number$(2) = "BU10BR5L12D4R8D4L8D12R12U4L8U4R8U12"
Number$(3) = "BU10BR5L12D4R8D4L4D4R4D4L8D4R12U20"
Number$(4) = "BU10BR5L4D8L4U8L4D12R8D8R4U20"

' Setup Piece Magnet Patterns
For Z = 1 To 2: W = 1: For Y = 1 To 8: For X = 1 To 4: PieceValue(Z, Y, X) = Val(Mid$(PiecePattern$(Z), W, 1)): W = W + 1: Next: Next: Next

' Setup Board Rotation
Rotation = Int(Rnd * 4) + 1

'Setup Board Magnet
W = 1: For Z = 1 To 8: For Y = 1 To 8: BoardMagnet(Z, Y) = Val(Mid$(BoardMagnetPosition$(Rotation), W, 1)): W = W + 1: Next: Next

' Setup King Location
Z = Int(Rnd * 2): If Z = 0 Then BoardPiece(1, 5) = 8: BoardPiece(8, 4) = 8 Else BoardPiece(1, 4) = 8: BoardPiece(8, 5) = 8

' Setup Pawn Locations
For Z = 1 To 7
    X = 0
    While (X = 0)
        Y = Int(Rnd * 8) + 1: If BoardPiece(1, Y) = 0 Then BoardPiece(1, Y) = Z: X = 1
    Wend
    X = 0
    While (X = 0)
        Y = Int(Rnd * 8) + 1: If BoardPiece(8, Y) = 0 Then BoardPiece(8, Y) = Z: X = 1
    Wend
Next

' Draw Board
Line (0, 0)-(1010, 736), _RGB(255, 255, 255), BF

X = 100
For Z = 0 To 9
    Line (10 + Z, 30)-(10 + Z, 706), _RGB(X, X, X)
    Line (726 - Z, 30)-(726 - Z, 706), _RGB(X, X, X)
    Line (30, 10 + Z)-(706, 10 + Z), _RGB(X, X, X)
    Line (30, 726 - Z)-(706, 726 - Z), _RGB(X, X, X)
    Circle (30, 30), 20 - Z, _RGB(X, X, X), 1.5, 3.1
    Circle (30, 706), 20 - Z, _RGB(X, X, X), 3.0, 4.8
    Circle (706, 30), 20 - Z, _RGB(X, X, X), 0, 1.7
    Circle (706, 706), 20 - Z, _RGB(X, X, X), 4.6, 0
    Paint (100, 100), _RGB(X, X, X)
    X = X - 10
Next

Paint (100, 100), _RGB(X + 10, X + 10, X + 10)

X = 0
For Z = 1 To 8
    W = 0
    For Y = 1 To 8
        If Z = 1 Then BoardPlayer(Z, Y) = 2 Else If Z = 8 Then BoardPlayer(Z, Y) = 1
        If (Z + Y) / 2 = Fix((Z + Y) / 2) Then A& = _RGB(50, 50, 50) Else A& = _RGB(40, 40, 40)
        Line (83 - 37 + W, 83 - 37 + X)-(83 + 37 + W, 83 + 37 + X), A&, BF
        If BoardPlayer(Z, Y) > 0 Then X1 = 83 + W: X2 = 83 + X: X3 = BoardPlayer(Z, Y): X4 = BoardPiece(Z, Y): X5 = PieceValue(X3, X4, BoardMagnet(Z, Y)): GoSub DrawPiece
        BoardX(Z, Y) = 83 + W: BoardY(Z, Y) = 83 + X
        W = W + 82
    Next
    X = X + 82
Next

Color Black&, White&: Locate 2, 99: Print "S  H  O  G  U  N";

' Display Show Moves Button
GoSub ShowMovesButton

StartGame:
' Draw Player Indicator
X1 = 867: X2 = 80: X3 = Player: X4 = 1: X5 = 1: GoSub DrawPiece

Color Black&, White&: Locate 9, 105: Print "Player:"; Player;

' Set Playable Moves to 0
For Z = 1 To 8: For Y = 1 To 8: Playable(Z, Y) = 0: Next: Next

' Is King in ChecK?
If Check = 1 Then Color Black&, White&: Locate 11, 98: Print "YOUR KING IS IN CHECK!!";

GetChooseAPieceInput:
Do While _MouseInput
    MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)

    If (MouseX > 772) * (MouseX < 946) * (MouseY > 679) * (MouseY < 711) * (_MouseButton(1) = -1) Then ButtonPressed = 1: GoSub ShowMovesButton: GoSub ButtonReleased

    For Z = 1 To 8
        For Y = 1 To 8
            If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 38) * (MouseX < BoardX(Z, Y) + 38) * (MouseY > BoardY(Z, Y) - 38) * (MouseY < BoardY(Z, Y) + 38) Then
                If BoardPlayer(Z, Y) = Player Then Row1 = Z: Column1 = Y: GoTo EndChoice1
            End If
        Next
    Next
Loop
GoTo GetChooseAPieceInput

EndChoice1:
' Get Value of Piece Selected.
Piece = PieceValue(Player, BoardPiece(Row1, Column1), BoardMagnet(Row1, Column1))

' Set All Playable Moves to 0.
For Z = 1 To 8: For Y = 1 To 8: Playable(Z, Y) = 0: Next: Next

' Check location for Legal Moves.
X1 = Row1: X2 = Column1: X = 0: On Piece GOSUB Piece1, Piece2, Piece3, Piece4

' Is This Location Legal?
If X = 0 Then GoTo GetChooseAPieceInput

' Draw Cursor Around piece to be Moved.
PSet (BoardX(X1, X2) - 38, BoardY(X1, X2) - 38), White&: Draw Cursor$

' Display Playable Moves
If ShowMoves = 1 Then UpdateMoves = 1: GoSub ShowMovesButton: UpdateMoves = 0

GetChooseLocationInput:
Do While _MouseInput
    MouseX = _MouseX: MouseY = _MouseY: MouseLeftButton = _MouseButton(1)
    If (MouseX > 772) * (MouseX < 946) * (MouseY > 679) * (MouseY < 711) * (_MouseButton(1) = -1) Then ButtonPressed = 1: GoSub ShowMovesButton: GoSub ButtonReleased
    For Z = 1 To 8
        For Y = 1 To 8
            If (MouseLeftButton = -1) * (MouseX > BoardX(Z, Y) - 38) * (MouseX < BoardX(Z, Y) + 38) * (MouseY > BoardY(Z, Y) - 38) * (MouseY < BoardY(Z, Y) + 38) Then
                Row2 = Z: Column2 = Y: GoTo EndChoice2
            End If
        Next
    Next
Loop
GoTo GetChooseLocationInput

EndChoice2:
If (Row2 = Row1) * (Column2 = Column1) Then Reselect = 1: GoTo Cursors Else Reselect = 0

'Check if Position is Playable?
If Playable(Row2, Column2) = 0 Then GoTo GetChooseLocationInput

Cursors:
' Remove Cursors from Board
For Z = 1 To 8
    For Y = 1 To 8
        Playable(Z, Y) = 0: PSet (BoardX(Z, Y) - 38, BoardY(Z, Y) - 38), Black&: Draw Cursor$
    Next
Next

' Check for Reselect Piece
If Reselect = 1 Then GoTo GetChooseAPieceInput

' Check for Capture
If BoardPlayer(Row2, Column2) = Opponent Then
    Captured(Opponent) = Captured(Opponent) + 1
    X1 = CapturedX(Opponent): X2 = CapturedY(Captured(Opponent))
    X3 = Opponent: X4 = BoardPiece(Row2, Column2): X5 = PieceValue(X3, X4, BoardMagnet(Row2, Column2)): GoSub DrawPiece
    If BoardPiece(Row2, Column2) = 8 Then Winner = Player Else If BoardPlayer(Row2, Column2) = Opponent Then PawnCount(Opponent) = PawnCount(Opponent) - 1
End If

' Transfer Piece Information to New Location
BoardPlayer(Row2, Column2) = Player: BoardPiece(Row2, Column2) = BoardPiece(Row1, Column1)

' Remove Piece Information from Old Location
BoardPlayer(Row1, Column1) = 0: BoardPiece(Row1, Column1) = 0

' Remove Piece from Old Location
If (Row1 + Column1) / 2 = Fix((Row1 + Column1) / 2) Then A& = _RGB(50, 50, 50) Else A& = _RGB(40, 40, 40)
Line (BoardX(Row1, Column1) - 37, BoardY(Row1, Column1) - 37)-(BoardX(Row1, Column1) + 37, BoardY(Row1, Column1) + 37), A&, BF

' Redraw Piece in New Location
X1 = BoardX(Row2, Column2): X2 = BoardY(Row2, Column2): X3 = Player: X4 = BoardPiece(Row2, Column2): X5 = PieceValue(X3, X4, BoardMagnet(Row2, Column2)): GoSub DrawPiece

Color Black&, White&: Locate 11, 98: Print "                      ";

'Check for King in Check.
Check = 0: X = 0
For Z = 1 To 8
    For Y = 1 To 8
        Playable(Z, Y) = 0
        If BoardPlayer(Z, Y) = Player Then
            Piece = PieceValue(Player, BoardPiece(Z, Y), BoardMagnet(Z, Y))
            X1 = Z: X2 = Y: On Piece GOSUB Piece1, Piece2, Piece3, Piece4
        End If
    Next
Next

' Check for Winner
If Winner > 0 Then GoTo Winner
If PawnCount(Opponent) = 1 Then Winner = Player: GoTo Winner

Moves = 1: Swap Player, Opponent: GoTo StartGame


DrawPiece:
If X3 = 1 Then W1 = -17: W2 = 32: W3 = 20 Else W1 = 17: W2 = -32: W3 = -20

Line (X1 - 37, X2 - 32)-(X1 - 37, X2 + 32), PlayerColor1&(X3)
Line (X1 + 37, X2 - 32)-(X1 + 37, X2 + 32), PlayerColor1&(X3)
Line (X1 - 32, X2 - 37)-(X1 + 32, X2 - 37), PlayerColor1&(X3)
Line (X1 - 32, X2 + 37)-(X1 + 32, X2 + 37), PlayerColor1&(X3)
Circle (X1 - 32, X2 - 32), 5, PlayerColor1&(X3), 1.5, 3.0
Circle (X1 - 32, X2 + 32), 5, PlayerColor1&(X3), 3.0, 4.8
Circle (X1 + 32, X2 - 32), 5, PlayerColor1&(X3), 0, 1.6
Circle (X1 + 32, X2 + 32), 5, PlayerColor1&(X3), 4.5, 0
Paint (X1, X2), PlayerColor1&(X3)
Circle (X1, X2 + W1), 15, Black&: Paint (X1, X2 + W1), Black&
PSet (X1, X2 + W1), White&: Draw Number$(X5): Paint (X1 + 1, X2 + W1), White&

If X4 = 8 Then
    PSet (X1, X2 + W2), Black&: Draw Crown$(X3): Paint (X1, X2 + W3 - 5), Gold&, Black&
Else
    PSet (X1, X2 + W2), PlayerColor2&(X3): Draw Piece$(X3): Paint (X1, X2 + W3), PlayerColor2&(X3)
End If
Return


Piece1:
Y1 = X1: Y2 = X2: Moves = 0: V = 0: GoSub CheckUp: Moves = 0: V = 0: GoSub CheckRight: Moves = 0: V = 0: GoSub CheckDown: Moves = 0: V = 0: GoSub CheckLeft
Return

Piece2:
If X1 - 1 >= 1 Then If BoardPlayer(X1 - 1, X2) = 0 Then Y1 = X1 - 1: Y2 = X2: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckRight
If X2 + 1 <= 8 Then If BoardPlayer(X1, X2 + 1) = 0 Then Y1 = X1: Y2 = X2 + 1: Moves = 1: V = 0: GoSub CheckDown: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckRight
If X1 + 1 <= 8 Then If BoardPlayer(X1 + 1, X2) = 0 Then Y1 = X1 + 1: Y2 = X2: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckDown: Moves = 1: V = 0: GoSub CheckRight
If X2 - 1 >= 1 Then If BoardPlayer(X1, X2 - 1) = 0 Then Y1 = X1: Y2 = X2 - 1: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckDown
Return

Piece3:
If X1 - 1 >= 1 Then If BoardPlayer(X1 - 1, X2) = 0 Then Y1 = X1 - 1: Y2 = X2: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckRight
If X2 + 1 <= 8 Then If BoardPlayer(X1, X2 + 1) = 0 Then Y1 = X1: Y2 = X2 + 1: Moves = 1: V = 0: GoSub CheckDown: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckRight
If X1 + 1 <= 8 Then If BoardPlayer(X1 + 1, X2) = 0 Then Y1 = X1 + 1: Y2 = X2: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckDown: Moves = 1: V = 0: GoSub CheckRight
If X2 - 1 >= 1 Then If BoardPlayer(X1, X2 - 1) = 0 Then Y1 = X1: Y2 = X2 - 1: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckDown

If X1 - 2 >= 1 Then If (BoardPlayer(X1 - 1, X2) = 0) * (BoardPlayer(X1 - 2, X2) = 0) Then Y1 = X1 - 2: Y2 = X2: Moves = 2: V = 0: GoSub CheckLeft: Moves = 2: V = 0: GoSub CheckUp: Moves = 2: V = 0: GoSub CheckRight
If X2 + 2 <= 8 Then If (BoardPlayer(X1, X2 + 1) = 0) * (BoardPlayer(X1, X2 + 2) = 0) Then Y1 = X1: Y2 = X2 + 2: Moves = 2: V = 0: GoSub CheckDown: Moves = 2: V = 0: GoSub CheckUp: Moves = 2: V = 0: GoSub CheckRight
If X1 + 2 <= 8 Then If (BoardPlayer(X1 + 1, X2) = 0) * (BoardPlayer(X1 + 2, X2) = 0) Then Y1 = X1 + 2: Y2 = X2: Moves = 2: V = 0: GoSub CheckLeft: Moves = 2: V = 0: GoSub CheckDown: Moves = 2: V = 0: GoSub CheckRight
If X2 - 2 >= 1 Then If (BoardPlayer(X1, X2 - 1) = 0) * (BoardPlayer(X1, X2 - 2) = 0) Then Y1 = X1: Y2 = X2 - 2: Moves = 2: V = 0: GoSub CheckLeft: Moves = 2: V = 0: GoSub CheckUp: Moves = 2: V = 0: GoSub CheckDown
Return

Piece4:
If X1 - 1 >= 1 Then If BoardPlayer(X1 - 1, X2) = 0 Then Y1 = X1 - 1: Y2 = X2: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckRight
If X2 + 1 <= 8 Then If BoardPlayer(X1, X2 + 1) = 0 Then Y1 = X1: Y2 = X2 + 1: Moves = 1: V = 0: GoSub CheckDown: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckRight
If X1 + 1 <= 8 Then If BoardPlayer(X1 + 1, X2) = 0 Then Y1 = X1 + 1: Y2 = X2: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckDown: Moves = 1: V = 0: GoSub CheckRight
If X2 - 1 >= 1 Then If BoardPlayer(X1, X2 - 1) = 0 Then Y1 = X1: Y2 = X2 - 1: Moves = 1: V = 0: GoSub CheckLeft: Moves = 1: V = 0: GoSub CheckUp: Moves = 1: V = 0: GoSub CheckDown

If X1 - 2 >= 1 Then If (BoardPlayer(X1 - 1, X2) = 0) * (BoardPlayer(X1 - 2, X2) = 0) Then Y1 = X1 - 2: Y2 = X2: Moves = 2: V = 0: GoSub CheckLeft: Moves = 2: V = 0: GoSub CheckUp: Moves = 2: V = 0: GoSub CheckRight
If X2 + 2 <= 8 Then If (BoardPlayer(X1, X2 + 1) = 0) * (BoardPlayer(X1, X2 + 2) = 0) Then Y1 = X1: Y2 = X2 + 2: Moves = 2: V = 0: GoSub CheckDown: Moves = 2: V = 0: GoSub CheckUp: Moves = 2: V = 0: GoSub CheckRight
If X1 + 2 <= 8 Then If (BoardPlayer(X1 + 1, X2) = 0) * (BoardPlayer(X1 + 2, X2) = 0) Then Y1 = X1 + 2: Y2 = X2: Moves = 2: V = 0: GoSub CheckLeft: Moves = 2: V = 0: GoSub CheckDown: Moves = 2: V = 0: GoSub CheckRight
If X2 - 2 >= 1 Then If (BoardPlayer(X1, X2 - 1) = 0) * (BoardPlayer(X1, X2 - 2) = 0) Then Y1 = X1: Y2 = X2 - 2: Moves = 2: V = 0: GoSub CheckLeft: Moves = 2: V = 0: GoSub CheckUp: Moves = 2: V = 0: GoSub CheckDown

If X1 - 3 >= 1 Then If (BoardPlayer(X1 - 1, X2) = 0) * (BoardPlayer(X1 - 2, X2) = 0) * (BoardPlayer(X1 - 3, X2) = 0) Then Y1 = X1 - 3: Y2 = X2: Moves = 3: V = 0: GoSub CheckLeft: Moves = 3: V = 0: GoSub CheckUp: Moves = 3: V = 0: GoSub CheckRight
If X2 + 3 <= 8 Then If (BoardPlayer(X1, X2 + 1) = 0) * (BoardPlayer(X1, X2 + 2) = 0) * (BoardPlayer(X1, X2 + 3) = 0) Then Y1 = X1: Y2 = X2 + 3: Moves = 3: V = 0: GoSub CheckDown: Moves = 3: V = 0: GoSub CheckUp: Moves = 3: V = 0: GoSub CheckRight
If X1 + 3 <= 8 Then If (BoardPlayer(X1 + 1, X2) = 0) * (BoardPlayer(X1 + 2, X2) = 0) * (BoardPlayer(X1 + 3, X2) = 0) Then Y1 = X1 + 3: Y2 = X2: Moves = 3: V = 0: GoSub CheckLeft: Moves = 3: V = 0: GoSub CheckDown: Moves = 3: V = 0: GoSub CheckRight
If X2 - 3 >= 1 Then If (BoardPlayer(X1, X2 - 1) = 0) * (BoardPlayer(X1, X2 - 2) = 0) * (BoardPlayer(X1, X2 - 3) = 0) Then Y1 = X1: Y2 = X2 - 3: Moves = 3: V = 0: GoSub CheckLeft: Moves = 3: V = 0: GoSub CheckUp: Moves = 3: V = 0: GoSub CheckDown
Return


CheckUp:
If Y1 - V - 1 >= 1 Then
    V = V + 1
    If (Moves + V = Piece) * (BoardPlayer(Y1 - V, Y2) = Opponent) * (BoardPiece(Y1 - V, Y2) = 8) Then Check = 1
    If (Moves + V = Piece) * (BoardPlayer(Y1 - V, Y2) <> Player) Then Playable(Y1 - V, Y2) = 1: X = 1: Return
    If (Moves + V < Piece) * (BoardPlayer(Y1 - V, Y2) = 0) Then GoTo CheckUp
    Return
Else Return
End If
Return

CheckRight:
If Y2 + V + 1 <= 8 Then
    V = V + 1
    If (Moves + V = Piece) * (BoardPlayer(Y1, Y2 + V) = Opponent) * (BoardPiece(Y1, Y2 + V) = 8) Then Check = 1
    If (Moves + V = Piece) * (BoardPlayer(Y1, Y2 + V) <> Player) Then Playable(Y1, Y2 + V) = 1: X = 1: Return
    If (Moves + V < Piece) * (BoardPlayer(Y1, Y2 + V) = 0) Then GoTo CheckRight
    Return
Else Return
End If
Return

CheckDown:
If Y1 + V + 1 <= 8 Then
    V = V + 1
    If (Moves + V = Piece) * (BoardPlayer(Y1 + V, Y2) = Opponent) * (BoardPiece(Y1 + V, Y2) = 8) Then Check = 1
    If (Moves + V = Piece) * (BoardPlayer(Y1 + V, Y2) <> Player) Then Playable(Y1 + V, Y2) = 1: X = 1: Return
    If (Moves + V < Piece) * (BoardPlayer(Y1 + V, Y2) = 0) Then GoTo CheckDown
    Return
Else Return
End If
Return

CheckLeft:
If Y2 - V - 1 >= 1 Then
    V = V + 1
    If (Moves + V = Piece) * (BoardPlayer(Y1, Y2 - V) = Opponent) * (BoardPiece(Y1, Y2 - V) = 8) Then Check = 1
    If (Moves + V = Piece) * (BoardPlayer(Y1, Y2 - V) <> Player) Then Playable(Y1, Y2 - V) = 1: X = 1: Return
    If (Moves + V < Piece) * (BoardPlayer(Y1, Y2 - V) = 0) Then GoTo CheckLeft
    Return
Else Return
End If
Return


ShowMovesButton:
If ButtonPressed = 1 Then ButtonPressed = 0: If ShowMoves = 0 Then ShowMoves = 1 Else ShowMoves = 0

Line (780, 680)-(955, 710), Grey&, BF
Color White&, Grey&: Locate 44, 100: If ShowMoves = 1 Then Print "  Don't Show Moves  "; Else Print "Show Playable Moves";

For Z = 1 To 8
    For Y = 1 To 8
        If (Z = Row1) * (Y = Column1) Then GoTo Skip
        If ShowMoves = 0 Then PSet (BoardX(Z, Y) - 38, BoardY(Z, Y) - 38), Black&: Draw Cursor$
        If ShowMoves = 1 Then If Playable(Z, Y) = 1 Then PSet (BoardX(Z, Y) - 38, BoardY(Z, Y) - 38), Gold&: Draw Cursor$
        Skip:
    Next
Next

Return


ButtonReleased:
Do While _MouseInput
    If _MouseButton(1) = 0 Then Return
Loop
GoTo ButtonReleased


Winner:
Locate 9, 98: Print "Player"; Player; "is the Winner!";

Locate 11, 96: Print "Play Another Game?  (Y / N)"

GetYorN:
A$ = UCase$(InKey$)
If A$ = "" Then GoTo GetYorN
If A$ = "Y" Then Run
If A$ = "N" Then System
GoTo GetYorN
Reply




Users browsing this thread: 2 Guest(s)