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.

sonotone2 state

Back to all declarations

MaxScore

untyped bigint

Value

(1000000 <untyped> bigint)

MelomaneUnlockAt

untyped bigint

// Classic points needed to unlock Mélomane

Value

(135 <untyped> bigint)

Record

type

Record = best result in one mode.

Value

sonotone2.Record

Player

type

Player = a registered player and their best record per mode.

Value

sonotone2.Player

players

v0.Tree

// key: wallet address -> \*Player

Open
OID
0939ab…0b67:4
players details

Inspect ref

pseudos

v0.Tree

// key: lowercase nickname -> wallet address

Open
OID
0939ab…0b67:6
pseudos details

Inspect ref

Register

func(pseudo string)

Register links a nickname to the wallet signing the transaction.

Open
OID
0939ab…0b67:7
Register details

Inspect func

SubmitScore

func(mode string, score int, level int, instrument string)

SubmitScore saves a new record in a mode ("classic" or "melomane").

Open
OID
0939ab…0b67:9
SubmitScore details

Inspect func

GetPlayerJSON

func(addr string) string

GetPlayerJSON returns an address's full profile as JSON, or "null": {"pseudo":"…","address":"…","melomane\_unlocked":true, "classic":{"score":…,"level_max":…,"instrument":"…"}, "melomane":{"score":…,"level_max":…,"instrument":"…"}}

Open
OID
0939ab…0b67:10
GetPlayerJSON details

Inspect func

GetTopJSON

func(mode string, n int) string

GetTopJSON returns the top n players of a mode, as JSON: \[{"pseudo":"…","address":"…","score":…,"level\_max":…,"instrument":"…"}, …]

Open
OID
0939ab…0b67:11
GetTopJSON details

Inspect func

Render

func(string) string

Render shows both leaderboards as Markdown on gnoweb.

Open
OID
0939ab…0b67:12
Render details

Inspect func

renderTable

func(title string, mode string) string
Open
OID
0939ab…0b67:13
renderTable details

Inspect func

recordOf

func(p *sonotone2.Player, mode string) sonotone2.Record
Open
OID
0939ab…0b67:14
recordOf details

Inspect func

recordJSON

func(r sonotone2.Record) string
Open
OID
0939ab…0b67:15
recordJSON details

Inspect func

checkPseudo

func(p string)

checkPseudo: 3 to 20 characters, letters, digits, \_ and - only.

Open
OID
0939ab…0b67:16
checkPseudo details

Inspect func

validInstrument

func(i string) bool
Open
OID
0939ab…0b67:17
validInstrument details

Inspect func

topPlayers

func(mode string, n int) []*sonotone2.Player

topPlayers sorts players with a score in this mode, highest first.

Open
OID
0939ab…0b67:18
topPlayers details

Inspect func
MaxScore : untyped bigint =(1000000 <untyped> bigint)
MelomaneUnlockAt : untyped bigint =(135 <untyped> bigint)
Record : type =sonotone2.Record
Player : type =sonotone2.Player
players : v0.Tree Inspect
pseudos : v0.Tree Inspect
Register : func(pseudo string) Inspect
SubmitScore : func(mode string, score int, level int, instrument string) Inspect
GetPlayerJSON : func(addr string) string Inspect
GetTopJSON : func(mode string, n int) string Inspect
Render : func(string) string Inspect
renderTable : func(title string, mode string) string Inspect
recordOf : func(p *sonotone2.Player, mode string) sonotone2.Record Inspect
recordJSON : func(r sonotone2.Record) string Inspect
checkPseudo : func(p string) Inspect
validInstrument : func(i string) bool Inspect
topPlayers : func(mode string, n int) []*sonotone2.Player Inspect