Skip to content Search Apps Documentation Source Content 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.

v0 state

Back to all declarations

maxHistory

untyped bigint

maxHistory is the number of recent changes kept in the log.

Value

(20 <untyped> bigint)

change

type

change is a single recorded mutation of the counter.

Value

v0.change

value

int

value is the current shared counter.

Value

0

total

int

total counts every mutation ever applied (not capped, unlike history).

Value

0

history

[]v0.change

history holds the last maxHistory changes, oldest first.

Value

<zero>

record

func(delta int, newValue int)

record appends a change to the history, trimming to the last maxHistory.

Open
OID
0a81c7…a034:6
record details

Inspect func

Inc

func() int

Inc adds one to the shared counter and logs the change.

Open
OID
0a81c7…a034:8
Inc details

Inspect func

Dec

func() int

Dec subtracts one from the shared counter and logs the change.

Open
OID
0a81c7…a034:9
Dec details

Inspect func

Reset

func() int

Reset sets the shared counter back to zero and logs the change. The recorded delta is the amount required to bring the previous value to zero.

Open
OID
0a81c7…a034:10
Reset details

Inspect func

Value

func() int

Value returns the current counter value (read-only helper).

Open
OID
0a81c7…a034:11
Value details

Inspect func

Total

func() int

Total returns the total number of mutations ever applied.

Open
OID
0a81c7…a034:12
Total details

Inspect func

Render

func(path string) string

Render produces a Markdown view: the big current value, the total number of changes, and a table of the most recent changes (newest first).

Open
OID
0a81c7…a034:13
Render details

Inspect func

signed

func(n int) string

signed formats an int with an explicit leading sign for non-negative values.

Open
OID
0a81c7…a034:14
signed details

Inspect func
maxHistory : untyped bigint =(20 <untyped> bigint)
change : type =v0.change
value : int =0
total : int =0
history : []v0.change =<zero>
record : func(delta int, newValue int) Inspect
Inc : func() int Inspect
Dec : func() int Inspect
Reset : func() int Inspect
Value : func() int Inspect
Total : func() int Inspect
Render : func(path string) string Inspect
signed : func(n int) string Inspect