Skip to content

Instantly share code, notes, and snippets.

@bontusss
Created December 27, 2022 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bontusss/5b7b525b44699c2e04d5039454df52e2 to your computer and use it in GitHub Desktop.
Save bontusss/5b7b525b44699c2e04d5039454df52e2 to your computer and use it in GitHub Desktop.
Coolify
package main
import (
"bufio"
"fmt"
"math/rand"
"os"
"time"
)
const (
duplicateVowel bool = true
removeVowel bool = false
)
func randBool() bool {
return rand.Intn(2) == 0
}
func main() {
rand.Seed(time.Now().UTC().UnixNano())
s := bufio.NewScanner(os.Stdin)
for s.Scan() {
word := []byte(s.Text())
if randBool() {
var vI int = -1
for i, char := range word {
switch char {
case 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U':
if randBool() {
vI = i
}
}
}
if vI >= 0 {
switch randBool() {
case duplicateVowel:
word = append(word[:vI+1], word[vI:]...)
case removeVowel:
word = append(word[:vI], word[vI+1:]...)
}
}
}
fmt.Println(string(word))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment