Skip to content

Commit 4676f95

Browse files
committed
doc: complete How to play and Use cases sections
1 parent c046c3c commit 4676f95

File tree

2 files changed

+94
-26
lines changed

2 files changed

+94
-26
lines changed

README.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,43 @@ This repository contains the practical work for the Algorithms and Data Structur
7575

7676
## How to play
7777

78-
TODO. <!-- TODO -->
78+
1. Start the game
79+
80+
When the program starts, a menu with three options will appear.
81+
82+
- [A] Play Tic-Tac-Toe: Starts a game of [Tic-Tac-Toe](https://en.wikipedia.org/wiki/Tic-tac-toe).
83+
- [B] Show ranking: Displays the current ranking of the group of players.
84+
- [C] Exit: Ends the program.
85+
86+
2. Start a match
87+
88+
- Players are asked to enter their names. Any number of names can be entered.
89+
- The play order is determined randomly and displayed on the screen.
90+
- Each player will be asked if they are ready to start.
91+
92+
3. During the match
93+
94+
- Each player will play a specified number of games, defined in the [configuration file](./src/statics/configuration.txt).
95+
- In each game, it is randomly assigned whether the player will be `X` or `O`.
96+
- The 3x3 board will be displayed, and the player must enter the position where they want to place their symbol.
97+
- The AI makes its move strategically:
98+
- Blocks the player's victory if possible.
99+
- Wins if it has the opportunity.
100+
- Plays randomly if there are no clear moves.
101+
- The turn alternates between the player and the AI until someone wins or a tie is declared.
102+
103+
4. End of the match
104+
- Points are assigned for each game as follows:
105+
- If the player wins, they receive 3 points.
106+
- If a tie is declared, the player receives 2 points.
107+
- If the AI wins, the player loses 1 point.
108+
- Once all games are completed, a report is generated with:
109+
- Details of the games (including the final state of the board).
110+
- Winner of each game.
111+
- Total score of each player.
112+
- Final result indicating the players with the highest score.
113+
- The report is saved in a text file with the format `game-report_YYYY-MM-DD-HH-mm.txt`.
114+
- The results are sent to an [API](https://simple.wikipedia.org/wiki/Application_programming_interface).
79115

80116
### Rules
81117

@@ -104,18 +140,16 @@ To change the configuration, open the file [configuration.txt](./src/statics/con
104140

105141
### Use cases
106142

107-
<!-- TODO -->
108-
109-
|| Description | Expected result | Received result |
110-
| :-: | :---------- | :-------------- | :-------------- |
111-
| 1 | TODO. | TODO. | TODO. |
112-
| 2 | TODO. | TODO. | TODO. |
113-
| 3 | TODO. | TODO. | TODO. |
114-
| 4 | TODO. | TODO. | TODO. |
115-
| 5 | TODO. | TODO. | TODO. |
116-
| 6 | TODO. | TODO. | TODO. |
117-
| 7 | TODO. | TODO. | TODO. |
118-
| 8 | TODO. | TODO. | TODO. |
143+
|| Description | Expected result | Received result |
144+
| :-: | :------------------------------------------- | :---------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
145+
| 1 | Start the game and select `Play Tic-Tac-Toe` | Prompts for player names and starts the game with a random player | Players take turns randomly to play. |
146+
| 2 | Enter player names | Entered players are registered correctly | Player names are registered and assigned `0` initial points. |
147+
| 3 | Play a turn and win against the AI | The player receives 3 points | 3 points are added to the `points` field of the player structure. |
148+
| 4 | Play a turn and tie against the AI | The player receives 2 points | 2 points are added to the `points` field of the player structure. |
149+
| 5 | Play a turn and lose against the AI | The player loses 1 point | 1 point is subtracted from the `points` field of the player structure. |
150+
| 6 | Complete all games and generate a report | A `.txt` file is generated with the total score | A `.txt` file is generated with the game statistics. |
151+
| 7 | Check group ranking | The group ranking is displayed | The [API](https://simple.wikipedia.org/wiki/Application_programming_interface) is queried, and the group ranking is displayed. |
152+
| 8 | End the game | The program ends without errors | The program ends without errors. |
119153

120154
## Application structure
121155

docs/translations/es/README.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,43 @@ Este repositorio contiene el trabajo práctico de la materia Algoritmos y Estruc
7575

7676
## Cómo jugar
7777

78-
TODO. <!-- TODO -->
78+
1. Iniciar el juego
79+
80+
Al iniciar el programa, aparecerá un menú con tres opciones.
81+
82+
- [A] Jugar Tic-Tac-Toe: Comienza una partida de [Tateti (Ta-C-Ti)](https://es.wikipedia.org/wiki/Tres_en_l%C3%ADnea).
83+
- [B] Mostrar ranking: Muestra el ranking actual de los jugadores del grupo.
84+
- [C] Salir: Finaliza el programa.
85+
86+
2. Iniciar una partida
87+
88+
- Se solicita ingresar los nombres de los jugadores. Se puede ingresar la cantidad de nombres que se desee.
89+
- El orden de juego se determina aleatoriamente y se muestra en pantalla.
90+
- Cada jugador será consultado si está listo para comenzar.
91+
92+
3. Durante la partida
93+
94+
- Cada jugador jugará una cantidad determinada de partidas, definida en el [archivo de configuración](../../../src/statics/configuration.txt).
95+
- En cada partida, se asigna aleatoriamente si el jugador será `X` o `O`.
96+
- Se mostrará el tablero 3x3 y el jugador deberá ingresar la posición donde desea colocar su símbolo.
97+
- La IA realiza su jugada de manera estratégica:
98+
- Bloquea la victoria del jugador si es posible.
99+
- Gana si tiene la oportunidad.
100+
- Juega aleatoriamente si no hay jugadas claras.
101+
- El turno alterna entre el jugador y la IA hasta que alguien gane o se declare empate.
102+
103+
4. Finalización de la partida
104+
- Por cada partida se asignan puntos de la siguiente manera:
105+
- Si el jugador gana, recibe 3 puntos.
106+
- Si declara empate, el jugador recibe 2 puntos.
107+
- Si la IA gana, el jugador pierde 1 punto.
108+
- Una vez finalizadas todas las partidas, se genera un informe con:
109+
- Detalle de las partidas (incluyendo el estado final del tablero).
110+
- Ganador de cada partida.
111+
- Puntaje total de cada jugador.
112+
- Resultado final indicando los jugadores con mayor puntaje.
113+
- El informe se guarda en un archivo de texto con el formato `informe-juego_YYYY-MM-DD-HH-mm.txt`.
114+
- Los resultados se envían a una [API](https://en.wikipedia.org/wiki/API).
79115

80116
### Reglas
81117

@@ -104,18 +140,16 @@ Para cambiar la configuración, abre el archivo [configuration.txt](../../../src
104140

105141
### Casos de uso
106142

107-
<!-- TODO -->
108-
109-
|| Descripción | Resultado esperado | Resultado recibido |
110-
| :-: | :---------- | :----------------- | :----------------- |
111-
| 1 | TODO. | TODO. | TODO. |
112-
| 2 | TODO. | TODO. | TODO. |
113-
| 3 | TODO. | TODO. | TODO. |
114-
| 4 | TODO. | TODO. | TODO. |
115-
| 5 | TODO. | TODO. | TODO. |
116-
| 6 | TODO. | TODO. | TODO. |
117-
| 7 | TODO. | TODO. | TODO. |
118-
| 8 | TODO. | TODO. | TODO. |
143+
|| Descripción | Resultado esperado | Resultado recibido |
144+
| :-: | :------------------------------------------------- | :----------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- |
145+
| 1 | Iniciar el juego y seleccionar `Jugar Tic-Tac-Toe` | Solicita los nombres de los jugadores y comienza el juego un jugador aleatorio | Los jugadores se turnan aleatoriamente para jugar. |
146+
| 2 | Ingresar nombres de jugadores | Se registran correctamente los jugadores ingresados | Los nombres de los jugadores se registran y se les asigna `0` puntos iniciales. |
147+
| 3 | Jugar un turno y ganar contra la IA | El jugador recibe 3 puntos | Se suman 3 puntos al campo `puntos` de la estructura del jugador. |
148+
| 4 | Jugar un turno y empatar contra la IA | El jugador recibe 2 puntos | Se suman 2 puntos al campo `puntos` de la estructura del jugador. |
149+
| 5 | Jugar un turno y perder contra la IA | El jugador pierde 1 punto | Se resta 1 punto al campo `puntos` de la estructura del jugador. |
150+
| 6 | Completar todas las partidas y generar un informe | Se genera un archivo `.txt` con el puntaje total | Se genera un archivo `.txt` con las estadísticas de las partidas. |
151+
| 7 | Consultar ranking del grupo | Se muestra el ranking del grupo | Se consulta a la [API](https://en.wikipedia.org/wiki/API) y se muestra el ranking del grupo. |
152+
| 8 | Finalizar el juego | El programa finaliza sin errores | El programa finaliza sin errores. |
119153

120154
## Estructura de la aplicación
121155

0 commit comments

Comments
 (0)