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.
Syntax
Section titled “Syntax”paloYaLetshwao(boleng)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
boleng | mokwalo | A single character. A list of characters is also accepted. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(220);
tlogelaMothalo();
diri nomoro = paloYaLetshwao("A");
kwala(nomoro);
tlatsaMmala(nomoro, 100, 200);
kgolokwe(200, 200, nomoro * 2);
}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;
}
}