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 source realm

Constants 1

Functions 5

func GetPlayerJSON

Action
1func GetPlayerJSON(addr string) string
source

GetPlayerJSON returns an address's full profile as JSON, or "null": {"pseudo":"…","address":"…","melomane_unlocked":true,

Example
1"classic":{"score":…,"level_max":…,"instrument":"…"},
2"melomane":{"score":…,"level_max":…,"instrument":"…"}}

func GetTopJSON

Action
1func GetTopJSON(mode string, n int) string
source

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

func Register

crossing Action
1func Register(cur realm, pseudo string)
source

Register links a nickname to the wallet signing the transaction.

func Render

1func Render(_ string) string
source

Render shows both leaderboards as Markdown on gnoweb.

func SubmitScore

crossing Action
1func SubmitScore(cur realm, mode string, score int, level int, instrument string)
source

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

Types 2

type Player

struct
1type Player struct {
2	Pseudo   string
3	Address  address
4	Classic  Record
5	Melomane Record
6}
source

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

type Record

struct
1type Record struct {
2	Score      int
3	Level      int
4	Instrument string
5}
source

Record = best result in one mode.

Dependencies

Imports 3

/r/g18nke2hpu3zue0da9yudzxeugfyxuk3edjj4w79/sonotone2

Imported by indexer

Source Files 2