mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-19 05:21:03 +01:00
added
This commit is contained in:
17
vendor/github.com/glycerine/zygomys/zygo/random.go
generated
vendored
Normal file
17
vendor/github.com/glycerine/zygomys/zygo/random.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package zygo
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
var defaultRand = rand.New(rand.NewSource(time.Now().Unix()))
|
||||
|
||||
func RandomFunction(env *Zlisp, name string,
|
||||
args []Sexp) (Sexp, error) {
|
||||
return &SexpFloat{Val: defaultRand.Float64()}, nil
|
||||
}
|
||||
|
||||
func (env *Zlisp) ImportRandom() {
|
||||
env.AddFunction("random", RandomFunction)
|
||||
}
|
||||
Reference in New Issue
Block a user