Created
December 26, 2022 03:00
-
-
Save bontusss/fcad8b929dcb508593134fc9d80fcddc to your computer and use it in GitHub Desktop.
Sprinkle program
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"math/rand" | |
"os" | |
"strings" | |
"time" | |
) | |
const otherWord = "*" | |
var transforms = []string{ | |
otherWord + "app", | |
otherWord + "site", | |
otherWord + "time", | |
"get" + otherWord, | |
"go" + otherWord, | |
"lets" + otherWord, | |
otherWord + "hq", | |
} | |
func main() { | |
rand.Seed(time.Now().UTC().UnixNano()) | |
s := bufio.NewScanner(os.Stdin) | |
for s.Scan() { | |
t := transforms[rand.Intn(len(transforms))] | |
fmt.Println(strings.Replace(t, otherWord, s.Text(), -1)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment