Reject move commands in non-cardinal directions

This commit is contained in:
Marc Di Luzio 2020-07-19 11:26:08 +01:00
parent 0e731df1a3
commit c2e3c9f090
4 changed files with 23 additions and 9 deletions

View file

@ -215,7 +215,7 @@ func InnerMain(command string, args ...string) error {
i++
if len(args) == i {
return fmt.Errorf("move command must be passed bearing")
} else if _, err := maths.FromString(args[i]); err != nil {
} else if _, err := maths.BearingFromString(args[i]); err != nil {
return err
}
commands = append(commands,