Skip to content

Commit 14b4db5

Browse files
Merge branch 'JesusAEE' of github.com:JesusAntonioEEscamilla/roadmap-retos-programacion; branch 'main' of github.com:mouredev/roadmap-retos-programacion into JesusAEE
2 parents 4f81534 + 0f38d13 commit 14b4db5

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
2828
## Corrección y próximo ejercicio
2929

30-
> #### Lunes 14 de octubre de 2024 a las 20:00 (hora España) desde **[Twitch](https://twitch.tv/mouredev)**
31-
> #### Consulta el **[horario](https://discord.gg/juhmSSRF?event=1290376752622993469)** por país y crea un **[recordatorio](https://discord.gg/juhmSSRF?event=1290376752622993469)**
30+
> #### Lunes 21 de octubre de 2024 a las 20:00 (hora España) desde **[Twitch](https://twitch.tv/mouredev)**
31+
> #### Consulta el **[horario](https://discord.gg/K4SGshHf?event=1294092672793051177)** por país y crea un **[recordatorio](https://discord.gg/K4SGshHf?event=1294092672793051177)**
3232
3333
## Roadmap
3434

@@ -75,7 +75,8 @@
7575
|38|[MOUREDEV PRO](./Roadmap/38%20-%20MOUREDEV%20PRO/ejercicio.md)|[📝](./Roadmap/38%20-%20MOUREDEV%20PRO/python/mouredev.py)|[▶️](https://youtu.be/AbGROLoAVLs)|[👥](./Roadmap/38%20-%20MOUREDEV%20PRO/)
7676
|39|[BATMAN DAY](./Roadmap/39%20-%20BATMAN%20DAY/ejercicio.md)|[📝](./Roadmap/39%20-%20BATMAN%20DAY/python/mouredev.py)|[▶️](https://youtu.be/Lmj5enZG5pg)|[👥](./Roadmap/39%20-%20BATMAN%20DAY/)
7777
|40|[FORTNITE RUBIUS CUP](./Roadmap/40%20-%20FORTNITE%20RUBIUS%20CUP/ejercicio.md)|[📝](./Roadmap/40%20-%20FORTNITE%20RUBIUS%20CUP/python/mouredev.py)|[▶️](https://youtu.be/UlWtFvLLSXw)|[👥](./Roadmap/40%20-%20FORTNITE%20RUBIUS%20CUP/)
78-
|41|[CAMISETA RAR](./Roadmap/41%20-%20CAMISETA%20RAR/ejercicio.md)|[🗓️ 14/10/24](https://discord.gg/juhmSSRF?event=1290376752622993469)||[👥](./Roadmap/41%20-%20CAMISETA%20RAR/)
78+
|41|[CAMISETA RAR](./Roadmap/41%20-%20CAMISETA%20RAR/ejercicio.md)|[📝](./Roadmap/41%20-%20CAMISETA%20RAR/python/mouredev.py)||[👥](./Roadmap/41%20-%20CAMISETA%20RAR/)
79+
|42|[TORNEO DRAGON BALL](./Roadmap/42%20-%20TORNEO%20DRAGON%20BALL/ejercicio.md)|[🗓️ 21/10/24](https://discord.gg/K4SGshHf?event=1294092672793051177)||[👥](./Roadmap/42%20-%20TORNEO%20DRAGON%20BALL/)
7980

8081
## Cursos en YouTube
8182

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import zipfile
2+
import os
3+
4+
5+
def zip_file(path: str, file: str) -> str:
6+
7+
file_path = os.path.join(path, file)
8+
9+
if os.path.exists(file_path):
10+
11+
zip_file = f"{file}.zip"
12+
zip_path = os.path.join(path, zip_file)
13+
14+
with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zipf:
15+
zipf.write(file_path, file)
16+
print(f"Archivo {file} comprimido como {zip_file}.")
17+
return zip_file
18+
19+
else:
20+
print(f"El archivo {file} no existe el directorio {path}.")
21+
22+
return None
23+
24+
25+
def unzip_file(path: str, file: str):
26+
27+
file_path = os.path.join(path, file)
28+
29+
if os.path.exists(file_path):
30+
31+
zip_path = os.path.join(path, file)
32+
33+
with zipfile.ZipFile(zip_path) as zipf:
34+
zipf.extractall(path)
35+
print(f"Archivo {file} descomprimido en {path}.")
36+
37+
else:
38+
print(f"El archivo {file} no existe el directorio {path}.")
39+
40+
41+
path = os.path.dirname(os.path.abspath(__file__)) # Directorio actual
42+
file = "nombre_de_mi_archivo"
43+
44+
zip = zip_file(path, file)
45+
46+
if zip != None:
47+
48+
# Borro el fichero original antes de descomprimir el zip
49+
os.remove(os.path.join(path, file))
50+
51+
unzip_file(path, zip)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# #42 TORNEO DRAGON BALL
2+
> #### Dificultad: Difícil | Publicación: 14/10/24 | Corrección: 21/10/24
3+
4+
## Ejercicio
5+
6+
```
7+
/*
8+
* EJERCICIO:
9+
* ¡El último videojuego de Dragon Ball ya está aquí!
10+
* Se llama Dragon Ball: Sparking! ZERO.
11+
*
12+
* Simula un Torneo de Artes Marciales, al más puro estilo
13+
* de la saga, donde participarán diferentes luchadores, y el
14+
* sistema decidirá quién es el ganador.
15+
*
16+
* Luchadores:
17+
* - Nombre.
18+
* - Tres atributos: velocidad, ataque y defensa
19+
* (con valores entre 0 a 100 que tú decidirás).
20+
* - Comienza cada batalla con 100 de salud.
21+
* Batalla:
22+
* - En cada batalla se enfrentan 2 luchadores.
23+
* - El luchador con más velocidad comienza atacando.
24+
* - El daño se calcula restando el daño de ataque del
25+
* atacante menos la defensa del oponente.
26+
* - El oponente siempre tiene un 20% de posibilidad de
27+
* esquivar el ataque.
28+
* - Si la defensa es mayor que el ataque, recibe un 10%
29+
* del daño de ataque.
30+
* - Después de cada turno y ataque, el oponente pierde salud.
31+
* - La batalla finaliza cuando un luchador pierde toda su salud.
32+
* Torneo:
33+
* - Un torneo sólo es válido con un número de luchadores
34+
* potencia de 2.
35+
* - El torneo debe crear parejas al azar en cada ronda.
36+
* - Los luchadores se enfrentan en rondas eliminatorias.
37+
* - El ganador avanza a la siguiente ronda hasta que sólo
38+
* quede uno.
39+
* - Debes mostrar por consola todo lo que sucede en el torneo,
40+
* así como el ganador.
41+
*/
42+
```
43+
#### Tienes toda la información extendida sobre el roadmap de retos de programación en **[retosdeprogramacion.com/roadmap](https://retosdeprogramacion.com/roadmap)**.
44+
45+
Sigue las **[instrucciones](../../README.md)**, consulta las correcciones y aporta la tuya propia utilizando el lenguaje de programación que quieras.
46+
47+
> Recuerda que cada semana se publica un nuevo ejercicio y se corrige el de la semana anterior en directo desde **[Twitch](https://twitch.tv/mouredev)**. Tienes el horario en la sección "eventos" del servidor de **[Discord](https://discord.gg/mouredev)**.

0 commit comments

Comments
 (0)