Hangarau

toaitanga

iteration (computing)

tūingoa

WHAKAMĀRAMA

Ko te mahinga kotahi o roto i te tāruaruatanga o tētahi koromeke waehere rorohiko.

A single instance from within the repetition of a computer code loop.

Tauira KŌrero

Me pēhea te whakawaehere i te toaitanga hei whiriwhiri i te tau mōrahi o tētahi huinga tau?

Whakamāramahia mai te toaitanga kotahi o roto i te waehere koromeke nei.

Ko te toaitanga tētahi tukanga matua ka whakamahia i roto i ngā papatono maha hei whakatutuki i tētahi mahi whāiti.

WhakamĀrama Āpitihanga

He tauira tēnei o te waehere koromeke hei tāpiri tāruarua i tētahi tau:

Hei whakamārama i te waehere nei:

KupumatuaTana Mahi
total = 0Hei whakaatu i te tapeke i te tīmatanga.
for count in range (4)Hei tohu i te maha o ngā toaitanga (i konei, ko te 4).
number = intHe tohutohu kia whakaurua tētahi tau.
total = total + numberHei tohutohu i te rorohiko kia tāpiria te tapeke o mua me te tau i whakaurua.
printHei tohutohu i te rorohiko kia whakaatu i te tapeke i muri i ēnei mahi.


Nō reira koia nei ngā toaitanga e whā e tohua ana e te waehere koromeke nei, mēnā ko te 3 te tau i whakaurua:

Tōaitanga Te MahiTe Tapeke
10+33
23+36
36+39
49+312


Nō reira, ko te tapeke ka whakaaturia i muri i te otinga o ngā toaitanga e whā e tohua ana e te waehere koromeke, ko te 12.

  

Takenga Mai

toai - to repeat, reiterate, restate

Tauira KŌrero

Me pēhea te whakawaehere i te toaitanga hei whiriwhiri i te tau mōrahi o tētahi huinga tau?

Whakamāramahia mai te toaitanga kotahi o roto i te waehere koromeke nei.

Ko te toaitanga tētahi tukanga matua ka whakamahia i roto i ngā papatono maha hei whakatutuki i tētahi mahi whāiti.

WhakamĀrama Āpitihanga