Go Back   3D Realms Forums > Blogs > Samji
Blogs FAQ Members List Social Groups Calendar Mark Forums Read

Notices

Rate this Entry

Loops in DSLua

Submit "Loops in DSLua" to Digg Submit "Loops in DSLua" to del.icio.us Submit "Loops in DSLua" to StumbleUpon Submit "Loops in DSLua" to Google
Posted 02-18-2008 at 04:41 PM by Samji
Updated 02-18-2008 at 04:49 PM by Samji

I have been trying to write programs using loops to run on my Nintendo DS with DSLua.

Here is the first one. It just cycles through some fruit and puts in in a hypothetical basket.
I then want a drink for my efforts ... a nice banana smoothie

[code]
SCREEN_TOP = 1
SCREEN_BOTTOM = 0
BGTopText = Screen.LoadTextBG()
BGBotText = Screen.LoadTextBG()
Screen.Initialize(SCREEN_TOP, BGTopText)
Screen.Initialize(SCREEN_BOTTOM, BGBotText)

fruit = "apple,pear,banana,pineapple"
basket = {}
i = 1
for v in string.gmatch(fruit, "%w+") do
basket[i] = v
i = i + 1
end

message = basket[3] .. " smoothie?"
BGBotText:PrintXY(5, 12, message)
DSLua.WaitForAnyKey()
[/code]

Now I just have to test it.
Posted in Uncategorized
Views 6852 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -6. The time now is 03:03 PM.

Page generated in 0.08687091 seconds (100.00% PHP - 0% MySQL) with 24 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2023, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.