Skip to content

Commit d1a6bbf

Browse files
committed
doc: add requirements #5
1 parent df4642a commit d1a6bbf

File tree

3 files changed

+265
-3
lines changed

3 files changed

+265
-3
lines changed

docs/statics/miel-post.png

46.4 KB
Loading
Lines changed: 133 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,134 @@
1-
# Practical Work - Algorithms and Data Structures
1+
# Practical work - Algorithms and Data Structures
22

3-
TODO
3+
## Submission modality
4+
5+
The submission is done in groups of 4 people.
6+
If all necessary groups are formed and there are still students without a group, they will be assigned by the instructors to pre-formed groups, forming groups of **5 people**.
7+
8+
Groups must be formed and notified via the [MIeL](https://miel.unlam.edu.ar/) forum by 11:59 PM on Tuesday, February 4, 2025, as comments in the following post:
9+
10+
![Post in the MIeL forum](../../statics/miel-post.PNG)
11+
12+
Respecting the group formation deadline is a requirement to pass the practical work.
13+
14+
Each group's name must be a single word and must not be repeated by any other group. The group name must be a word listed in the [RAE dictionary](https://dle.rae.es/).
15+
16+
The group name must consist of letters whose ASCII value is between `0x41` and `0x5A` (inclusive). This implies that spaces, lowercase letters, accents, numbers, etc., are not allowed.
17+
18+
### Examples of names that will be rejected:
19+
20+
| Word | Reason for Rejection |
21+
| :--------- | :---------------------------------------------------------- |
22+
| LOS PIOJOS | Contains a space (`0x20`). |
23+
| La Renga | Contains a space and lowercase letters. |
24+
| ASDF | The word `asdf` is not in the dictionary. |
25+
| C++ | The ASCII for `+` is `0x2b`, not within the required range. |
26+
27+
### Example of a valid name:
28+
29+
| Word | Reason for Acceptance |
30+
| :-------- | :------------------------------------------------------------------------------------------------------------ |
31+
| INVISIBLE | It consists of valid characters, and according to the RAE its definition is: _"1. adj. That cannot be seen."_ |
32+
33+
The submission must be a file with the following format: `TP_ALGORITMOS_2024_3C_{GROUP_NAME}.zip`.
34+
35+
For example: If the group's name was `INVISIBLE` _-and its members were Spinetta, Pomo, Machi, and Gubitsch-_ the file should be named `TP_ALGORITMOS_2024_3C_INVISIBLE.zip`.
36+
37+
The file format is a reason for rejection of the practical work. As with any system, the requested format must be respected.
38+
39+
### Examples of files that will be considered incorrect:
40+
41+
| File Name | Reason for Rejection |
42+
| :--------------------------------------- | :------------------------------------ |
43+
| `TP_ALGORITMOS_2024_3c_INVISIBLE.zip` | Contains a lowercase `c` in the name. |
44+
| `TP_ALGORITMOS_2024_3C_INVISIBLE(1).zip` | Contains `1` in the name. |
45+
| `TP_ALGORITMOS_2024_2C_INVISIBLE.zip` | Incorrect semester. |
46+
| `TP_ALGORITMOS_2024_3C_INVISIBLE.rar` | Incorrect file format. |
47+
48+
The class schedule lists the submission and defense dates for the practical work. The defense is an evaluation instance for the course.
49+
50+
## requirement
51+
52+
A group of developers is creating an interactive kiosk for entertainment in supermarkets. As part of the project, they want to include a [Tic-Tac-Toe](https://en.wikipedia.org/wiki/Tic-tac-toe) minigame where users can play against a basic artificial intelligence. Each game will be recorded on a remote server through an [API](https://simple.wikipedia.org/wiki/Application_programming_interface) to analyze the results and improve the AI in future versions.
53+
54+
The game must be implemented in **C**, allowing users to play individual games against the machine, record the results via an [API](https://simple.wikipedia.org/wiki/Application_programming_interface), and generate a local report with statistics.
55+
56+
## Game rules
57+
58+
At the beginning of each game:
59+
60+
1. Players' names will be entered.
61+
2. The order of players will be randomly determined.
62+
63+
The game rules are as follows:
64+
65+
- **Alternating Turns:** The user and the machine take turns on a **3x3** board.
66+
- **Victory Conditions:**
67+
- A player wins by placing three of their symbols in a horizontal, vertical, or diagonal line.
68+
- If the board fills up without a winner, the game is considered a draw.
69+
- **Machine Strategy:** The machine will play with a predefined strategy, such as:
70+
- Choosing randomly if there is no clear move.
71+
- Blocking the player’s victory if possible.
72+
- Winning on the next move if it has the opportunity.
73+
74+
## assignment
75+
76+
Implement the [Tic-Tac-Toe](https://en.wikipedia.org/wiki/Tic-tac-toe) game in **C** with the following features:
77+
78+
Upon starting the program, there should be a menu with 3 options:
79+
80+
- [A] Play.
81+
- [B] View team ranking.
82+
- [C] Exit.
83+
84+
If someone chooses `Play`, they will first be asked to enter the names of the players. They can enter as many names as they want.
85+
86+
Once the names are entered, the player order (randomly determined) will be displayed on the screen, and the first player will be asked if they are ready. If they confirm, the game starts.
87+
88+
Each player will play a certain number of games (determined by the configuration file). In each game, they will randomly be assigned either `X` or `O`. The board will be displayed, and the player must enter their move. The machine responds with its move. The process repeats until one of them wins or it’s a draw.
89+
90+
When the player finishes their games, the next player will take their turn, and so on until all games for all players are completed. For each completed game, 3 points will be awarded if the player wins, 2 points for a draw with the machine, and 1 point will be deducted if the player loses.
91+
92+
Once the games are completed, a report will be generated with the details of each game (final board state), the winner, the score for each game, the total score for each player, and the final result, indicating which player(s) obtained the highest score. The file name must contain the current date and time in the following format: `YYYY-MM-DD-HH-mm`. Example file name: `game-report_2024-02-01-12-20.txt`. Additionally, the players' results will be sent to an [API](https://simple.wikipedia.org/wiki/Application_programming_interface) in the following format:
93+
94+
```json
95+
{
96+
"codigoGrupo": "ASD123",
97+
"jugadores": [
98+
{
99+
"nombre": "Juan",
100+
"puntos": 10
101+
}
102+
]
103+
}
104+
```
105+
106+
The [API](https://simple.wikipedia.org/wiki/Application_programming_interface) configurations and the number of games per player will be read from a `.txt` file with the following format:
107+
108+
```plaintext
109+
API URL | Group identifier code
110+
Number of games
111+
```
112+
113+
```plaintext
114+
https://api.com | ASD123
115+
3
116+
```
117+
118+
Additionally, the code must be uploaded to a repository on [GitHub](https://github.com/). The repository must include a [README.MD](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes) that explains how to play the game and what to do if the game configurations need to be changed.
119+
120+
The repository must also contain a document with different test cases in the following format:
121+
122+
| Description | Expected Output | Actual Output |
123+
| :------------------------- | :--------------------- | :------------------------- |
124+
| Testing what happens if... | It is expected that... | The output obtained was... |
125+
126+
A minimum of 8 test cases must be documented, with screenshots of the obtained output.
127+
128+
## Basic conditions for approval
129+
130+
- 0 errors and 0 warnings.
131+
- Neat and well-structured code divided into functions.
132+
- Functions should be as generic as possible.
133+
- Meaningful variable names.
134+
- It should work for at least all the documented test cases.
Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,134 @@
11
# Trabajo práctico - Algoritmos y Estructuras de Datos
22

3-
TODO
3+
## Modalidad de entrega
4+
5+
La entrega es grupal, en grupos de 4 personas.
6+
En caso de conformarse todos los grupos necesarios y que aún haya estudiantes sin grupo, estos serán asignados por los docentes a grupos previamente armados, formando así grupos de **5 personas**.
7+
8+
Los grupos deben ser formados y notificados vía foro de [MIeL](https://miel.unlam.edu.ar/) hasta las 23:59 del martes 4 de febrero de 2025 como comentarios en la siguiente publicación:
9+
10+
![Publicación en el foro de MIeL](../../statics/miel-post.PNG)
11+
12+
Respetar la fecha de conformación del grupo es condición para aprobar el trabajo práctico.
13+
14+
El nombre de cada grupo debe ser una palabra, y no se puede repetir con otro grupo. El nombre del grupo debe ser una palabra que figure en el [diccionario de la RAE](https://dle.rae.es/).
15+
16+
El nombre del grupo debe estar formado por letras cuyo valor ASCII esté comprendido entre `0x41` y `0x5a` (inclusive). Eso implica que no se admiten espacios, letras en minúscula, tildes, números, etc.
17+
18+
### Ejemplos de nombres que serán rechazados:
19+
20+
| Palabra | Motivo de rechazo |
21+
| :--------- | :--------------------------------------------------------- |
22+
| LOS PIOJOS | Tiene un espacio (`0x20`). |
23+
| La Renga | Tiene un espacio y letras en minúsculas. |
24+
| ASDF | La palabra `asdf` no está en el diccionario. |
25+
| C++ | El ASCII de `+` es `0x2b`, no está en el rango solicitado. |
26+
27+
### Ejemplo de un nombre válido:
28+
29+
| Palabra | Motivo de aceptación |
30+
| :-------- | :--------------------------------------------------------------------------------------------------------- |
31+
| INVISIBLE | Está formado por caracteres válidos, y según la RAE su definición es: _"1. adj. Que no puede ser visto."_. |
32+
33+
Se deberá entregar un archivo con el siguiente formato: `TP_ALGORITMOS_2024_3C_{NOMBRE_DEl_GRUPO}.zip`.
34+
35+
Por ejemplo: Si el grupo se llamase `INVISIBLE` _-y sus integrantes fueran Spinetta, Pomo, Machi y Gubitsch-_ el archivo debería llamarse `TP_ALGORITMOS_2024_3C_INVISIBLE.zip`.
36+
37+
El formato de entrega es motivo de rechazo del trabajo práctico. Como ocurre con cualquier sistema, debe respetar el formato solicitado.
38+
39+
### Ejemplos de archivos que se considerarán incorrectos:
40+
41+
| Nombre de archivo | Motivo de rechazo |
42+
| :--------------------------------------- | :--------------------------------------- |
43+
| `TP_ALGORITMOS_2024_3c_INVISIBLE.zip` | Contiene una `c` minúscula en el nombre. |
44+
| `TP_ALGORITMOS_2024_3C_INVISIBLE(1).zip` | Contiene `1` en su nombre. |
45+
| `TP_ALGORITMOS_2024_2C_INVISIBLE.zip` | Cuatrimestre incorrecto. |
46+
| `TP_ALGORITMOS_2024_3C_INVISIBLE.rar` | Formato de archivo incorrecto. |
47+
48+
En el cronograma de clases figuran las fechas de entrega y defensa del trabajo práctico. La defensa del trabajo práctico, es una instancia de evaluación de la materia.
49+
50+
## Necesidad
51+
52+
Un grupo de desarrolladores está creando un tótem interactivo para entretenimiento en supermercados. Como parte del proyecto, quieren incluir un minijuego de [Tateti (Ta-C-ti)](https://es.wikipedia.org/wiki/Tres_en_l%C3%ADnea) en el que los usuarios puedan jugar contra una inteligencia artificial básica. Cada partida se registrará en un servidor remoto mediante una [API](https://en.wikipedia.org/wiki/API) para analizar los resultados y mejorar la IA en futuras versiones.
53+
54+
Se requiere implementar el juego en **C**, permitiendo a los usuarios jugar partidas individuales contra la máquina, registrar los resultados en una [API](https://en.wikipedia.org/wiki/API) y generar un informe local con estadísticas.
55+
56+
## Reglas del juego
57+
58+
Al inicio de cada juego, se va a:
59+
60+
1. Ingresar los nombres de los jugadores.
61+
2. Sortear aleatoriamente el orden de los jugadores.
62+
63+
Las reglas del juego son las siguientes:
64+
65+
- **Turnos alternados**: El usuario y la máquina juegan por turnos en un tablero de **3x3**.
66+
- **Condiciones de victoria**:
67+
- Un jugador gana si coloca tres de sus símbolos en una línea horizontal, vertical o diagonal.
68+
- Si el tablero se llena sin que haya un ganador, la partida se considera un empate.
69+
- **Estrategia de la máquina**: La máquina jugará con una estrategia predefinida, como:
70+
- Elegir aleatoriamente si no hay una jugada clara.
71+
- Bloquear la victoria del jugador si es posible.
72+
- Ganar en la siguiente jugada si tiene la oportunidad.
73+
74+
## Consigna
75+
76+
Implementar el juego [Tateti](https://es.wikipedia.org/wiki/Tres_en_l%C3%ADnea) en **C** con las siguientes características:
77+
78+
Apenas se inicie el programa, deberá haber un menú de 3 opciones:
79+
80+
- [A] Jugar.
81+
- [B] Ver ranking del equipo.
82+
- [C] Salir.
83+
84+
Si alguien ingresa a `Jugar`, primero se le pedirá que cargue los nombres de las personas que van a jugar. Puede ingresar la cantidad de nombres que desee.
85+
86+
Una vez que termine de ingresarlos, aparecerá por pantalla el orden en el que jugarán los jugadores (recordar que se determina aleatoriamente), y se le preguntará al primer jugador si está listo. En caso de que sí, inicia el juego.
87+
88+
Cada jugador va a jugar una cierta cantidad de partidas (determinada por el archivo de configuración). En cada partida, le tocará aleatoriamente ser la `X` o el `O`. Se mostrará el tablero y el jugador tiene que ingresar donde quiere hacer su movimiento. La máquina responde con su jugada. Se repite el proceso hasta que uno de los dos gane o se empate.
89+
90+
Cuando el jugador termine con sus partidas, pasará al siguiente jugador. Y así sucesivamente hasta terminar todas las partidas de todos los jugadores. Por cada partida que se termine, se sumaran 3 puntos si gana el jugador, 2 puntos si empata con la maquina o se restara 1 punto si el jugador pierde.
91+
92+
Una vez finalizadas las partidas, se generará un informe con el detalle de las partidas (como quedó el tablero al final), quien ganó, el puntaje de cada una, el puntaje total por jugador y el resultado final, qué jugador/es obtuvieron mayor puntaje. El nombre del archivo debe contener la fecha y la hora actual en el siguiente formato: `YYYY-MM-DD-HH-mm`. Ejemplo de nombre: `informe-juego_2024-02-01-12-20.txt`. Además, se enviará a una [API](https://en.wikipedia.org/wiki/API) el resultado de los jugadores con el siguiente formato:
93+
94+
```json
95+
{
96+
"codigoGrupo": "ASD123",
97+
"jugadores": [
98+
{
99+
"nombre": "Juan",
100+
"puntos": 10
101+
}
102+
]
103+
}
104+
```
105+
106+
Las configuraciones de la [API](https://en.wikipedia.org/wiki/API) y la cantidad de partidas por jugador se leerá de un archivo `.txt` con el siguiente formato:
107+
108+
```plaintext
109+
URL de la API | Código identificador del grupo
110+
Cantidad de partidas
111+
```
112+
113+
```plaintext
114+
https://api.com | ASD123
115+
3
116+
```
117+
118+
Por otro lado, deberán subir el código a un repositorio en [GitHub](https://github.com/). Agregándole a su repositorio un [README.MD](https://docs.github.com/es/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes) que indique cómo jugar el juego y qué hacer si quiero cambiar las configuraciones del juego.
119+
120+
A ese repositorio se deberá subir un documento con diferentes lotes de prueba con el siguiente formato:
121+
122+
| Descripción | Salida esperada | Salida obtenida |
123+
| :------------------------------------------- | :--------------- | :------------------------ |
124+
| Se quiere probar qué es lo que pasaría si... | Se espera que... | La salida obtenida fue... |
125+
126+
Mínimo se deben documentar 8 casos de prueba, con captura de pantalla de la salida obtenida.
127+
128+
## Condiciones básicas para aprobar
129+
130+
- 0 errores y 0 warnings
131+
- Código prolijo y dividido en funciones
132+
- Funciones lo más genéricas posibles
133+
- Nombres significativos de variables
134+
- Que funcione mínimo para todos los casos de prueba que se presentan

0 commit comments

Comments
 (0)