Microsoft Word - Ultimate Tic.docx ULTIMATE TIC-TAC-TOE (COVID-19) Due: Thursday, November 19, 2020 by the end of the day (No Late Submission Will Be Accepted) There is a very simple solution to...

1 answer below »
Instructions and source codes are attached. most of method, class, interfaces are already exists, most of works are combining and manipulating existing codes


Microsoft Word - Ultimate Tic.docx ULTIMATE TIC-TAC-TOE (COVID-19) Due: Thursday, November 19, 2020 by the end of the day (No Late Submission Will Be Accepted) 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. 0 O 1 2 0 O 1 2 0 O 1 2 3 4 5 3 4 X 5 3 4 5 6 7 8 6 7 8 6 7 8 O Board #0 Board #1 Board #2 0 X 1 2 0 O 1 2 0 X 1 2 3 4 5 3 4 O 5 3 4 5 6 7 8 6 7 8 6 7 8 O Board #3 Board #4 Board #5 0 O 1 2 0 X 1 2 0 O 1 2 3 4 5 3 4 O 5 3 4 5 6 7 8 6 7 8 6 7 8 X Board #6 Board #7 Board #8 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 0 O 1 X 2 0 1 2 0 1 2 3 4 O 5 3 4 5 O 3 4 5 6 X 7 8 O 6 7 8 6 7 8 Board #0 Board #1 Board #2 0 1 2 0 1 2 0 1 2 3 4 5 3 4 5 3 4 5 6 7 8 6 7 8 6 X 7 8 Board #3 Board #4 Board #5 0 1 2 0 1 2 0 1 2 3 4 O 5 3 4 5 3 4 5 6 7 8 6 7 8 6 7 8 Board #6 Board #7 Board #8 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 0 O 1 X 2 X 0 1 2 0 1 2 3 X 4 O 5 X 3 4 5 O 3 4 5 6 O 7 X 8 O 6 7 8 6 7 8 Board #0 Board #1 Board #2 0 1 2 0 1 2 0 1 2 3 4 5 3 4 5 3 4 5 6 7 8 6 7 8 6 X 7 8 Board #3 Board #4 Board #5 0 1 2 0 1 2 0 1 2 3 4 O 5 3 4 5 3 4 5 6 7 8 6 7 8 6 7 8 X Board #6 Board #7 Board #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.) A FEW CLARIFYING RULES ARE NECESSARY: 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. WHAT/HOW/WHERE/WHEN TO SUBMIT: • Draw a UML class diagram (manual diagram also acceptable). o Identify classes and the relation between them (for example inheritance or aggregation) o Submit your diagram as a PDF file. o Convert your class diagram to software classes. o Your class diagram should reflect your code • Review the Grading criteria and the project rubric in the eLearning o The project is an individual project. o Copying, in whole or in part, from other sources will be considered an act of scholastic dishonesty. • The Project Due on Nov 19, 2020 (by the end of the day) o No Late Submission Will Be Accepted. • The project must be turned in via eLearning ONLY. Please: o Zip all the source codes (.java) in a zip file. All the Java source code necessary to compile and execute your code. o Include a comment section at the beginning of your code with your name, section number, and describe Your Analysis, Design and Test. o A readme file, documenting what you have and/or have not done, describing specific details that you feel we need to know when grading your work. o A video of your running code (to show that, it is working) o No E-Mail Submissions Are Accepted. • This is a command Line game. No GUI. DIFFERENT VERSION OF THE GAME 1. Player versus AI (Mandatory) 2. Program provides a list of possible legal moves to each player. (Optional – extra 5 points) 3. Player versus smart AI* (Optional – extra 5 points) *smart AI will always select the best move to win the game. SAMPLE RUNS: • Payer X is the winner x-winner.txt • Player O is the winner o-winner.txt • no-winner.txt REFERENCES: § Https://mathwithbaddrawings.com/ultimate-tic-tac-toe-original-post/ § https://www.geek.com/games/tic-tac-toe-made-much-more-interesting-with-a-simple- tweak-1559289/ § https://mathwithbaddrawings.com/2013/11/18/tic-tac-toe-puzzles-and-the-difference- between-a-puzzle-and-a-game/ Microsoft Word - Ultimate Tic.docx ULTIMATE TIC-TAC-TOE (COVID-19) Due: Thursday, November 19, 2020 by the end of the day (No Late Submission Will Be Accepted) 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. 0 O 1 2 0 O 1 2 0 O 1 2 3 4 5 3 4 X 5 3 4 5 6 7 8 6 7 8 6 7 8 O Board #0 Board #1 Board #2 0 X 1 2 0 O 1 2 0 X 1 2 3 4 5 3 4 O 5 3 4 5 6 7 8 6 7 8 6 7 8 O Board #3 Board #4 Board #5 0 O 1 2 0 X 1 2 0 O 1 2 3 4 5 3 4 O 5 3 4 5 6 7 8 6 7 8 6 7 8 X Board #6 Board #7 Board #8 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
Answered 5 days AfterApr 21, 2021

