Create Random Text
you can add any other word to the tables.
-- speak
noun = {
"Dad",
"apple",
"the sky",
"book",
"Codea",
"iPad",
"desk",
"this App",
"Map",
"Lua",
"Mom",
"the button",
"duck",
"minecraft"
}
verb = {
"like",
"eat",
"punch",
"press",
"code with",
"program with",
"destroy",
"use",
"play on",
"say"
}
adjective = {
"awesome",
"delicious",
"fun",
"easy",
"smooth",
"hard",
"soft",
"nice",
"quick",
"slow",
"stupid"
}
-- Use this function to perform your initial setup
function setup()
parameter.action("Print Something!", function()
print(words)
end)
parameter.action("Say Something!", function()
speech.say(words)
end)
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
-- This sets the line thickness
strokeWidth(5)
-- Do your drawing here
write(math.random(1, 3))
end
function write(style)
if style == 1 then
myverb = verb[math.random(1, #verb)]
mynoun = noun[math.random(1, #noun)]
words = ("I "..myverb.." "..mynoun)
elseif style == 2 then
mynoun = noun[math.random(1, #noun)]
myadjective = adjective[math.random(1, #adjective)]
words = (string.sub(string.upper(mynoun), 1, 1)..string.sub(mynoun, 2, string.len(mynoun)).." is "..myadjective)
elseif style == 3 then
myverb = verb[math.random(1, #verb)]
mynoun = noun[math.random(1, #noun)]
myadjective = adjective[math.random(1, #adjective)]
words = ("I "..myverb.." "..mynoun.." because it is "..myadjective)
end
end