Skip to content

Instantly share code, notes, and snippets.

@JRaspass
Last active May 21, 2020 11:41
Show Gist options
  • Save JRaspass/b8b7c0255c6243044cccb763d950156b to your computer and use it in GitHub Desktop.
Save JRaspass/b8b7c0255c6243044cccb763d950156b to your computer and use it in GitHub Desktop.
package hole
import (
"math/rand"
"strings"
)
func brainfuck() ([]string, string) {
args := []string{
...,
}
outs := []string{
...,
}
- // Shuffle
- for i := range args {
- j := rand.Intn(i + 1)
+ rand.Shuffle(len(args), func(i, j int) {
args[i], args[j] = args[j], args[i]
outs[i], outs[j] = outs[j], outs[i]
- }
+ })
return args, strings.Join(outs, "\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment