-
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
80 changed files
with
4,149 additions
and
1 deletion.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/java/Amonsalve.java
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,21 @@ | ||
package com.mycompany.amonsalve; | ||
|
||
public class Amonsalve { | ||
|
||
public static void main(String[] args) { | ||
int numero=100; | ||
for(int i=1;i<=numero;i++){ | ||
if(i%3 == 0 && i%5 == 0){ | ||
System.out.println("fizzbuzz"); | ||
} | ||
else if(i%3 == 0){ | ||
System.out.println("fizz"); | ||
} | ||
else if(i%5 == 0){ | ||
System.out.println("buzz"); | ||
}else{ | ||
System.out.println(i); | ||
} | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/javascript/dPenedo.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,33 @@ | ||
// / | ||
// 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". | ||
// | ||
|
||
function isMultiple(number, divider){ | ||
return number % divider == 0 | ||
} | ||
|
||
|
||
function printNumbers(number){ | ||
const listNumber = number | ||
for (let index = 1; index <= listNumber; index++) { | ||
const multipleOf3 = isMultiple(index, 3) | ||
const multipleOf5 = isMultiple(index, 5) | ||
if (multipleOf3 && multipleOf5){ | ||
console.log("fizzbuzz") | ||
}else if(multipleOf3){ | ||
console.log("fizz") | ||
}else if(multipleOf5){ | ||
console.log("buzz") | ||
} | ||
else{ | ||
console.log(index) | ||
} | ||
} | ||
} | ||
|
||
printNumbers(100) |
26 changes: 26 additions & 0 deletions
26
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/javascript/patriciotrujilllo.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,26 @@ | ||
/* | ||
* 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". | ||
*/ | ||
|
||
function fizzBuzz() { | ||
for (let i = 1; i <= 100; i++) { | ||
if (i % 5 === 0 && i % 3 === 0) { | ||
console.log('fizzbuzz') | ||
} | ||
else if (i % 5 === 0) { | ||
console.log('buzz') | ||
} | ||
else if (i % 3 === 0) { | ||
console.log('fizz') | ||
} | ||
else { | ||
console.log(i) | ||
} | ||
} | ||
} | ||
fizzBuzz() |
15 changes: 15 additions & 0 deletions
15
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/MThem97.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,15 @@ | ||
|
||
r=range(1,101) | ||
for number in r: | ||
if number % 5==0 and number % 3==0: | ||
print('fizzbuzz') | ||
if number % 3==0: | ||
print('fizz') | ||
if number % 5==0: | ||
print('buzz') | ||
else: | ||
print(number) | ||
|
||
|
||
|
||
|
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 |
---|---|---|
|
@@ -20,4 +20,5 @@ def es_multiplo(numero, divisor): | |
print("fizz") | ||
elif multiplo_de_5: | ||
print("buzz") | ||
print(i) | ||
else: | ||
print(i) |
17 changes: 17 additions & 0 deletions
17
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/python/jaimegamm.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 @@ | ||
|
||
# * 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 numero in range(1, 101): | ||
if numero % 3 == 0 and numero % 5 == 0: | ||
print(f"fizzbuzz {numero}") | ||
elif numero % 3 == 0: | ||
print(f"fizz {numero}") | ||
elif numero % 5 == 0: | ||
print(f"buzz {numero}") | ||
else: | ||
print(numero) |
11 changes: 11 additions & 0 deletions
11
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/ruby/mauricionc.rb
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 @@ | ||
(1..100).each do |n| | ||
if n % 3 == 0 && n % 5 == 0 | ||
puts "fizzbuzz" | ||
elsif n % 3 == 0 | ||
puts "fizz" | ||
elsif n % 5 == 0 | ||
puts "buzz" | ||
else | ||
puts n | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/rust/blackriper.rs
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,15 @@ | ||
fn bizz_fuzz() { | ||
for i in 1..=100 { | ||
if i % 3 == 0 && i % 5 == 0 { | ||
println!("fizzbuzz"); | ||
} else if i % 3 == 0 { | ||
println!("fizz"); | ||
} else if i % 5 == 0 { | ||
println!("buzz"); | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
bizz_fuzz(); | ||
} |
9 changes: 9 additions & 0 deletions
9
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/scala/avelasquezhe84.scala
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,9 @@ | ||
// Scala 3 | ||
|
||
@main def fizzbuzz() = | ||
(1 to 100).foreach(i => | ||
if i % 15 == 0 then println("fizzbuzz") | ||
else if i % 3 == 0 then println("fizz") | ||
else if i % 5 == 0 then println("buzz") | ||
else println(i) | ||
) |
19 changes: 19 additions & 0 deletions
19
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/swift/jcalderita.swift
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 Foundation | ||
|
||
(1 ... 100).forEach { | ||
var result: String = "" | ||
|
||
if $0 % 3 == 0 { | ||
result.append("fizz") | ||
} | ||
|
||
if $0 % 5 == 0 { | ||
result.append("buzz") | ||
} | ||
|
||
if result.isEmpty { | ||
result.append($0.description) | ||
} | ||
|
||
print(result) | ||
} |
33 changes: 33 additions & 0 deletions
33
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/typescript/dPenedo.ts
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,33 @@ | ||
// / | ||
// 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". | ||
// | ||
|
||
function isMultiple(number: number, divider: number) { | ||
return number % divider == 0 | ||
} | ||
|
||
|
||
function printNumbers(number: number) { | ||
const listNumber = number | ||
for (let index = 1; index <= listNumber; index++) { | ||
const multipleOf3 = isMultiple(index, 3) | ||
const multipleOf5 = isMultiple(index, 5) | ||
if (multipleOf3 && multipleOf5) { | ||
console.log("fizzbuzz") | ||
} else if (multipleOf3) { | ||
console.log("fizz") | ||
} else if (multipleOf5) { | ||
console.log("buzz") | ||
} | ||
else { | ||
console.log(index) | ||
} | ||
} | ||
} | ||
|
||
printNumbers(100) |
42 changes: 42 additions & 0 deletions
42
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/c#/patriciotrujilllo.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,42 @@ | ||
/* | ||
* 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") | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Leet | ||
{ | ||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
Console.Write("Ingrese una palabra para ser traducida al lenguaje Hacker: "); | ||
string text = Console.ReadLine(); | ||
var diccionario = new Dictionary<char, string> | ||
{ | ||
{'a', "4"}, {'b', "8"}, {'c', "<"}, {'d', "|)"}, {'e', "3"}, | ||
{'f', "|="}, {'g', "6"}, {'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', "R"}, {'3', "E"}, {'4', "A"}, | ||
{'5', "S"}, {'6', "b"}, {'7', "T"}, {'8', "B"}, {'9', "g"}, {'0', "o"} | ||
}; | ||
|
||
var textCovert = ""; | ||
|
||
foreach (var caracter in text.ToLower()) | ||
{ | ||
textCovert += diccionario.ContainsKey(caracter) ? diccionario[caracter] : caracter.ToString(); | ||
} | ||
|
||
Console.WriteLine(textCovert); | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/javascript/jaimegamm.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,66 @@ | ||
/* | ||
* 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") | ||
*/ | ||
|
||
let lenguaje_hacker = { | ||
"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" | ||
} | ||
|
||
function leet_converter(text){ | ||
leet_text = "" | ||
text = text.toLowerCase(); | ||
for (var i = 0; i < text.length; i++) { | ||
var letra = text.charAt(i); | ||
if(letra in lenguaje_hacker){ | ||
leet_text += lenguaje_hacker[letra] | ||
}else{ | ||
leet_text += letra | ||
} | ||
} | ||
return leet_text; | ||
} | ||
|
||
|
||
text = "Hola Mundo" | ||
console.log("Texto original: " + text) | ||
console.log("Texto en leet: "+leet_converter(text)) |
24 changes: 24 additions & 0 deletions
24
Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/javascript/patriciotrujilllo.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,24 @@ | ||
/* | ||
* 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") | ||
*/ | ||
|
||
function Transform(word) { | ||
const diccionario = { | ||
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' | ||
} | ||
|
||
let leetWord = word.split('').map(caracter => (diccionario[caracter])) | ||
|
||
return leetWord.join('') | ||
} | ||
|
||
console.log(Transform('abc')) |
Oops, something went wrong.