whoops nums bitwised

master
Bel LaPointe 2023-03-23 16:14:25 -06:00
parent f9ec874491
commit 4f48ee805f
4 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@ -57,7 +57,7 @@ func ToChar(k Key) byte {
}
func FromChar(b byte) Key {
if b < 'a' {
if 'A' <= b && b <= 'Z' {
b += 'a' - 'A'
}
v, ok := charToKey[b]

View File

@ -3,6 +3,9 @@ package key
import "testing"
func TestFromChar(t *testing.T) {
if got := FromChar('1'); got != N1 {
t.Error(got)
}
if got := FromChar('a'); got != A {
t.Error(got)
}

View File

@ -2,3 +2,9 @@ w: i
a: j
s: k
d: l
q: u
e: o
1: 0
2: 9
3: 8
4: 7