Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
espinoleandroo committed Nov 29, 2023
2 parents ccd8db8 + c630338 commit f2f3998
Show file tree
Hide file tree
Showing 189 changed files with 13,965 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ Aquí encontrarás el listado de retos, su fecha de publicación, dificultad y e
* **#41** - 16/10/23 | Difícil | [`LA CASA ENCANTADA`](./Retos/Reto%20%2341%20-%20LA%20CASA%20ENCANTADA%20%5BDifícil%5D/ejercicio.md) | Correcciones: [[MI SOLUCIÓN](./Retos/Reto%20%2341%20-%20LA%20CASA%20ENCANTADA%20%5BDifícil%5D/python/mouredev.py)] [[COMUNIDAD](./Retos/Reto%20%2341%20-%20LA%20CASA%20ENCANTADA%20%5BDifícil%5D/)]
* **#42** - 23/10/23 | Difícil | [`PUNTO DE ENCUENTRO`](./Retos/Reto%20%2342%20-%20PUNTO%20DE%20ENCUENTRO%20%5BDifícil%5D/ejercicio.md) Correcciones: [[MI SOLUCIÓN](./Retos/Reto%20%2342%20-%20PUNTO%20DE%20ENCUENTRO%20%5BDifícil%5D/python/mouredev.py)] [[COMUNIDAD](./Retos/Reto%20%2342%20-%20PUNTO%20DE%20ENCUENTRO%20%5BDifícil%5D/)]
* **#43** - 30/10/23 | Fácil | [`SIMULADOR DE CLIMA`](./Retos/Reto%20%2343%20-%20SIMULADOR%20DE%20CLIMA%20%5BFácil%5D/ejercicio.md) | Correcciones: [[MI SOLUCIÓN](./Retos/Reto%20%2343%20-%20SIMULADOR%20DE%20CLIMA%20%5BFácil%5D/python/mouredev.py)] [[COMUNIDAD](./Retos/Reto%20%2343%20-%20SIMULADOR%20DE%20CLIMA%20%5BFácil%5D/)]
* **#44** - 13/10/23 | Media | [`ADIVINANZAS MATEMÁTICAS`](./Retos/Reto%20%2344%20-%20ADIVINANZAS%20MATEMÁTICAS%20%5BMedia%5D/ejercicio.md) | Último reto publicado
* **#44** - 13/11/23 | Media | [`ADIVINANZAS MATEMÁTICAS`](./Retos/Reto%20%2344%20-%20ADIVINANZAS%20MATEMÁTICAS%20%5BMedia%5D/ejercicio.md) | Correcciones: [[MI SOLUCIÓN](./Retos/Reto%20%2344%20-%20ADIVINANZAS%20MATEMÁTICAS%20%5BMedia%5D/python/mouredev.py)] [[COMUNIDAD](./Retos/Reto%20%2344%20-%20ADIVINANZAS%20MATEMÁTICAS%20%5BMedia%5D/)]
* **#45** - 20/11/23 | Fácil | [`EL CALENDARIO DE ADEVIENTO 2023`](./Retos/Reto%20%2345%20-%20EL%20CALENDARIO%20DE%20ADEVIENTO%202023%20%5BFácil%5D/ejercicio.md) | Correcciones: [[MI SOLUCIÓN](./Retos/Reto%20%2345%20-%20EL%20CALENDARIO%20DE%20ADEVIENTO%202023%20%5BFácil%5D/python/mouredev.py)] [[COMUNIDAD](./Retos/Reto%20%2345%20-%20EL%20CALENDARIO%20DE%20ADEVIENTO%202023%20%5BFácil%5D/)]
* **#46** - 27/11/23 | Media | [`LA CARRERA DE COCHES`](./Retos/Reto%20%2346%20-%20LA%20CARRERA%20DE%20COCHES%20%5BMedia%5D/ejercicio.md) | Último reto publicado

