"Tayssir John Gabbour" <ta*********@yahoo.com> wrote:
I don't quite understand this sentence, perhaps I'm not thinking
straight: "If a stone is hit, the speed vectors are devided by 2
(integer devision without fraction) as long as no stone is hit (which
can result in a speed vector of (0, 0))."
the sentence before is important:
| After this the speed vector is added to the coordinate, but only, if
| the new coordinate does not hit a stone after adding the speed.
So, suppose when step 20 occurs:
* You're 2 pixels left of a stone.
* Your velocity-x will be 2 pixels/step on step 20 and (if possible)
21.
* velocity-y will be arbitrary.
What happens? Are you able to go partly through a stone?
no, the robot is always stone-free. If you are 2 pixels left of a stone
and your velocity-x is 2, the next turn you are 0 pixels left of a stone.
Then adding the velocity will result in hitting a stone, so the new
velocity is (1, velocity-y/2) and because this will result in a hit, too,
again the velocity is devided, which will result in a velocity-x of 0 and
velocity-y devided by 2 again.
--
Frank Buß,
fb@frank-buss.de http://www.frank-buss.de,
http://www.it4-systems.de