// Package secret provides secrec handshake functions.
package secret
// Handshake returns the handshake for the given code.
func Handshake(code uint) []string {
const (
wink = 1 << iota
dblink
cye
jump
rev
)
out := []string{}
if code&wink != 0 {
out = append(out, "wink")
}
if code&dblink != 0 {
out = append(out, "double blink")
}
if code&cye != 0 {
out = append(out, "close your eyes")
}
if code&jump != 0 {
out = append(out, "jump")
}
if code&rev != 0 {
for i, j := 0, len(out)-1; i < j; i, j = i+1, j-1 {
out[i], out[j] = out[j], out[i]
}
}
return out
}