> **Corrección y Publicación próximo reto - 20/11/23 | [🗓️ Horario evento corrección en directo](https://discord.gg/mouredev?event=1173570988865232968) en [Twitch](https://twitch.tv/mouredev)**
> **Corrección y Publicación próximo reto - 04/12/23 | [🗓️ Horario evento corrección en directo](https://discord.gg/aNQNqZcB?event=1178638296092524544) en [Twitch](https://twitch.tv/mouredev)**
*Puedes ejecutar el archivo [language_stats.py](./Retos/language_stats.py) para visualizar las estadísticas de uso de cada lenguaje.*

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const fizzBuzz = () => {
for (let i = 0; i <= 100; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log("fizzBuzz");
} else if (i % 3 === 0) {
console.log("fizz");
} else if (i % 5 === 0) {
console.log("buzz");
}
}
};

console.log(fizzBuzz());
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const MIN = 1
const MAX = 100

function isMultiplo(number, targets = []) {
if(number == null) return false
if(!Array.isArray(targets)) targets = [targets]

return targets.every(target => number % target === 0)
}

for(let i = MIN; i <= MAX; i++) {
if(isMultiplo(i, [3, 5])) console.log('fizzbuzz')
else if(isMultiplo(i, 3)) console.log('fizz')
else if(isMultiplo(i, 5)) console.log('buzz')
else console.log(i)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const fizzbuzz = numVal => {
if (typeof numVal !== 'number') {
throw new Error(`"${numVal}" is not a number`)
}

if (numVal === 0) {
return numVal
}

if (numVal % 3 === 0 && numVal % 5 === 0) {
return 'fizzbuzz'
}

if (numVal % 3 === 0) {
return 'fizz'
}

if (numVal % 5 === 0) {
return 'buzz'
}

return numVal
}

const printFizzbuzz = number => {
for (let i = 1; i <= number; i++) {
console.log(`${fizzbuzz(i)}`)
}
}

printFizzbuzz(100)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
for i in range(1,101):
if i%3 == 0 and i%5 == 0:
print("fizz buzz")
elif i%3 == 0:
print("fizz")
elif i%5 == 0:
print("buzz")
else:
print(i)
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ def main():
multiplo3 = x % 3
multiplo5 = x % 5

if(multiplo3 == 0):
if(multiplo3 == 0 and multiplo5 == 0):
print('fizzbuzz')
continue
elif(multiplo3 == 0):
print('fizz')
continue
elif(multiplo5 == 0):
print('buzz')
continue
elif(multiplo3 == 0 and multiplo5 == 0):
print('fizzbuzz')
continue
else:
print(x)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def fizz_buzz():
for number in range(1,101):
if number % 3 == 0 and number % 5 == 0:
print("fizzbuzz")
elif number % 3 == 0:
print("fizz")
elif number % 5 == 0:
print("buzz")
else:
print(number)

fizz_buzz()
20 changes: 20 additions & 0 deletions Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/n4nd1k4nde.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'''
/*
* 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".
*/
'''

for i in range(1, 101):
if i % 3 and i % 5 == 0:
print("fizzbuzz")
elif i % 5 == 0:
print("buzz")
elif i % 3 == 0:
print("fizz")
else:
print(i)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fizzBuzz = (limit: number): void => {
const numbers = Array.from({ length: limit }, (_, index) => index + 1)
for (const number of numbers) {
if (number % 3 === 0) console.log("fizz")
if (number % 5 === 0) console.log("buzz")
if (number % 3 === 0 && number % 5 === 0) console.log("fizzbuzz")
else console.log(number)
}
}

fizzBuzz(100)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const leetAlphabet = {
a: "4",
b: "13",
c: "[",
d: ")",
e: "3",
f: "|=",
g: "&",
h: "#",
i: "1",
j: ",_|",
k: ">|",
l: "1",
m: "|/|",
n: "^/",
o: "0",
p: "|*",
q: "(_,)",
r: "|2",
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",
};

const lenguajeHacker = (s) => {
let r = "";
for (let char of s.toLowerCase()) {
let isChar = leetAlphabet[char];
isChar ? (r += isChar) : (r += char);
}
return r;
};

console.log(lenguajeHacker("Reto mouredev #4"));
console.log(lenguajeHacker("Hola Mundo"));
64 changes: 64 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/javascript/aran-tm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

const LOWER_CASE_LETTERS =
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];

const UPPER_CASE_LETTERS =
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];

const LEET_SPEAK_ALPHABET =
['4', 'I3', '[', ')', '3', '|=', '&', '#', '1', ',_|', '>|', '1', 'IVI',
'^/', '0', '|*', '(_,)', 'I2', '5', '7', '(_)', '\/', '\/\/', '><', 'j', '2']

