tsela
→ caseMarks a branch inside `tlhopha` that runs when the value matches.
tsela boleng: ... kgaola;A tsela branch carries its value after the keyword, followed by a colon (:). When the tlhopha value equals it, execution starts there and runs on until it reaches kgaola or the end of the tlhopha. Two or more branches can share one body by stacking them with no kgaola between — the accepted way to give several values the same treatment.
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 200);
bokamorago(220);
gopheta (diri i = 0; i < 4; i = i + 1) {
tlhopha (i) {
tsela 0:
tlatsaMmala(220, 60, 60);
kgaola;
tsela 1:
tlatsaMmala(60, 180, 90);
kgaola;
tsela 2:
tlatsaMmala(60, 110, 220);
kgaola;
tlwaelo:
tlatsaMmala(150);
}
thalaKhutlonne(i * 96 + 26, 60, 72, 72);
}
}tiro setaLoeto() {
thalaKanefase(400, 200);
bokamorago(220);
gopheta (diri i = 0; i < 4; i = i + 1) {
tlhopha (i) {
tsela 0:
tsela 2:
tlatsaMmala(0, 150, 190);
kgaola;
tlwaelo:
tlatsaMmala(230, 170, 40);
}
thalaSediko(i * 96 + 62, 100, 66);
}
}