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.

z2_plan_filetest.gno

0.70 Kb · 25 lines
 1// PKGPATH: gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/z2
 2
 3// Plain-text plans compile to input characters.
 4package z2
 5
 6import (
 7	rules "gno.land/p/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/brawl"
 8	"gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/rooms"
 9)
10
11func main(cur realm) {
12	p := rooms.Compile("run SE 3; attack; wait 2\nrun 4 2; special; run nw 200", 12)
13	println(len(p), p)
14	for i := 0; i < len(p); i++ {
15		m, a, _ := rules.Decode(p[i])
16		print(m, "/", a, " ")
17	}
18	println()
19	println(revive(func() { rooms.Compile("jump 3", 10) }))
20}
21
22// Output:
23// 12 %%%633''Z---
24// 2 / 0  2 / 0  2 / 0  2 / 1  16 / 0  16 / 0  4 / 0  4 / 0  4 / 3  10 / 0  10 / 0  10 / 0
25// plan step "jump 3": unknown word "jump"