関数:math.abs(x) |
-- mathabs.lua
-- 数値の絶対値を返します。
while not Keys.newPress.Start do
Controls.read()
startDrawing()
screen.print(SCREEN_UP, 0, 0, "Press START to quit")
screen.print(SCREEN_DOWN, 0, 0, "math.abs(-12) = " .. math.abs(-12))
screen.print(SCREEN_DOWN, 0, 8, "math.abs(34) = " .. math.abs(34))
screen.print(SCREEN_DOWN, 0,16, "math.abs(0) = " .. math.abs(0))
stopDrawing()
end