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}