palokgolo
→ max()Returns the largest of the numbers it is given.
palokgolo(palo0, palo1)palokgolo(3, 9) is 9. You may give it more than two numbers: palokgolo(3, 9, 4, 12) is 12.
You may also give a single list instead of separate numbers: palokgolo(dibogolo) returns the largest number in the list.
One common use: palokgolo(palo, 0) stops a number falling below 0 — a single limit. When you want both limits, thibela is the right one.
The name joins palo (number) and kgolo (big). The word bogolo is deliberately left free so it can go on being a learner variable name in sketches.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
palo0 | palo | The first number to compare. A list of numbers may be given instead. |
palo1 (optional) | palo | The second number to compare. Further numbers may follow. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(240);
tlogelaMothalo();
paloKeleloPeo(5);
gopheta (diri x = 0; x < 400; x = x + 6) {
metlha kelelo = paloKelelo(x * 0.01);
diri bogodimo = lekanyetsa(kelelo, 0, 1, -40, 200);
// Le fa kelelo e le kwa tlase, mothalo o sala o bonala
bogodimo = palokgolo(bogodimo, 20);
tlatsaMmala(70, 130 + bogodimo / 3, 210);
thalaKhutlonne(x, 340 - bogodimo, 4, bogodimo);
}
}tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(22, 26, 36);
tlogelaMothalo();
metlha dibogolo = [46, 120, 78, 155, 92];
metlha eKgolo = palokgolo(dibogolo);
metlha ePotlana = palopotlana(dibogolo);
kwala(eKgolo);
kwala(ePotlana);
gopheta (diri i = 0; i < 5; i = i + 1) {
metlha b = dibogolo[i];
// E kgolo e bonala ka mmala o mongwe
fa (b === eKgolo) {
tlatsaMmala(250, 190, 70);
} gongwe {
tlatsaMmala(70, 120, 190);
}
thalaKhutlonne(50 + i * 66, 340 - b, 40, b);
}
}