/
fancynoun.lua
31 lines (31 loc) · 988 Bytes
/
fancynoun.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "ornatenoun"
require "preposition"
require "relpronoun"
require "verb"
function fancynoun()
-- math.randomseed(os.clock()*os.time())
math.random()
returnstring = ornatenoun()
verbchance = 10
prepchance = 10
donechance = 30
r = math.random(verbchance+prepchance+donechance)
-- print(r)
--if r is small, that's it.
if r>donechance and r<donechance+prepchance then
-- preposition branch
returnstring = returnstring.." "..preposition().." "..fancynoun()
elseif r>donechance+prepchance then
-- verb phrase branch
returnstring = returnstring.." "..relpronoun()
r = math.random(2)
if r==1 then
-- ornate does a thing
returnstring = returnstring.." "..verb().." "..fancynoun()
elseif r==2 then
-- ornate has had a thing happen to it
returnstring = returnstring.." "..fancynoun().." "..verb()
end
end
return returnstring
end