-
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.
Merge branch 'mouredev:main' into main
- Loading branch information
Showing
71 changed files
with
2,654 additions
and
160 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/c++/acoidaan.cpp
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 @@ | ||
#include <iostream> | ||
int main() { | ||
int n{1}; | ||
while (n <= 100) { | ||
if (n % 3 == 0 && n % 5 == 0) { | ||
std::cout << "fizzbuzz" << std::endl; | ||
} | ||
if (n % 3 == 0) { | ||
std::cout << "fizz" << std::endl; | ||
} | ||
if (n % 5 == 0) { | ||
std::cout << "buzz" << std::endl; | ||
} else { | ||
std::cout << n << std::endl; | ||
} | ||
n++; | ||
} | ||
return 0; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/jfdacovich.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,13 @@ | ||
# Reto 0: El Famoso Fizz Buzz | ||
|
||
for i in range(1,101): | ||
mod3 = i % 3 | ||
mod5 = i % 5 | ||
if mod3 == 0 and mod5 == 0: | ||
print("fizzbuzz") | ||
elif mod3 == 0: | ||
print("fizz") | ||
elif mod5 == 0: | ||
print("buzz") | ||
else: | ||
print(i) |
19 changes: 19 additions & 0 deletions
19
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/luiveldel.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 @@ | ||
# Create by luiveldel | ||
# Escribe un programa que muestre por consola (con un print) los | ||
# números de 1 a 100 (ambos incluidos y con un salto de línea entre | ||
# cada impresión), sustituyendo los siguientes: | ||
# - Múltiplos de 3 por la palabra "fizz". | ||
# - Múltiplos de 5 por la palabra "buzz". | ||
# - Múltiplos de 3 y de 5 a la vez por la palabra "fizzbuzz". | ||
|
||
num_1_100 = range(1, 101) | ||
|
||
for n in num_1_100: | ||
if n % 3 == 0: | ||
print("fizz",'\n') | ||
elif n % 5 == 0: | ||
print("buzz",'\n') | ||
elif n % 3 == 0 and n % 5 == 0: | ||
print("fizzbuzz",'\n') | ||
else: | ||
print(n,'\n') |
File renamed without changes.
60 changes: 60 additions & 0 deletions
60
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/c++/acoidaan.cpp
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,60 @@ | ||
#include <iostream> | ||
#include <string> | ||
#include <map> | ||
#include <cctype> | ||
std::string toLower(const std::string& text) { | ||
std::string result; | ||
for (char c : text) { | ||
result += std::tolower(c); | ||
} | ||
return result; | ||
} | ||
|
||
int main() { | ||
const std::map<char, std::string> leet_alphabet = { | ||
{'a', "4",}, | ||
{'b', "I3",}, | ||
{'c', "[",}, | ||
{'e', "3",}, | ||
{'d', ")",}, | ||
{'f', "|=",}, | ||
{'g', "&",}, | ||
{'h', "#",}, | ||
{'i', "1",}, | ||
{'j', ",_|",}, | ||
{'k', ">|",}, | ||
{'l', "1",}, | ||
{'m', "/\\/\\",}, | ||
{'n', "^/",}, | ||
{'o', "0",}, | ||
{'p', "|*",}, | ||
{'q', "(_,)",}, | ||
{'r', "I2",}, | ||
{'s', "5",}, | ||
{'t', "7",}, | ||
{'u', "(_)",}, | ||
{'v', "\\/",}, | ||
{'w', "\\/\\/",}, | ||
{'x', "><",}, | ||
{'y', "j",}, | ||
{'z', "2",}, | ||
{'1', "L"}, | ||
{'2', "R",}, | ||
{'3', "E",}, | ||
{'4', "A",}, | ||
{'5', "S",}, | ||
{'6', "b",}, | ||
{'7', "T",}, | ||
{'8', "B"}, | ||
{'9', "g",}, | ||
{'0', "o"}, | ||
{' ', " "} | ||
}; | ||
std::string input_text; | ||
std::cout << "Write some text to be translated to hacker language" << std::endl; | ||
std::getline(std::cin, input_text); | ||
std::string lower_text = toLower(input_text); | ||
for (char i : lower_text) { | ||
std::cout << leet_alphabet.at(i); | ||
} | ||
} |
120 changes: 60 additions & 60 deletions
120
...UAJE HACKER [Fácil]/python/Oskitar_Ale.py → ...UAJE HACKER [Fácil]/python/Oskitar-Ale.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 |
---|---|---|
@@ -1,60 +1,60 @@ | ||
|
||
# Escribe un programa que reciba un texto y transforme lenguaje natural a | ||
# "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje | ||
# se caracteriza por sustituir caracteres alfanuméricos. | ||
# Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/) | ||
# con el alfabeto y los números en "leet". | ||
# (Usa la primera opción de cada transformación. Por ejemplo "4" para la "a") | ||
|
||
leet = { | ||
'a': '4', | ||
'b': '8', | ||
'c': '<', | ||
'd': '|)', | ||
'e': '3', | ||
'f': '|=', | ||
'g': '9', | ||
'h': '#', | ||
'i': '1', | ||
'j': '_|', | ||
'k': '|<', | ||
'l': '1', | ||
'm': '|\/|', | ||
'n': '|\|', | ||
'o': '0', | ||
'p': '|>', | ||
'q': '(_,)', | ||
'r': '|2', | ||
's': '5', | ||
't': '7', | ||
'u': '|_|', | ||
'v': '\/', | ||
'w': '\/\/', | ||
'x': '><', | ||
'y': '¥', | ||
'z': '2', | ||
'1': 'L', | ||
'2': 'Z', | ||
'3': 'E', | ||
'4': 'A', | ||
'5': 'S', | ||
'6': 'b', | ||
'7': 'T', | ||
'8': 'B', | ||
'9': 'g', | ||
'0': 'O' | ||
} | ||
|
||
def text_to_leet(text): | ||
result = '' | ||
for char in text.lower(): | ||
if char in leet: | ||
result += leet[char] | ||
else: | ||
result += char | ||
return result | ||
|
||
texto_original = input("Ingrese un texto: ") | ||
texto_en_leet = text_to_leet(texto_original) | ||
print("Texto transformado en leet:") | ||
print(texto_en_leet) | ||
|
||
# Escribe un programa que reciba un texto y transforme lenguaje natural a | ||
# "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje | ||
# se caracteriza por sustituir caracteres alfanuméricos. | ||
# Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/) | ||
# con el alfabeto y los números en "leet". | ||
# (Usa la primera opción de cada transformación. Por ejemplo "4" para la "a") | ||
|
||
leet = { | ||
'a': '4', | ||
'b': '8', | ||
'c': '<', | ||
'd': '|)', | ||
'e': '3', | ||
'f': '|=', | ||
'g': '9', | ||
'h': '#', | ||
'i': '1', | ||
'j': '_|', | ||
'k': '|<', | ||
'l': '1', | ||
'm': '|\/|', | ||
'n': '|\|', | ||
'o': '0', | ||
'p': '|>', | ||
'q': '(_,)', | ||
'r': '|2', | ||
's': '5', | ||
't': '7', | ||
'u': '|_|', | ||
'v': '\/', | ||
'w': '\/\/', | ||
'x': '><', | ||
'y': '¥', | ||
'z': '2', | ||
'1': 'L', | ||
'2': 'Z', | ||
'3': 'E', | ||
'4': 'A', | ||
'5': 'S', | ||
'6': 'b', | ||
'7': 'T', | ||
'8': 'B', | ||
'9': 'g', | ||
'0': 'O' | ||
} | ||
|
||
def text_to_leet(text): | ||
result = '' | ||
for char in text.lower(): | ||
if char in leet: | ||
result += leet[char] | ||
else: | ||
result += char | ||
return result | ||
|
||
texto_original = input("Ingrese un texto: ") | ||
texto_en_leet = text_to_leet(texto_original) | ||
print("Texto transformado en leet:") | ||
print(texto_en_leet) |
29 changes: 29 additions & 0 deletions
29
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/jfdacovich.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,29 @@ | ||
# Reto 1: El Lenguaje del Hacker | ||
|
||
alphabet = { | ||
"a" : "(L", "b" : "!3", "c" : "[", "d" : "|>", "e" : "€", | ||
"f" : "|=", "g" : "(_+", "h" : "#", "i" : "1", "j" : ",_]", | ||
"k" : ">|", "l" : "7", "m" : "nn", "n" : "{\}", "o" : "oh", | ||
"p" : "|7", "q" : "(_,)", "r" : "I2", "s" : "es", "t" : "-|-", | ||
"u" : "|_|", "v" : "\/", "w" : "\/\/", "x" : "ecks", "y" : "j", | ||
"z" : "%", "1" : "L", "2" : "R", "3" : "E", "4" : "A", | ||
"5" : "S", "6" : "b", "7" : "T", "8" : "B", "9" : "g", | ||
"0" : "o" | ||
} | ||
|
||
def translator(texto): | ||
""" | ||
Función que recibe un texto y lo convierte a lenguaje hacker, | ||
Dicho lenguaje se caracteriza por la sustitución de carácteres | ||
alfanuméricos. | ||
""" | ||
converted_text = "" | ||
for letter in texto: | ||
if letter.lower() in alphabet: | ||
converted_text += alphabet[letter.lower()] | ||
else: | ||
converted_text += letter | ||
return(converted_text) | ||
|
||
print(translator("jf_dev_01")) | ||
|
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/luiveldel.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,26 @@ | ||
# Created by luiveldel | ||
# Escribe un programa que reciba un texto y transforme lenguaje natural a | ||
# "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje | ||
# se caracteriza por sustituir caracteres alfanuméricos. | ||
# - Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/) | ||
# con el alfabeto y los números en "leet". | ||
# (Usa la primera opción de cada transformación. Por ejemplo "4" para la "a") | ||
|
||
|
||
# First, create a dictionary for the hacker language | ||
hacker_dict = {'a': '4', | ||
'e': '3', | ||
'i': '1', | ||
'o': '0', | ||
'A': '4', | ||
'E': '3', | ||
'I': '1', | ||
'O': '0'} | ||
|
||
word = "hacker" | ||
|
||
for k, v in hacker_dict.items(): | ||
word = word.replace(k, v) | ||
|
||
|
||
print(word) |
Oops, something went wrong.