while loop


Wile E Coyote and Roadrunner – Demonstrating programming bugs

An interesting way to demonstrate a common bug that arises by the wrong use of a simple do while loop instead of the while do loop.

An interesting way to demonstrate a common bug that arises by the wrong use of a simple do while loop instead of the while do loop. In this case, Wile E Coyote first runs and then decides to check if he met an edge causing him to fall into the cliff. On the other hand the Roadrunner first checks if there is an edge before running and this way avoid making the same mistake.

In this case, Wile E Coyote first runs and then decides to check if he met an edge causing him to fall into the cliff. On the other hand the Roadrunner first checks if there is an edge before running and this way avoid making the same mistake.

Advertisements