Realm

gno.land/r/moul/x/daily/stack/v1

Rendered output

Stack & Queue Playground

A stack is LIFO (last in, first out) — the last item pushed is the first popped. A queue is FIFO (first in, first out) — the first item enqueued is the first dequeued.

Stack (LIFO) — size 0

Contents (bottom → top): (empty)

Top: (none)Pop would panic.

Queue (FIFO) — size 0

Contents (front → back): (empty)

Front: (none)Dequeue would panic.


Tip: push the same sequence into both, then Pop vs Dequeue to see LIFO reverse it while FIFO preserves order.

Query (read-only)

non-crossing functions · no tx, no wallet needed
QueueSize() → int
StackSize() → int

Call functions (state-changing)

signs a tx via Adena
Dequeue()
Enqueue(n int)
Pop()
Push(n int)

All exported functions (7)

show raw signatures
NameParamsReturns
Push [{"Name": "cur", "Type": "interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}", "Value": ""}, {"Name": "n", "Type": "int", "Value": ""}]
Pop [{"Name": "cur", "Type": "interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}", "Value": ""}] [{"Name": ".res.0", "Type": "int", "Value": ""}]
Enqueue [{"Name": "cur", "Type": "interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}", "Value": ""}, {"Name": "n", "Type": "int", "Value": ""}]
Dequeue [{"Name": "cur", "Type": "interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}", "Value": ""}] [{"Name": ".res.0", "Type": "int", "Value": ""}]
StackSize [{"Name": ".res.0", "Type": "int", "Value": ""}]
QueueSize [{"Name": ".res.0", "Type": "int", "Value": ""}]
Render [{"Name": "path", "Type": "string", "Value": ""}] [{"Name": ".res.0", "Type": "string", "Value": ""}]

Files

Storage

{
  "raw": "storage: 7845, deposit: 784500"
}