Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

z3_unranked_filetest.gno

1.27 Kb · 35 lines
 1// PKGPATH: gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/z3
 2
 3// Practice runs, weaker ranked runs and ghost duels are only counted: no replay, nothing stored.
 4package z3
 5
 6import (
 7	"strings"
 8
 9	rules "gno.land/p/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/brawl/v4"
10	"gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/brawl/v4"
11)
12
13var _ = strings.Repeat
14
15func run(c int) string {
16	a := strings.Repeat(string(rules.Encode(1, rules.None)), 9) + string(rules.Encode(1, rules.Attack))
17	b := strings.Repeat(string(rules.Encode(c, rules.None)), 9) + string(rules.Encode(4, rules.Special))
18	return strings.Repeat(a+b, 30)
19}
20
21var still = strings.Repeat(string(rules.Encode(rules.Still, rules.None)), 600)
22
23func main(cur realm) {
24	brawl.Submit(cross(cur), brawl.HardBot, 0, rules.Reader, "Tester", run(0), 3, 60)
25	println(brawl.Submit(cross(cur), brawl.EasyBot, 7, rules.Coward, "Tester", still, 40, 1))
26	println(brawl.Submit(cross(cur), brawl.HardBot, 4, rules.Coward, "Tester", run(3), 0, 64))
27	println(brawl.Submit(cross(cur), 10, 0, rules.Hunter, "Tester", run(5), 9, 2))
28	println(brawl.RunCount(), brawl.Top())
29}
30
31// Output:
32// 0
33// 0
34// 0
35// 4 [{"id":10,"player":"g1rlwtj72r2qqm2gke0lps0af0ermmdl9wnwyt3q","name":"Tester","class":4,"seed":0,"arena":"Tavern","gold":3,"botGold":60,"height":123}]