Module Module1 Dim RandomN As New Random Dim Die(4) As Byte Const Players As Byte = 3 Const GameRounds As Byte = 5 Dim Score(Players) As Integer Dim Total(Players) As Integer Dim Reply, Player As Integer Sub Main() For Rounds = 1 To GameRounds Console.ForegroundColor = ConsoleColor.Green ScreenStart("Dice Game Ver 1.0 Round: " & Rounds & " of " & GameRounds, ConsoleColor.DarkGray) Player = 1 Do Until Player > Players RollDice() ShowScore() ThrowAgain() ShowScore() Total(Player) += Score(Player) Player += 1 Loop Console.SetCursorPosition(0, 0 + ((Player - 1) * 10)) Console.WriteLine("Press Key for next Round") Console.ReadLine() Next End Sub Sub DisplayDice(ByVal X As Integer, ByVal Y As Integer, ByVal die As Byte) Console.ForegroundColor = ConsoleColor.White If die / 2 = Int(die / 2) Then Console.ForegroundColor = ConsoleColor.Black Console.SetCursorPosition(X, Y) Select Case die Case 1 Console.Write("********") : Console.SetCursorPosition(X, Y + 1) Console.Write("* *") : Console.SetCursorPosition(X, Y + 2) Console.Write("* *") : Console.SetCursorPosition(X, Y + 3) Console.Write("* 1 *") : Console.SetCursorPosition(X, Y + 4) Console.Write("* *") : Console.SetCursorPosition(X, Y + 5) Console.Write("* *") : Console.SetCursorPosition(X, Y + 6) Console.Write("********") Case 2 Console.Write("********") : Console.SetCursorPosition(X, Y + 1) Console.Write("* *") : Console.SetCursorPosition(X, Y + 2) Console.Write("* 2 *") : Console.SetCursorPosition(X, Y + 3) Console.Write("* *") : Console.SetCursorPosition(X, Y + 4) Console.Write("* 2 *") : Console.SetCursorPosition(X, Y + 5) Console.Write("* *") : Console.SetCursorPosition(X, Y + 6) Console.Write("********") Case 3 Console.Write("********") : Console.SetCursorPosition(X, Y + 1) Console.Write("* 3 *") : Console.SetCursorPosition(X, Y + 2) Console.Write("* *") : Console.SetCursorPosition(X, Y + 3) Console.Write("* 3 *") : Console.SetCursorPosition(X, Y + 4) Console.Write("* *") : Console.SetCursorPosition(X, Y + 5) Console.Write("* 3 *") : Console.SetCursorPosition(X, Y + 6) Console.Write("********") End Select End Sub Sub RollDice() Score(Player) = 0 For i = 0 To 4 RollDie(i) Next End Sub Sub RollDie(ByVal x As Byte) Die(x) = RandomN.Next(1, 4) DisplayDice(x * 9, 2 + ((Player - 1) * 10), Die(x)) Score(Player) += Die(x) End Sub Sub ThrowAgain() Console.WriteLine() Console.ForegroundColor = ConsoleColor.DarkMagenta Console.Write(" 0 for keep: 1-5 for die: 6 for all die?") Reply = Val(Console.ReadLine()) If Reply = 6 Then RollDice() If Reply > 0 And Reply < 6 Then RollDie(Reply - 1) End Sub Sub ShowScore() Console.SetCursorPosition(0, 0 + ((Player - 1) * 10)) Console.ForegroundColor = ConsoleColor.Green Console.Write("Player " & Player & " Scored:" & Score(Player) & " Total = " & Total(Player) + Score(Player)) End Sub Sub ScreenStart(ByVal Title As String, ByVal Colour As Integer) Console.Title = Title Console.SetWindowSize(50, 32) Console.BackgroundColor = Colour Console.Clear() End Sub End Module