これは、[[repeat文]]によりテキストの書式を一行書いて、それを5回繰り返すサンプルです。 [[for文]]、[[while文]]との使い分けは、不明です。 |構文|repeat ~ until 条件式 の形|条件式が真となるまで繰り返す| #highlight(){{ ------------------------------------------ -- repeat(Luarida)のサンプル repeat_sample.lua ------------------------------------------ function main() canvas.drawCls(color(255,255,255)) canvas.drawText("repeat(Luarida)のサンプル", 0, 0, 24, color(0,0,0)) canvas.drawText("画面タッチで開始します。", 0, 30, 24, color(0,0,0)) touch(3) i=0 repeat canvas.drawText(i, 0, 30 * i + 80, 24, color(0,0,0)) i = i + 1 until i > 5 canvas.drawText("画面タッチで終了します。", 0, 270, 24, color(0,0,0)) touch(3) end main() }} ---- [[コメント]](最大30行) #comment_num2(title_msg=コメント,vsize=2,num=10) ----