const LEET_NUMBERS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
const NUMBERS_TO_LEET = ['()', 'L', 'R', 'E', 'A', 'S', 'b', 'T', 'B', 'g'];

function convert_to_leet_alphabet(){

// get the string
let stringFromUser = prompt("Please enter an entry");
let string_hacked = [];

// convert to an array
let arrayFromString = stringFromUser.split("");

// using a foreach to compare each character with each array element
arrayFromString.forEach(element => {

let indexOfLetters;
let indexOfNumbers;

// to check if it's a lower case letter
if (LOWER_CASE_LETTERS.includes(element)) {

indexOfLetters = LOWER_CASE_LETTERS.indexOf(element);
string_hacked.push(LEET_SPEAK_ALPHABET[indexOfLetters]);
}

// to check if it's a upper case letter
else if (UPPER_CASE_LETTERS.includes(element)) {

indexOfLetters = UPPER_CASE_LETTERS.indexOf(element);
string_hacked.push(LEET_SPEAK_ALPHABET[indexOfLetters]);
}

// To check if it's a number
else if (LEET_NUMBERS.includes(Number(element))) {

indexOfNumbers = LEET_NUMBERS.indexOf(Number(element));
string_hacked.push(NUMBERS_TO_LEET[indexOfNumbers]);
}

// to identify if there is a space
else if (element == "") {

string_hacked.push(" ");
}
});

console.log(string_hacked);
}

// calling the function
convert_to_leet_alphabet();
89 changes: 89 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/php/julianpk19961.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

/**
* Reto #1: EL "LENGUAJE HACKER"
* Enunciado
* 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")
*/


$transform = [
"a" => "4",
"b" => "I3",
"c" => "[",
"d" => ")",
"e" => "3",
"f" => "|=",
"g" => "&",
"h" => "#",
"i" => "1",
"j" => ",_|",
"k" => ">|",
"l" => "1",
"m" => "/\/\'",
"n" => "^/",
"ñ" => "~",
"o" => "0",
"p" => "|*",
"q" => "(_,)",
"r" => "|2",
"s" => "5",
"t" => "7",
"u" => "(_)",
"v" => "\/",
"w" => "\/\/",
"x" => "><",
"y" => "j",
"z" => "2",
"0" => "o",
"1" => "L",
"2" => "R",
"3" => "E",
"4" => "A",
"5" => "S",
"6" => "b",
"7" => "T",
"8" => "B",
"9" => "g",
];

$exceptionsChar = [" ", ".", ",", "'"];

function sentencesToLeet($sentence = 'Sentence is void')
{

global $transform, $exceptionsChar;

if (gettype($sentence) === 'object') {
$sentence = "I Can't work with a object, sorry";
}

if (gettype($sentence) === 'array') {
$sentence = implode($sentence);
}

$leetSentences = str_split(strtolower($sentence));

foreach ($leetSentences as $character) {
$key = str_replace($exceptionsChar, "", $character);
if ($key) {
echo $transform[$key];
} else {
echo $character;
}
};
echo "\n";
}


sentencesToLeet(new stdClass);
sentencesToLeet(["this", "an", "array"]);
sentencesToLeet(25660);
sentencesToLeet(25, 5);
sentencesToLeet(25.5);
sentencesToLeet("Hello");
30 changes: 30 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/DanniRodrJ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'''
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")
'''
def translator(text):
leet_speak = {'a': 4, 'b': 8, 'c': '<', 'd': '>', 'e': '&', 'f': 'v', 'g': 9, 'h': '#',
'i': 1, 'j': ';', 'k': '1<', 'l': '£', 'm': '^^', 'n': 'И', 'o': 0, 'p': 9,
'q': 2, 'r': 'Я', 's': 5, 't': 7, 'u': 'µ', 'v': '\/', 'w': 'Ш', 'x': 'ecks',
'y': '¥', 'z': 's'}
list_ls = []

for letter in text:
if letter in leet_speak.keys():
list_ls.append(leet_speak[letter])
else:
list_ls.append(letter)

end_text = ''.join(map(str, list_ls))
return end_text


test = 'Leet speak o leet es un tipo de escritura compuesta de caracteres alfanuméricos'
print(translator(test))

user = input('Texto a traducir: ').lower()
print(translator(user))
Loading

0 comments on commit f2f3998

Please sign in to comment.