summaryrefslogblamecommitdiff
path: root/members.go
blob: 81f0f158565e14d1481367e30615b8948c0cd19b (plain) (tree)
1
2
3
4
5
6
7
8
9






                   
                                                           
                                    





                                           
         

                     
package main

import (
	"math/rand"
	"time"
)

func getRandomMember(team []string, except string) string {
	rand.Seed(time.Now().Unix())
	ok := false
	member := ""
	for !ok {
		n := rand.Int() % len(team)
		member = team[n]
		ok = member != except
	}
	return member
}