forked from mouredev/retos-programacion-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
90 changed files
with
4,103 additions
and
7 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
11 changes: 11 additions & 0 deletions
11
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/c#/almonteagudor.cs
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,11 @@ | ||
for (var i = 1; i <= 100; i++) | ||
{ | ||
var fizzbuzzToPrint = ""; | ||
|
||
fizzbuzzToPrint += i % 3 == 0 ? "fizz" : ""; | ||
fizzbuzzToPrint += i % 5 == 0 ? "buzz" : ""; | ||
|
||
fizzbuzzToPrint = fizzbuzzToPrint == "" ? i.ToString() : fizzbuzzToPrint; | ||
|
||
Console.WriteLine(fizzbuzzToPrint); | ||
} |
11 changes: 11 additions & 0 deletions
11
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/javascript/avilesxd.js
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,11 @@ | ||
for (i = 1; 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"); | ||
} else { | ||
console.log(i); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/javascript/facusole.js
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,17 @@ | ||
/* | ||
* 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". | ||
*/ | ||
|
||
const fizzBuzz = () => { | ||
for( let i = 1; i<=100; i++) { | ||
if( i % 5 === 0 && i % 3 === 0 ) console.log('fizzbuzz') | ||
else if ( i % 3 === 0 ) console.log('fizz') | ||
else if ( i % 5 === 0 ) console.log('buzz') | ||
else console.log(i) | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/kotlin/NavarroFederico.kt
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 @@ | ||
package edu.tlozano.weeklychallenge2023 | ||
|
||
|
||
/* | ||
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".*/ | ||
|
||
fun main(args: Array<String>) { | ||
|
||
for ( i in 1 .. 100){ | ||
println(i) | ||
when { | ||
(i %3 ==0 && i%5 ==0)-> println("fizzbuzz") | ||
(i %3 == 0) -> println("fizz") | ||
(i %5 == 0) -> println("buzz") | ||
} | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/powershell/IjAxxDev.ps1
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,16 @@ | ||
Clear-Host | ||
|
||
for ($i = 0; $i -lt 101; $i++){ | ||
if($i % 3 -eq 0 -and $i % 5 -eq 0){ | ||
write-host "buzzfizz" | ||
} | ||
elseif($i % 3 -eq 0){ | ||
write-host "buzz" | ||
} | ||
elseif($i % 5 -eq 0){ | ||
write-host "fizz" | ||
} | ||
else{ | ||
write-host $i | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/avilesxd.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,12 @@ | ||
for i in range(1,101): | ||
# Si son múltiplos de 3 y de 5 a la vez por la palabra "fizzbuzz". | ||
if i % 3 == 0 and i % 5 == 0: | ||
print('fizzbuzz') | ||
# Si son múltiplos de 3 por la palabra "fizz". | ||
elif i % 3 == 0: | ||
print('fizz') | ||
# Si son múltiplos de 5 por la palabra "buzz". | ||
elif i % 5 == 0: | ||
print('buzz') | ||
else: | ||
print(i) |
13 changes: 13 additions & 0 deletions
13
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/nicoodiaz.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 @@ | ||
def run(): | ||
for x in range(1, 101): | ||
if x % 3 == 0: | ||
print('fizz') | ||
elif x % 5 == 0: | ||
print('buzz') | ||
elif x % 15 == 0: | ||
print('fizzbuzz') | ||
else: | ||
print(x) | ||
|
||
if __name__ == '__main__': | ||
run() |
20 changes: 20 additions & 0 deletions
20
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/javascript/arnodchirivi08.js
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,20 @@ | ||
const 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 letterLeet=['4','I3','[', ')','3', '|=','&','#','1',',_|','>|','£','JVI', '^/', '0','|*','(_,)','I2','5','7','(_)','\/','VV','><','j','2' ] | ||
|
||
const text = 'GitHub'; | ||
|
||
function converToLeet(text, letters, letterLeet){ | ||
const value = text.toLowerCase().split(''); | ||
let arrayLeets = []; | ||
value.some((item) => { | ||
letters.some((itemLetter, indexLetter) => { | ||
if(itemLetter === item){ | ||
arrayLeets += letterLeet[indexLetter] | ||
} | ||
}) | ||
}); | ||
|
||
return arrayLeets; | ||
} | ||
|
||
console.log(converToLeet(text,letters, letterLeet)); |
58 changes: 58 additions & 0 deletions
58
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/javascript/facusole.js
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,58 @@ | ||
/* | ||
* 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") | ||
*/ | ||
|
||
const leet_alphabet = { | ||
' ': ' ', | ||
a: '4', | ||
b: 'I3', | ||
c: '[', | ||
d: ')', | ||
e: '3', | ||
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', | ||
} | ||
|
||
const leetTranslate = (text) => { | ||
|
||
leetText = text.toLowerCase().split('').map(char = leet_alphabet[char] || char).join('') | ||
|
||
console.log(`Texto original: ${text}`) | ||
console.log(`Texto leet: ${leetText}`) | ||
|
||
return leetText | ||
} |
52 changes: 52 additions & 0 deletions
52
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/php/patricioleono.php
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,52 @@ | ||
<?php | ||
$lenguageHacker = array( | ||
'a' => '4', | ||
'b' => 'I3', | ||
'c' => '[', | ||
'd' => ')', | ||
'e' => '3', | ||
'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', | ||
'0' => 'o', | ||
'1' => 'L', | ||
'2' => 'R', | ||
'3' => 'E', | ||
'4' => 'A', | ||
'5' => 'S', | ||
'6' => 'b', | ||
'7' => 'T', | ||
'8' => 'B', | ||
'9' => 'g' | ||
); | ||
|
||
|
||
$word = 'Patricio Leon Termino este RETO'; | ||
|
||
function reemplaceAndPrint($word, $lang){ | ||
print "Palabra Hacker: " .strtr(strtolower($word), $lang); | ||
print "\n"; | ||
} | ||
|
||
print "Palabra Normal: ". $word; | ||
print "\n"; | ||
reemplaceAndPrint($word, $lenguageHacker); |
17 changes: 17 additions & 0 deletions
17
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/avilesxd.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,17 @@ | ||
def leetSpekAlphabet(words): | ||
dict = { | ||
'a': '4', 'b': 'ß', 'c': '(', 'd': '?', 'e': '3', 'f': 'ƒ', 'g': '9', | ||
'h': ':-:', 'i': '1', 'j': '_]', 'k': '|c', 'l': '£', 'm': 'nn', 'n': '[\]', | ||
'o': 'oh', 'p': '|^', 'q': '2', 'r': '/2', 's': 'ehs', 't': '~|~', 'u': 'v', | ||
'v': '|/', 'w': 'uu', 'x': 'ecks', 'y': '`/', 'z': '%', '1': 'L', | ||
'2': 'R', '3': 'E', '4': 'A', '5': 'S', '6': 'b', '7': 'T', '8': 'B', | ||
'9': 'q', '0': '()' | ||
} | ||
|
||
return ''.join(dict.get(text.lower(), text) for text in words) | ||
|
||
print("Enter the text you want to convert to the hacker language: ") | ||
word = input("") | ||
result = leetSpekAlphabet(word) | ||
|
||
print(result) |
30 changes: 30 additions & 0 deletions
30
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/iTzBigPerrito.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,30 @@ | ||
def main(): | ||
input1 = inputText() | ||
hacker = hackText(input1) | ||
print(f'Texto en lenguaje hacker:\n {hacker}') | ||
|
||
alphabeth = { | ||
'a': '4', 'b': '|3', 'c': '[', 'd': '|>', 'e': '3', | ||
'f': '|=', 'g': '&', 'h': '#', 'i': '1', 'j': ']', | ||
'k': '|(', 'l': '7', 'm': 'nn', 'n': '^', 'o': '0', | ||
'p': '|*', 'q': '9', 'r': '|2', 's': '5', 't': '-|-', | ||
'u': '(_)', 'v': '|/', 'w': '\|/', 'x': '><', 'y': 'j', | ||
'z': '2', ' ': ' ' | ||
} | ||
|
||
def inputText(): | ||
textUser = input('Ingresa un texto\n') | ||
lowerText = textUser.lower() | ||
return lowerText | ||
|
||
def hackText(text): | ||
convertedText = [] | ||
|
||
for i in text: | ||
if i in alphabeth: | ||
convertedText.append(alphabeth[i]) | ||
leet = ''.join(convertedText) | ||
return str(leet) | ||
|
||
if __name__ == '__main__': | ||
main() |
50 changes: 50 additions & 0 deletions
50
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/python/nicoodiaz.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,50 @@ | ||
abc = { | ||
"A":"4", | ||
"B":"I3", | ||
"C":"[", | ||
"D":")", | ||
"E":"3", | ||
"F":"|=", | ||
"G":"&", | ||
"H":"#", | ||
"I":"1", | ||
"J":",_|", | ||
"K":">|", | ||
"L":"1", | ||
"M":"JVI", | ||
"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", | ||
" ":" ", | ||
} | ||
|
||
normal_word = input('Escribe lo que quieras transformar: ') | ||
normal_word_M = normal_word.upper() | ||
word_leet = '' | ||
|
||
for i in range(len(normal_word_M)): | ||
speel = normal_word_M[i] | ||
result = speel.replace(speel, abc[speel]) | ||
word_leet += result | ||
|
||
print(f'En lenguaje leet es: ', {word_leet}) |
Oops, something went wrong.