Hello, I am not sure how to interpret this question from my programmingproblem s
ID: 3617670 • Letter: H
Question
Hello,I am not sure how to interpret this question from my programmingproblem set:
"This problem is inspired by the discussion on the verification ofWHILE loops. Simulate Karel Robot's execution of the followinginstruction (below) in initial situations where the robot is on acorner with 0, 1, 2, 3, and 7 beepers."
DEFINE-NEW-INSTRUCTION will-this-clear-corner-of-beepers AS
BEGIN
ITERATE 10 TIMES
IFnext-to-a-beeper THEN
pickbeeper
END;
First of all, I don't understand why situations is plural--aren'tthey just saying there are 0+1+2+3+7= 13 total beepers at thecorner Karel is on, initially (every single time)? I have anotherpossible interpretation in mind, but I'd rather see what otherpeople say first.
But the first conclusion I stated doesn't make sense because the2nd part of the prompt asks:
"State in exactly which initial situations this instruction workscorrectly. What happens in the other situations?"
I would really like other people's interpretation of this question.Thanks!
Explanation / Answer
tkx