Skip to content

paloYaLetshwao

Returns the character-code number of a single character.

This is the function that reverses letshwao: paloYaLetshwao("A") is 65, and letshwao(65) is "A" again.

It accepts a single character only. Given a list of characters, it returns a list of numbers.

The name reads as "the number of the character", because a number is what it hands back — not a character.

paloYaLetshwao(boleng)
NameTypeDescription
bolengmokwaloA single character. A list of characters is also accepted.
The code for "A" drives the size
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(220);
  tlogelaMothalo();

  diri nomoro = paloYaLetshwao("A");
  kwala(nomoro);

  tlatsaMmala(nomoro, 100, 200);
  kgolokwe(200, 200, nomoro * 2);
}
Letters become circles of different sizes
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(220);
  tlogelaMothalo();

  diri ditlhaka = ["B", "O", "P", "A"];
  diri dinomoro = paloYaLetshwao(ditlhaka);

  kwala(dinomoro);

  diri x = 70;
  gopheta (metlha nomoro mo dinomoro) {
    tlatsaMmala(0, nomoro, 200);
    kgolokwe(x, 200, nomoro - 10);
    x = x + 90;
  }
}

letshwao, paloYaHeksa, palotlalo