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

decode.gno

0.30 Kb · 10 lines
 1package brawl
 2
 3// Decode reads one input character: the move (a direction 0..15 or Still)
 4// and the action. ok is false for a character that isn't an input.
 5func Decode(c byte) (move, act int, ok bool) {
 6	if c >= 128 || decMove[c] < 0 {
 7		return Still, None, false
 8	}
 9	return decMove[c], decAct[c], true
10}