@@ -84,4 +84,68 @@ def printGameScreen(gameBoard: GameBoard, player: Cell): Unit = {
8484
8585 renderBoard(gameBoard.bigBoard)
8686 newLine()
87+ }
88+
89+ def printWelcomeScreen(): Unit = {
90+ clearScreen()
91+ with Formatted::formatting
92+ val welcomeScreen: String = """
93+ __ ____ ____________ ______ ____________ ________________ _________ ______ __________ ______
94+ / / / / / /_ __/ _/ |/ / |/_ __/ ____/ /_ __/ _/ ____/ /_ __/ | / ____/ /_ __/ __ \/ ____/
95+ / / / / / / / / // /|_/ / /| | / / / __/ / / / // / ______/ / / /| |/ / ______/ / / / / / __/
96+ / /_/ / /___/ / _/ // / / / ___ |/ / / /___ / / _/ // /__/_____/ / / ___ / /__/_____/ / / /_/ / /___
97+ \____/_____/_/ /___/_/ /_/_/ |_/_/ /_____/ /_/ /___/\____/ /_/ /_/ |_\____/ /_/ \____/_____/
98+
99+ [enter]
100+ """.green
101+ println("\u001b[10H") // Move the cursor to the middle
102+ println(welcomeScreen)
103+ consoleInput()
104+ ()
105+ }
106+
107+ def printExitScreen(): Unit = {
108+ clearScreen()
109+ with Formatted::formatting
110+ val exitScreen: String = """
111+ ______ ____ __
112+ / ____/___ ____ ____/ / /_ __ _____ / /
113+ / / __/ __ \/ __ \/ __ / __ \/ / / / _ \/ /
114+ / /_/ / /_/ / /_/ / /_/ / /_/ / /_/ / __/_/
115+ \____/\____/\____/\__,_/_.___/\__, /\___(_)
116+ /____/
117+
118+ [enter]
119+ """.green
120+ println("\u001b[10H") // Move the cursor to the middle
121+ println(exitScreen)
122+ consoleInput()
123+ ()
124+ }
125+
126+ def printRules(): Unit = {
127+ clearScreen()
128+ val rules: String = """
129+ Ultimate Tic-Tac-Toe Rules:
130+
131+ 1. The Board: The game is played on a large Tic-Tac-Toe board
132+ composed of 9 smaller Tic-Tac-Toe boards.
133+
134+ 2. Winning a Small Board: Within each small board, standard Tic-Tac-Toe rules apply.
135+ The first player to get three in a row (horizontally, vertically, or diagonally) wins that small board.
136+
137+ 3. Winning the Big Board: To win the entire game, a player must win three small boards in a row on the large board.
138+
139+ 4. Where to Play: Your move on the big board is determined by your opponent's previous move.
140+ The small board you must play in next corresponds to the cell number within a small board where your opponent just played.
141+ Example: If your opponent plays in cell '7' of a small board, your next move must be in the small board numbered '7' on the big board.
142+
143+ 5. Sent to a Won Board: If your opponent's move sends you to a small board that has already been won (or is a draw),
144+ you can play in any of the other 8 small boards.
145+
146+ [Enter]
147+ """
148+ println(rules)
149+ consoleInput()
150+ clearScreen()
87151}
0 commit comments