Skip to content
ExamplesOpen editor ↗

thalaSekwere

→ square()

Draws a square — a four-sided shape whose sides are all equal.

thalaSekwere(x, y, letlhakore)

By default the first two numbers are the x and y of the top-left corner, and the third is the length of one side. All four sides are equal and every angle is 90°.

It is thalaKhutlonne with the width and height the same — except you write one number instead of two.

The last four numbers round the corners, one each, starting at the top-left and moving clockwise.

Watch out for seeloSaKhutlonne(DIKHUTLO). That mode is meant for thalaKhutlonne alone, but what actually happens is worse: the square still uses it. thalaSekwere(10, 20, 30) under DIKHUTLO draws a 20 × 10 rectangle — not a square at all. If you want a square, leave seeloSaKhutlonne at its default.

NameTypeDescription
xpaloTop-left x coordinate.
ypaloTop-left y coordinate.
letlhakorepaloLength of one side. All four sides are the same.
One square
tiro setaLoeto() {
  thalaKanefase(400, 400);
  bokamorago(240);
  tlatsaMmala(90, 170, 230);
  thalaSekwere(120, 120, 160);
}
A skyline built from squares and paloEpe
tiro setaLoeto() {
  thalaKanefase(400, 400);
  paloEpePeo(7);
  bokamorago(28, 32, 58);
  tlogelaMothalo();

  // matlo: kholomo nngwe le nngwe ke mokgatlho wa disekwere tse di bewang mo godimo ga tse dingwe
  gopheta (diri x = 20; x < 380; x = x + 44) {
    metlha bogolo = atametsa(paloEpe(28, 44));
    metlha maemo = atametsa(paloEpe(2, 6));

    gopheta (diri i = 0; i < maemo; i = i + 1) {
      metlha y = 360 - (i + 1) * bogolo;
      tlatsaMmala(60 + i * 18, 70 + i * 14, 110 + i * 12);
      thalaSekwere(x, y, bogolo);

      // difensetere
      tlatsaMmala(250, 220, 130);
      thalaSekwere(x + bogolo * 0.3, y + bogolo * 0.3, bogolo * 0.22);
    }
  }
}

thalaKhutlonne, seeloSaKhutlonne, thalaTlhakorenne