Skip to content

tulis (print)

The tulis keyword prints output to the console in SamaLang. It is equivalent to print in standard Lua.

Keyword tulis digunakan untuk mencetak output ke konsol dalam SamaLang. Setara dengan print di Lua.

Terminal window
tulis(value)
Terminal window
tulis("Halo, Dunia!")
-- Output: Halo, Dunia!
Terminal window
ada umur = 25
tulis(umur)
-- Output: 25
Terminal window
ada nama = "SamaLang"
ada versi = 2.0
tulis(nama, versi)
-- Output: SamaLang 2.0
Terminal window
ada nama = "Ahmad"
tulis("Halo, " .. nama .. "!")
-- Output: Halo, Ahmad!
Terminal window
ada aktif = true
tulis(aktif)
-- Output: true
Terminal window
ada buah = {"apel", "mangga", "jeruk"}
tulis("Jumlah buah: " .. tostring(#buah))
-- Output: Jumlah buah: 3