Skip to content
ExamplesOpen editor ↗

MOLEMA_MOTSWI

→ LEFT_ARROW

The value standing for the left arrow key.

MOLEMA_MOTSWI

You hand it to taetsiETshwerwe:

fa (taetsiETshwerwe(MOLEMA_MOTSWI)) { x = x - 3; }

You can also compare it against khoutuYaTaetsi: fa (khoutuYaTaetsi === MOLEMA_MOTSWI).

It is a string, not a number. MOLEMA_MOTSWI is 'ArrowLeft'. This is why Bopa has no numeric key-code keyword: comparing it against this value compares a number with a string, and is always maaka.

The four arrows translate and the other keys do not — and the reason is simple: a SHIFT key has the word Shift printed on it, while an arrow key has an arrow, not a word. An arrow is a thing, and the thing has a Setswana name. MOLEMA (LEFT) and MOTSWI (ARROW) are both already in Bopa, so no new word was needed.

Move a square to the left
diri x = 200;

tiro setaLoeto() {
  thalaKanefase(400, 200);
  tlhalosa('Sekwere se se sutang go ya ka molema fa taetsi ya motswi wa molema e tshwerwe. Tobetsa setshwantsho pele.');
}

tiro tshwantsha() {
  bokamorago(238);
  tlogelaMothalo();
  tlatsaMmala(200, 120, 90);

  fa (taetsiETshwerwe(MOLEMA_MOTSWI)) {
    x = thibela(x - 3, 20, 340);
  }

  thalaSekwere(x, 80, 40);
}

MOJA_MOTSWI, GODIMO_MOTSWI, TLASE_MOTSWI, taetsiETshwerwe, khoutuYaTaetsi