2.1
How Penguins Move
(WESN)
This is not the easiest topic to get your head around, so please ask if you don't understand something.
Penguins always try to move diagonally when there are no obstacles.
If there is an obstacle in the direction the penguin wishes to move, the penguin will always choose to move west or east before choosing to move north or south.
The penguin in the diagram below is wishing to move SW.
This penguin can only do so when the SW, west, and south squares are free of obstacles. In this case, there is an obstacle to the SW and west.
First, it tries to move SW and sees both obstacles. It cannot move SW.
Second, it tries to move west. It sees an obstacle and cannot move west.
Third, it tries to move south. That space is free. It moves south.
This time, SW has no obstacle. But west still has an obstacle.
The penguin still cannot move SW! It also cannot move west.
It has to move south again.
(continued) ~ Bill
This is not the easiest topic to get your head around, so please ask if you don't understand something.
Penguins always try to move diagonally when there are no obstacles.
If there is an obstacle in the direction the penguin wishes to move, the penguin will always choose to move west or east before choosing to move north or south.
The penguin in the diagram below is wishing to move SW.
*XXXX
XX
A
__
XX
___
X
____
__
X
__
XX
___
This penguin can only do so when the SW, west, and south squares are free of obstacles. In this case, there is an obstacle to the SW and west.
First, it tries to move SW and sees both obstacles. It cannot move SW.
Second, it tries to move west. It sees an obstacle and cannot move west.
Third, it tries to move south. That space is free. It moves south.
XXXXX
XX
___
XX
A
__
X
____
__
X
__
XX
___
This time, SW has no obstacle. But west still has an obstacle.
The penguin still cannot move SW! It also cannot move west.
It has to move south again.
XXXXX
XX
___
XX
___
X
_
A
__
__
X
__
XX
___
(continued) ~ Bill
18-Feb-2014 02:40:15 - Last edited on 18-Feb-2014 02:49:20 by Shady Guy