Skip to content
ExamplesOpen editor ↗

boemoJwaPoapoeletso

→ isLooping()

Returns `nnete` while the `tshwantsha` loop is running, and `maaka` when it is halted.

boemoJwaPoapoeletso()

Use boemoJwaPoapoeletso to read the loop’s state before making a decision — for example, changing a color, or halting only while it is running. It returns a boolean value, so use it inside fa, as in fa (boemoJwaPoapoeletso() === nnete).

A color that reports the loop state
tiro setaLoeto() {
  thalaKanefase(400, 400);
}
tiro tshwantsha() {
  bokamorago(220);
  fa (boemoJwaPoapoeletso() === nnete) {
    tlatsaMmala(0, 200, 0);
  } gongwe {
    tlatsaMmala(200, 0, 0);
  }
  thalaSediko(200, 200, 150);
}
Log the state as a growing circle halts
diri bogolo = 40;
tiro setaLoeto() {
  thalaKanefase(400, 400);
}
tiro tshwantsha() {
  bokamorago(220);
  tlatsaMmala(0, 100, 200);
  thalaSediko(200, 200, bogolo);
  bogolo = bogolo + 2;
  fa (bogolo > 200) {
    emisaPoapoeletso();
  }
  kwala(boemoJwaPoapoeletso());
}

emisaPoapoeletso, simololaPoapoeletso, tshwantshaGape, nnete