Answer To: Microsoft Word - Ultimate Tic.docx ULTIMATE TIC-TAC-TOE (COVID-19) Due: Thursday, November 19, 2020...

Sandeep Kumar answered on Apr 26 2021
150 Votes
game-ultimate-tictactoe-master/.gitignore
/target/
/.classpath
/.project
/.settings/
game-ultimate-tictactoe-master/README.md
# game-ultimate-tictactoe
Game created using the [CodinGame SDK](https://www.codingame.com/playgrounds/25775).
[Play here on CodinGame](https://www.codingame.com/ide/puzzle/tic-tac-toe)
game-ultimate-tictactoe-master/config/Boss.java
game-ultimate-tictactoe-master/config/Boss.java
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
class Player {
    static class Action {
        int row, col;
        public Action(int row, int col) {
            this.row = row;
            this.col = col;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Random random = new Random(0);
        while (true) {
            int opponentRow = in.nextInt();
            int opponentCol = in.nextInt();
            int validActionCount = in.nextInt();
            List actions = new ArrayList<>(validActionCount);
            for (int i = 0; i < validActionCount; i++) {
     int row = in.nextInt();
                int col = in.nextInt();
 
                actions.add(new Action(row, col));
            }
 
            Action a = actions.get(random.nextInt(actions.size()));

            System.out.println(String.format("%d %d", a.row, a.col));
        }
    }
}
game-ultimate-tictactoe-master/config/config.ini
title=Tic-Tac-Toe
min_players=2
max_players=2
game-ultimate-tictactoe-master/config/level1/statement_en.html







This is a league based challenge.


For this challenge, multiple versions of the same game are available. Once you have proven your skills on this first version, you will access a higher league and extra rules will be unlocked.







The Goal



Tic-tac-toe is a turn-based game, where the objective is to get three in a row.








Rules


The game is played on a 3x3 grid. You must output the coordinate of the cell you want to mark. The first player to get 3 of their mark in a row (vertically, horizontally or diagonally) wins.
You can download the source code of this game on GitHub. You can create your own game using the CodinGame SDK!









Game Input




Input for one game turn

Line 1: 2 space separated integers opponentRow and opponentCol, the opponent's last action (-1 -1 for the first turn).
Line 2: the number of valid actions for this turn, validActionCount.
Next validActionCount lines: 2 space separated integers row and col, the coordinates you're allowed to play at.






Output for one game turn

Line 1: 2 space separated integers row and col.





Constraints
Response time for first turn ≤ 1000ms
Response time for one turn ≤ 100ms






What is in store for me in the higher leagues?

The extra rules available in higher leagues are:

Next game will be played on 9 tic-tac-toe boards!

game-ultimate-tictactoe-master/config/level1/statement_fr.html







Ce challenge se déroule en ligue.


Pour ce challenge, plusieurs versions du même jeu seront disponibles. Quand vous aurez prouvé votre valeur dans la première version, vous accéderez à la ligue supérieure et débloquerez de nouvelles règles.







Objectif



Tic-tac-toe est un jeu tour par tour dont l'objectif est d'être le premier à aligner 3 symboles.








Règles


Le jeu se déroule sur une grille 3x3. Vous devez écrire les coordonnées de la case que vous voulez marquer. Le premier joueur qui aligne 3 de ses marques (verticalement, horizontalement et en diagonale) a gagné.
Le code source de ce jeu est disponible sur GitHub. Vous aussi, vous pouvez créer votre jeu à l'aide du CodinGame SDK !









Entrées du jeu




Entrées pour un tour de jeu

Ligne 1: 2 entiers séparés par un espace opponentRow et opponentCol, les coordonnées jouées par l'adversaire au tour précédent (-1 -1 pour le tout premier tour).
Ligne 2: le nombre d'actions valides pour ce tour de jeu, validActionCount.
Les validActionCount lignes suivantes: 2 entiers séparés par un espace row et col, les coordonnées où vous pouvez jouer.






Sortie pour un tour de jeu

Ligne 1: 2 entiers séparés par un espace row et col.





Contraintes
Temps de réponse premier tour ≤ 1000ms
Temps de réponse par tour ≤ 100ms






Qu'est-ce qui m'attend dans les prochaines ligues ?

Les nouvelles règles débloquées dans les prochaines ligues sont :

Le prochain jeu se déroulera sur 9 grilles de tic-tac-toe en même temps !

game-ultimate-tictactoe-master/config/level2/statement_en.html







This is a league based challenge.


For this challenge, multiple versions of the same game are available. Once you have proven your skills on this first version, you will access a higher league and extra rules will be unlocked.







The Goal



We're adding a new level of complexity: the game is now played on a tic-tac-toe board where each square is a normal tic-tac-toe. The objective is to align 3 marks on the main tic-tac-toe board by winning on the smaller boards.








Rules


When a player plays on a small board, he also decides where the next player will be allowed to play: for example, if a player has played in the bottom left square of one of the small boards, the next player will play on the small board located at the bottom left square of the main board.
If a player is sent to a board that is either already won, or full, then that player is allowed to play in any empty square.
You can download the source code of this game on GitHub. You can create your own game using the CodinGame SDK!





Victory Conditions

You've won on 3 aligned smaller tic-tac-toe boards. If nobody managed to get 3 marks aligned, the player that won the most smaller tic-tac-toe boards wins.













Game Input




Input for one game turn

Line 1: 2 space separated integers opponentRow and opponentCol, the opponent's last action (-1 -1 for the first turn).
Line 2: the number of valid actions for this turn, validActionCount.
Next validActionCount lines: 2 space separated integers row and col, the coordinates you're allowed to play at.






Output for one game turn

Line 1: 2 space separated integers row and col.




Constraints
Response time for first turn ≤ 1000ms
Response time for one turn ≤ 100ms
game-ultimate-tictactoe-master/config/level2/statement_fr.html







Ce challenge se déroule en ligue.


Pour ce challenge, plusieurs versions du même jeu seront disponibles. Quand vous aurez prouvé votre valeur dans la première version, vous accéderez à la ligue supérieure et débloquerez de nouvelles règles.







Objectif



Nous ajoutons un nouveau degré de complexité : le jeu se joue maintenant sur une grille de tic-tac-toe où chaque case est un tic-tac-toe classique. L'objectif est d'aligner 3 marques sur la grille de tic-tac-toe principale en gagnant sur les grilles plus petites.








Règles


Lorsqu'un joueur joue sur une petite grille, il décide également de là où pourra jouer le prochain joueur : par exemple, si un joueur joue sur la case située en bas à gauche de l'une des petites grilles, alors le prochain joueur devra jouer sur la petite grille située en bas à gauche de la grille principale.
Si un joueur est envoyé sur une grille déjà gagnée, ou complète, alors le joueur est autorisé à jouer sur n'importe quelle case vide.
Le code source de ce jeu est disponible sur GitHub. Vous aussi, vous pouvez créer votre jeu à l'aide du CodinGame SDK !






Conditions de victoire

Vous avez gagné sur 3 grilles de tic-tac-toe alignées. Si aucun joueur n'arrive à aligner 3 marques, le joueur ayant gagné le plus de petites grilles gagne.













Entrées du jeu




Entrées pour un tour de jeu

Ligne 1: 2 entiers séparés par un espace opponentRow et opponentCol, les coordonnées jouées par l'adversaire au tour précédent (-1 -1 pour le tout premier tour).
Ligne 2: le nombre d'actions valides pour ce tour de jeu, validActionCount.
Les validActionCount lignes suivantes: 2 entiers séparés par un espace row et col, les coordonnées où vous pouvez jouer.






Sortie pour un tour de jeu

Ligne 1: 2 entiers séparés par un espace row et col.




Contraintes
Temps de réponse premier tour ≤ 1000ms
Temps de réponse par tour ≤ 100ms
game-ultimate-tictactoe-master/config/stub.txt
gameloop
read opponentRow:int opponentCol:int
read validActionCount:int
loop validActionCount read row:int col:int
write 0 0
game-ultimate-tictactoe-master/pom.xml

     4.0.0
     com.codingame.game
     tictactoe
     1.0-SNAPSHOT
    
2.7
1.8
1.8
    
    
        
             com.codingame.gameengine
             core
             ${gamengine.version}
        
        
             com.codingame.gameengine
             module-entities
             ${gamengine.version}
        
        
             com.codingame.gameengine
             runner
            ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here