day 12 part 1 works, thanks gbmor

This commit is contained in:
Nico 2020-12-12 18:31:47 +00:00
parent 8ae5a51969
commit 54a6a60141
1 changed files with 2 additions and 2 deletions

View File

@ -53,11 +53,11 @@ func main() {
case 'R':
h := num/90
f := ship.Facing + h
ship.Facing = abs(f%4)
ship.Facing = ((f%4)+4)%4
case 'L':
h := num/90
f := ship.Facing - h
ship.Facing = abs(f%4)
ship.Facing = ((f%4)+4)%4
}
fmt.Printf("INSTRUCTION: %s, FACING: %d, N/S POS: %d, E/W POS: %d\n",l, ship.Facing, ship.NS, ship.EW)
}