Clarify the 48 magic number
This commit is contained in:
parent
ea0a467b5c
commit
9665ad2a21
|
@ -4,7 +4,7 @@ import ./common
|
||||||
type SubmarineCommand = enum
|
type SubmarineCommand = enum
|
||||||
Forward, Up, Down
|
Forward, Up, Down
|
||||||
|
|
||||||
proc parseArg(c: char): int = c.int() - 48
|
proc parseArg(c: char): int = c.int() - int('0')
|
||||||
|
|
||||||
proc parseSubmarineCommand(l: string): (SubmarineCommand, int) =
|
proc parseSubmarineCommand(l: string): (SubmarineCommand, int) =
|
||||||
case l[0]:
|
case l[0]:
|
||||||
|
|
Loading…
Reference in a new issue