News:

The Savage///Circuits website has been upgraded to a more efficient theme.

Main Menu

Road Runner Program Logic

Started by Chris Savage, Mar 22, 2025, 11:18 PM

Previous topic - Next topic

Chris Savage

As a programmer, I like this!

You cannot view this attachment.

Source

                    Bringing concepts to life through engineering.

JKnightandKARR

Lol. Is that the point in the code where it crashed??

granz

Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??
LOL - Good one.

Chris Savage

#3
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??

Could be. The example is more BASIC (pun intended) by demonstrating that, depending on when your conditional is executed, you could end up executing more code than you expect (that's overly simplifying it).

In the graphic, the Roadrunner example is he evaluates his conditional BEFORE executing commands. The coyote on the other hand executes THEN checks the conditional evaluation, which may have returned a FALSE (meaning it should NOT have run).

                    Bringing concepts to life through engineering.

JKnightandKARR

Quote from: granz on Mar 23, 2025, 06:53 PM
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??
LOL - Good one.
I thought so.

Quote from: Chris Savage on Mar 23, 2025, 09:48 PM
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??

Could be. The example is more BASIC (pun intended) by demonstrating that, depending on when your conditional is executed, you could end up executing more code than you expect (that's overly simplifying it).

In the graphic, the Roadrunner example is he evaluates his conditional BEFORE executing commands. The coyote on the other hand executes THEN checks the conditional evaluation, which may have returned a FALSE (meaning it should NOT have run).
I know, that's why I asked, since the coyote is going to end up crashing into the ground below. lol