-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Random Numbers
-- SUBMITTED BY: Charlie
white = Color.new(255,255,255)
oldpad = Controls.read()
RanNumber = 0 -- will store our random number
math.randomseed(os.time()) -- prevents same random numbers each run
while true do
pad = Controls.read()
screen:clear()
screen:print(10,10, "Random number is: " .. RanNumber, white)
if pad:cross() and oldpad:cross() ~= pad:cross() then
RanNumber = math.random(1,100) -- get random number between 1 and 100
end
screen.flip()
screen.waitVblankStart()
oldpad = pad
end