-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
Retos/Reto #32 - LA COLUMNA DE EXCEL [Media]/python/mouredev.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import string | ||
|
||
def calculate_column_number(column_name: str) -> int: | ||
|
||
column_number = 0 | ||
|
||
alphabet = list(string.ascii_uppercase) | ||
|
||
for letter in column_name.upper(): | ||
column_number = (column_number * len(alphabet)) + (alphabet.index(letter) + 1) | ||
|
||
return column_number | ||
|
||
print(calculate_column_number("A")) | ||
print(calculate_column_number("Z")) | ||
print(calculate_column_number("AA")) | ||
print(calculate_column_number("CA")) | ||
print(calculate_column_number("XFD")) | ||
print(calculate_column_number("ZZZZ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Reto #33: Tetris | ||
#### Dificultad: Difícil | Publicación: 14/08/23 | Corrección: 21/08/23 | ||
|
||
## Enunciado | ||
|
||
``` | ||
/* | ||
* Crea un programa capaz de gestionar una pieza de Tetris. | ||
* - La pantalla de juego tiene 10 filas y 10 columnas representadas por símbolos 🔲 | ||
* - La pieza de tetris a manejar será la siguiente (si quieres, puedes elegir otra): | ||
* 🔳 | ||
* 🔳🔳🔳 | ||
* - La pieza aparecerá por primera vez en la parte superior izquierda de la pantalla de juego. | ||
* 🔳🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔳🔳🔳🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* 🔲🔲🔲🔲🔲🔲🔲🔲🔲🔲 | ||
* - Debes desarrollar una función capaz de desplazar y rotar la pieza en el tablero, | ||
* recibiendo una acción cada vez que se llame, mostrando cómo se visualiza en la pantalla de juego. | ||
* - Las acciones que se pueden aplicar a la pieza son: derecha, izquierda, abajo, rotar. | ||
* - Debes tener en cuenta los límites de la pantalla de juego. | ||
*/ | ||
``` | ||
#### Tienes toda la información extendida sobre los retos de programación semanales en **[retosdeprogramacion.com/semanales2023](https://retosdeprogramacion.com/semanales2023)**. | ||
|
||
Sigue las **[instrucciones](../../README.md)**, consulta las correcciones y aporta la tuya propia utilizando el lenguaje de programación que quieras. | ||
|
||
> 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)**. |