-- Simple Random Sentence Generator v 0.1 -> v 0.2 -> v 0.3
-- Programming, graphics, and design: Psyberjock
-- Idea: Psyberjock and Noble
-- Homework Excuse Generator Idea: Buddy4point0
-- Sources: lua.org, engrish.com (for vocabulary ideas), luaplayer.org, and EvilMana's tuts.
--          Thanks guys!! Couldn't have done it so quickly without you! 
--
-- The original idea for this program is a simple random Engrish generator.
-- While making the program I realized that it could be expanded to do far more.
-- See the included Readme.txt for a change log.
-- 
-- I plan on making these expansions in the future, but feel free to use any of this code as you wish.
-- It's as free as can be.
--
-- If you'd like to mod this to do different languages or other crazy sentences, let me give some hints
-- on producing consistently interesting sentences. Patterns are very important and describing your word
-- categories is perhaps the only more important things. Luckily for me, I have a degree in linguistics.
-- Knowing how language is used and which words fall into which categories is very important.
-- Still, the nature of Engrish randomness prevents perfectly interesting sentences every time, so don't worry too
-- much if you crank out some useless sentences as well.
--
-- Oh, I know my code is a mess. I tried to organize it while writing it, but somethings just
-- piled up. I hope I have at least documented it well enough.


green = Color.new(0, 255, 0)
blue = Color.new(0, 0, 255)
red = Color.new(255, 0, 0)
grey = Color.new(200, 200, 200)
title = Image.load("srsgtitle.png")
mainback = Image.load("srsgmain.png")
oldmenupad = Controls.read()




-- Function for my main screen display.
function catmain()
screen:blit(0,0,mainback)
screen:print(140, 170, "", green)
screen:print(140, 180, "<triangle> Engrish", green)
screen:print(140, 190, "<square> Chuck Norris Facts", green)
screen:print(140, 200, "<circle> Homework Excuses", green)
screen:print(140, 210, "", blue)
screen:print(140, 220, "<cross> Return to This Menu", red)
screen:print(140, 230, "<menu> Exit SRSG.", red)
screen:print(140, 240, "", red)
end


screen:clear()
screen:blit(0,0,title)
screen:print(118, 235, "Press <start> to Continue...", green)
screen.flip()


while true do
screen.waitVblankStart()
pressstart = Controls.read()
if pressstart:start() then
break
end
end




while true do

screen:clear()
catmain()
screen:print(100,65, "Please choose a category...", green)
screen.flip()

menupad = Controls.read()



if menupad:triangle() and oldmenupad:triangle() ~= menupad:triangle() then
dofile("./engrish.lua")
end


if menupad:square() and oldmenupad:square() ~= menupad:square() then
dofile("./norris.lua")
end

if menupad:circle() and oldmenupad:circle() ~= menupad:circle() then
dofile("./homework.lua")
end

screen.waitVblankStart()
oldmenupad = menupad

-- The end
end