selfPath
untyped stringselfPath is this realm's own page. A root-relative link resolves against the domain, not the realm, so every link back into it names it in full.
Value
"/r/moul/x/daily/collatz/v1"
maxIters
untyped bigintmaxIters 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)
MaxResults
untyped bigintMaxResults bounds the leaderboard's state: anyone may Compute, and each new n is a new entry the root page sorts.
Value
(1000 <untyped> bigint)
maxSeqLen
untyped bigintmaxSeqLen caps how many terms Render("/\<n>") will print.
Value
(500 <untyped> bigint)
Result
typeResult is one recorded submission.
Value
v1.Result
results
v0.Treeresults maps a decimal-string key of N -> Result. avl.Tree keeps a deterministic order for iteration inside Render.
- OID
- 00f2d4…fa70:4
results details
maxOdd
untyped bigintmaxOdd is the largest odd term whose successor 3n+1 still fits in an int64. Past it the step wraps: 6148914691236517205 maps to exactly 2^64, which is 0, and the walk then spins on 0 until maxIters.
Value
(3074457345618258602 <untyped> bigint)
stopping
func(n int64) (steps int, peak int64, ok bool)stopping returns the number of steps to reach 1 and the peak value seen, walking the Collatz (hailstone) map. ok is false when a term would overflow int64, in which case steps and peak describe the walk up to that term. It never mutates state.
- OID
- 00f2d4…fa70:5
stopping details
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.
- OID
- 00f2d4…fa70:7
Compute details
byLongest
typebyLongest implements sort.Interface, ordering results by steps desc, then peak desc, then n asc for stability.
Value
v1.byLongest
Render
func(path string) stringRender shows the leaderboard at root, or the full hailstone sequence for a given n at path "/\<n>".
- OID
- 00f2d4…fa70:8
Render details
renderLeaderboard
func() string- OID
- 00f2d4…fa70:9
renderLeaderboard details
renderSequence
func(p string) string- OID
- 00f2d4…fa70:10