You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,13 +39,18 @@ This repository contains the practical work for the Algorithms and Data Structur
46
39
## Features
47
40
48
41
- Architecture planning.
42
+
- Artificial intelligence (AI).
49
43
- Code conventions and standards.
50
44
- Code documentation using [Doxygen](https://www.doxygen.nl/) syntax.
51
45
- Commits following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
46
+
- Communication with [APIs](https://simple.wikipedia.org/wiki/Application_programming_interface) (GET and POST).
52
47
- Continuous integration with [GitHub Actions](https://docs.github.com/en/actions).
53
48
- Deployment of releases.
49
+
- Dynamic memory.
50
+
- Inputs control using validations.
51
+
- local storage of records.
52
+
- Singly linked list implementation.
54
53
- Team Workflow planning (branches, tags, and releases).
55
-
- TODO. <!-- TODO -->
56
54
57
55
## Installation
58
56
@@ -77,7 +75,43 @@ This repository contains the practical work for the Algorithms and Data Structur
77
75
78
76
## How to play
79
77
80
-
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).
81
115
82
116
### Rules
83
117
@@ -93,24 +127,29 @@ TODO. <!-- TODO -->
93
127
<details>
94
128
<summary>How can I change the game configuration?</summary>
95
129
96
-
TODO. <!-- TODO -->
130
+
To change the configuration, open the file [configuration.txt](./src/statics/configuration.txt).
131
+
132
+
- To change the [API](https://simple.wikipedia.org/wiki/Application_programming_interface) base endpoint, replace `https://algoritmos-api.azurewebsites.net/api/TaCTi` with your desired endpoint.
133
+
- To change the team name, replace `TABACO` with your preferred team name.
134
+
- To change the number of games per player, replace `3` with the desired number of games.
135
+
136
+
> [!IMPORTANT]
137
+
> If [configuration.txt](./src/statics/configuration.txt) is missing, the program won't start and will throw an error in the console.
97
138
98
139
</details>
99
140
100
141
### Use cases
101
142
102
-
<!-- TODO -->
103
-
104
-
| N° | Description | Expected result | Received result |
| 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. |
-`vMAJOR.MINOR.PATCH`: This tag indicates a release of the practical work following [Semantic Versioning](https://semver.org/), and will only be present in the `Master` branch commits.
265
+
-`vMAJOR.MINOR.PATCH`: This tag indicates a [release](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/releases) of the practical work following [Semantic Versioning](https://semver.org/), and will only be present in the `Master` branch commits.
227
266
228
267
### Branches
229
268
230
-
-`Master`: Branch containing the development versions of the practical work, where team members will introduce new changes (commits).
269
+
-`Master`: Branch containing the development versions of the practical work, where team members will introduce new changes (commits) through [pull requests](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/pulls?q=is%3Apr).
231
270
232
271
> [!IMPORTANT]
233
272
> Stable versions are only available as [releases](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/releases).
234
273
235
274
> [!NOTE]
236
-
> The other branches are fictional and represent individual contributions from each member to the `Master` branch.
275
+
> The other branches are fictional and represent individual contributions from each member through [pull requests](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/pulls?q=is%3Apr)to the `Master` branch.
@@ -44,14 +38,19 @@ Este repositorio contiene el trabajo práctico de la materia Algoritmos y Estruc
44
38
45
39
## Características
46
40
41
+
- Almacenamiento local de registros.
42
+
- Comunicación con [APIs](https://en.wikipedia.org/wiki/API) (GET y POST).
47
43
- Confirmaciones siguiendo la guía de los [Commits Convencionales](https://www.conventionalcommits.org/es/v1.0.0/).
44
+
- Control de entradas utilizando validaciones.
48
45
- Convenciones y estándares de código.
49
46
- Despliegue de entregables.
50
47
- Documentación del código utilizando la sintaxis de [Doxygen](https://www.doxygen.nl/).
48
+
- Implementación de lista enlazada simple.
51
49
- Integración continua con [GitHub Actions](https://docs.github.com/es/actions).
50
+
- Inteligencia artificial (IA).
51
+
- Memoria dinámica.
52
52
- Planificación de la arquitectura.
53
53
- Planificación del flujo de trabajo del equipo (ramas, etiquetas y versionado).
54
-
- TODO. <!-- TODO -->
55
54
56
55
## Instalación
57
56
@@ -76,7 +75,43 @@ Este repositorio contiene el trabajo práctico de la materia Algoritmos y Estruc
76
75
77
76
## Cómo jugar
78
77
79
-
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).
80
115
81
116
### Reglas
82
117
@@ -92,24 +127,29 @@ TODO. <!-- TODO -->
92
127
<details>
93
128
<summary>¿Cómo puedo cambiar la configuración del juego?</summary>
94
129
95
-
TODO. <!-- TODO -->
130
+
Para cambiar la configuración, abre el archivo [configuration.txt](../../../src/statics/configuration.txt).
131
+
132
+
- Para cambiar el endpoint base de la [API](https://en.wikipedia.org/wiki/API), reemplaza `https://algoritmos-api.azurewebsites.net/api/TaCTi` con el endpoint que desees.
133
+
- Para cambiar el nombre del equipo, reemplaza `TABACO` con el nombre del equipo que prefieras.
134
+
- Para cambiar el número de juegos por jugador, reemplaza `3` con la cantidad de juegos que desees.
135
+
136
+
> [!IMPORTANTE]
137
+
> Si falta el archivo [configuration.txt](../../../src/statics/configuration.txt), el programa no iniciará y mostrará un error en la consola.
| 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. |
-`vMAYOR.MINOR.PATCH`: Esta etiqueta indica la publicación de un Release del trabajo práctico siguiendo el [Semantic Versioning](https://semver.org/), y solo estará presente en las confirmaciones de la rama `Master`.
265
+
-`vMAYOR.MINOR.PATCH`: Esta etiqueta indica la publicación de una [Release](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/releases) del trabajo práctico siguiendo el [Semantic Versioning](https://semver.org/), y solo estará presente en las confirmaciones de la rama `Master`.
226
266
227
267
### Ramas
228
268
229
-
-`Master`: Rama que alberga las versiones en desarrollo del trabajo práctico, donde los miembros del equipo incorporarán nuevos cambios (confirmaciones).
269
+
-`Master`: Rama que alberga las versiones en desarrollo del trabajo práctico, donde los miembros del equipo incorporarán nuevos cambios (confirmaciones) a través de [Pull Requests](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/pulls?q=is%3Apr).
230
270
231
271
> [!IMPORTANT]
232
272
> Las versiones estables solo están disponibles como [lanzamientos](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/releases).
233
273
234
274
> [!NOTE]
235
-
> Las demás ramas son ficticias y representan las contribuciones individuales que cada miembro hará sobre la rama `Master`.
275
+
> Las demás ramas son ficticias y representan las contribuciones individuales de cada miembro a través de [Pull Requests](https://github.com/hozlucas28/C-Algorithms-Practical-Work-2025/pulls?q=is%3Apr) a la rama `Master`.
0 commit comments