Search Apps Documentation Source Content File Folder Download Copy Actions Download

main.gno

0.36 Kb · 28 lines
 1package variadic
 2
 3import "strings"
 4
 5func Echo(cur realm, vals ...string) string {
 6	return strings.Join(vals, " ")
 7}
 8
 9func Add(cur realm, nums ...int) int {
10	res := 0
11
12	for _, num := range nums {
13		res += num
14	}
15
16	return res
17}
18
19func And(cur realm, booleans ...bool) bool {
20
21	for _, boolean := range booleans {
22		if !boolean {
23			return false
24		}
25	}
26
27	return true
28}