Write up Java source codes for compiling and execution of program below. Draw UML diagram for codes. There is a very simple solution to keeping Tic-tac-toe fresh and interesting, though, and it has been thought up by a group of mathematicians. It’s being called Ultimate Tic-tac-toe and simply embeds a Tic-tac-toe board in each of the nine squares of the original game. Now instead of just winning the main board, you also need to win each of the smaller boards first until you have a line of three. New Rule: You can only place a mark on the board determined by the position of your opponent’s last placed mark. So, if they put an X or O in the top right corner of a square, your next move must occur in the top right board. By adding that rule the game is no longer about winning a single board,

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)
1st Edition
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Chapter7: Input And Output: Extending Capabilities Of Computers And Mobile Devices
Section: Chapter Questions
Problem 4MC
icon
Related questions
Question
  • Write up Java source codes for compiling and execution of program below.
  • Draw UML diagram for codes.

There is a very simple solution to keeping Tic-tac-toe fresh and interesting, though, and it has been thought up by a group of mathematicians. It’s being called Ultimate Tic-tac-toe and simply embeds a Tic-tac-toe board in each of the nine squares of the original game.

Now instead of just winning the main board, you also need to win each of the smaller boards first until you have a line of three.

New Rule: You can only place a mark on the board determined by the position of your opponent’s last placed mark. So, if they put an X or O in the top right corner of a square, your next move must occur in the top right board.

By adding that rule the game is no longer about winning a single board, it’s about tactically managing up to 9 games at once and plotting ahead. You still win by marking three squares in a row, but that now involves winning three games.

 

The effects of the New Rule:

1: Your opponent can force you to choose an open square in an already won/tie board.

1- Player X Move:
- Board# : 0
- Square#: 1

2- Player O Move: Only valid Board is Board #1
- Square#: 5

3- Player X Move: Only valid Board is Board #5
- Square#: 6

4- Player O Move: Only valid Board is Board #6
- Square#: 4

For example, after a while Board # 0 has a winner, Player O. It is the Player X turn and the only valid Board# for Player X is Board#0

Player X Move: Only valid Board is Board #0
- Square#: 6

2: If the board is already full, you get a free pass to place your mark in any board

For example, after a while Board # 0 is completely full. It is the Player X turn and the only valid Board# for Player X is Board#0. Since Board#0 is full, then the Player X gets to pick any other Board.

Player X Move:
- Board# : 8
- Square#: 8

The great thing about this rule change and board layout is it remains easy to understand.

 

Basic Rules:

1. Each turn, you mark one of the small squares.

2. When you get three in a row on a small board, you’ve won that board.

3. To win the game, you need to win three small boards in a row.

4. You don’t get to pick which of the nine boards to play on. That’s determined by your opponent’s previous move. Whichever square he picks, that’s the board you must play in next. (And whichever square you pick will determine which board he plays on next.)

 

- Clarifying rules:

1. What if my opponent sends me to a board that’s already been won/tie but not full? In that case, you get to play on that board, but your move doesn’t affect the outcome of that board.

2. What if my opponent sends me to a board that’s already been full? In that case, congratulations – you get to go anywhere you like, on any of the other boards.

  • Write up Java source codes for compiling and execution of program.
  • Draw UML diagram for codes.
3
5
X0x
6
Board #0
Board #1
Board #2
2
1
1
2
4
5
4
3
4
5
6
Board #3
Board #4
Board #5
1
2
1
2
1
2
5
3
4
5
3
5
6
Board #6
Board #7
Board #8
6.
Transcribed Image Text:3 5 X0x 6 Board #0 Board #1 Board #2 2 1 1 2 4 5 4 3 4 5 6 Board #3 Board #4 Board #5 1 2 1 2 1 2 5 3 4 5 3 5 6 Board #6 Board #7 Board #8 6.
2
3
Q
Board #0
X
Board #1
Board #2
2
1
1
3
Board #3
Board #4
Board #5
3
3
5
Board #6
Board #7
Board #8
un
un
un
un
Transcribed Image Text:2 3 Q Board #0 X Board #1 Board #2 2 1 1 3 Board #3 Board #4 Board #5 3 3 5 Board #6 Board #7 Board #8 un un un un
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Enhanced Discovering Computers 2017 (Shelly Cashm…
Enhanced Discovering Computers 2017 (Shelly Cashm…
Computer Science
ISBN:
9781305657458
Author:
Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:
Cengage Learning
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning