Langsung ke konten

ungu (while alternative)

Konten ini belum tersedia dalam bahasa Anda.

The untu keyword is an alternative way to start a while loop in SamaLang. It functions identically to selama. It is equivalent to while in standard Lua.

Keyword untu adalah cara alternatif untuk memulai perulangan while dalam SamaLang. Berfungsi sama seperti selama. Setara dengan while di Lua.

Terminal window
untu condition boat
-- code
jure_mo
Terminal window
ada i = 1
untu i <= 5 boat
tulis("Iterasi " .. tostring(i))
i = i + 1
jure_mo
Terminal window
ada buah = {"apel", "mangga", "jeruk"}
ada index = 1
untu index <= #buah boat
tulis("Buah ke-" .. tostring(index) .. ": " .. buah[index])
index = index + 1
jure_mo