C2LC-603: A loop with 0 iterations is executed once, rather than being skipped

Metadata

Source
C2LC-603
Type
Bug
Priority
N/A
Status
Done
Resolution
N/A
Assignee
N/A
Reporter
Michelle D'Souza
Created
2022-02-24T09:17:23.479-0500
Updated
2022-03-11T10:57:02.550-0500
Versions
N/A
Fixed Versions
  1. Coding Env 1.3
Component
  1. Coding Environment

Description

Example program: https://develop-1-2--c2lc-build.netlify.app/?v=1.2&t=default&w=Sketchpad&p=sA0s1z&c=aab&d=

Expected:

  • Loop to be skipped and no movement to happen

Actual:

  • Loop is executed once

Options:

  • Fix: Update the ‘startLoop` handling in the Interpreter to jump to the end of the loop if the iterations left is 0
  • Or, as a workaround, only enable the user to enter 1-99 iterations and don’t allow 0

Comments

  • Michelle D'Souza commented 2022-03-03T10:49:52.943-0500

    Based on co-design outcomes, loop counters should begin at 1 and not allow 0.