Skip to content

Commit

Permalink
Merge pull request mouredev#6475 from LuisZentenxx/LuisZentenxx
Browse files Browse the repository at this point in the history
Reto mouredev#1 - Go
  • Loading branch information
Roswell468 authored Apr 28, 2024
2 parents 2afd84d + 2e0c169 commit ea0bc73
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/go/LuisZentenxx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import "fmt"

func main() {

for i := 1; i <= 100; i++ {

if i%3 == 0 && i%5 == 0 {
fmt.Println(i, "fizzbuzz")

} else if i%3 == 0 {
fmt.Println(i, "fizz")

} else if i%5 == 0 {
fmt.Println(i, "buzz")

} else {
fmt.Println(i)
}
}
}
53 changes: 53 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/go/LuisZentenxx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package main

import (
"fmt"
"strings"
)

func main() {
originalMsg := "Golang reto #1"

leetCode := map[string]string{
"a": "4",
"b": "|3",
"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": "VV",
"x": "><",
"y": "j",
"z": "2",
}

originalMsgLower := strings.ToLower(originalMsg)

var mensajeLeet strings.Builder
for _, char := range originalMsgLower {
charStr := string(char)
if leetValue, ok := leetCode[charStr]; ok {
mensajeLeet.WriteString(leetValue)
} else {
mensajeLeet.WriteString(charStr)
}
}

fmt.Println("Mensaje codificado en leet:", mensajeLeet.String())
}

0 comments on commit ea0bc73

Please sign in to comment.