Consider the following example of a LightBot program written out in text. Again, in this case we have named our robot "andy". When would andy jump?
andy.move() andy.turnRight() andy.move() andy.jump()
There are no hints for this question
Consider the following example of a LightBot program written out in text. Again, in this case we have named our robot "andy". When would andy jump?
f1: andy.move() andy.turnRight() andy.move() main: run f1() run f1() andy.jump()
>The f1 method is run twice. This means andy would move, turn right, and move, then do it all over again
Consider the following example of a LightBot program written out in text. Again, in this case we have named our robot "andy". How many times would andy jump?
f1: andy.move() andy.turnRight() andy.move() f2: andy.jump() andy.jump() andy.jump() main: run f1() run f1() andy.jump()
>The f1 method is run twice, but f2 never gets called from the main and thus never runs in this code!