Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 state

Back to all declarations

maxIters

untyped bigint

maxIters caps the Collatz walk so a hostile / huge input cannot loop forever on-chain. No known n stays below this bound and fails to reach 1.

Value

(1000000 <untyped> bigint)

maxSeqLen

untyped bigint

maxSeqLen caps how many terms Render("/\<n>") will print.

Value

(500 <untyped> bigint)

Result

type

Result is one recorded submission.

Value

v0.Result

results

v0.Tree

results maps a decimal-string key of N -> Result. avl.Tree keeps a deterministic order for iteration inside Render.

Open
OID
09b096…5ecf:4
results details

Inspect ref

stopping

func(n int64) (steps int, peak int64)

stopping returns the number of steps to reach 1 and the peak value seen, walking the Collatz (hailstone) map. It never mutates state.

Open
OID
09b096…5ecf:5
stopping details

Inspect func

Compute

func(n int)

Compute walks the hailstone sequence for n and records the result attributed to the caller. It is a crossing (state-mutating) func.

Open
OID
09b096…5ecf:7
Compute details

Inspect func

byLongest

type

byLongest implements sort.Interface, ordering results by steps desc, then peak desc, then n asc for stability.

Value

v0.byLongest

Render

func(path string) string

Render shows the leaderboard at root, or the full hailstone sequence for a given n at path "/\<n>".

Open
OID
09b096…5ecf:8
Render details

Inspect func

renderLeaderboard

func() string
Open
OID
09b096…5ecf:9
renderLeaderboard details

Inspect func

renderSequence

func(p string) string
Open
OID
09b096…5ecf:10
renderSequence details

Inspect func
maxIters : untyped bigint =(1000000 <untyped> bigint)
maxSeqLen : untyped bigint =(500 <untyped> bigint)
Result : type =v0.Result
results : v0.Tree Inspect
stopping : func(n int64) (steps int, peak int64) Inspect
Compute : func(n int) Inspect
byLongest : type =v0.byLongest
Render : func(path string) string Inspect
renderLeaderboard : func() string Inspect
renderSequence : func(p string) string Inspect