Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local nouns = {
- "Apple",
- "Car",
- "Object",
- "Raindrop",
- "Flyer",
- "Core",
- "Generator",
- "Ship",
- "Damage",
- "Space",
- "Article",
- "Secret"
- }
- local verbs = {
- infinitive = {
- "Retract",
- "Run",
- "Leap",
- "Jump",
- "Walk",
- "Glide",
- "Strafe",
- "Eat",
- "Poop",
- "Explode",
- "Die",
- "Open"
- },
- action = {
- "Ran",
- "Walked",
- "Screamed",
- "Fell",
- "Ate",
- "Peed",
- "Flew",
- "Dried",
- "Created",
- "Jumped",
- "Slammed",
- "Struck"
- }
- }
- local adjectives = {
- "Vile",
- "Awesome",
- "Sweet",
- "Gross",
- "Deadly",
- "Wondrous",
- "Depressing",
- "Exciting",
- "Inciteful",
- "Ingenious",
- "Apathetic",
- "Fascinating"
- }
- local sentences = {
- "One day, #{protagonist} #{averb}, and #{averb} a #{adjective}y #{noun}.",
- "Suddenly, #{antagonist} #{averb}.",
- "\"#{noun}s!\" #{protagonist} #{averb}.",
- "Then, #{antagonist} #{averb} #{neutral}, a #{adjective} #{noun}!",
- "Finally, #{protagonist} #{averb} the #{adjective} #{antagonist}, resulting in the #{averb} of many #{noun}s.",
- "#{neutral} didn't want any #{noun}s because they were #{adjective}.",
- "#{neutral} wanted to #{iverb}, yet he was #{adjective}.",
- "#{protagonist} decided to #{iverb}.",
- "Shockingly, #{antagonist} began to #{iverb}!",
- "#{adjective}ly, #{protagonist} #{averb} #{neutral}.",
- "After this, #{protagonist} #{averb} #{neutral}'s #{noun}, even though he really wanted to #{iverb}."
- }
- local story = {
- protagonist = "",
- gSecondary1 = "",
- gSecondary2 = "",
- gSecondary3 = "",
- antagonist = "",
- bSecondary1 = "",
- bSecondary2 = "",
- bSecondary3 = "",
- neutralMain = "",
- nSecondary1 = "",
- nSecondary2 = "",
- nSecondary3 = "",
- goalObject = "",
- setting = ""
- }
- local vowels = {"a", "e", "i", "o", "u"}
- local consonants = {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"}
- function GetRandomName()
- local name = ""
- local switch = math.random(0, 1)
- for i = 1, math.random(3, 8) do
- if i%2 == switch then
- name = name .. vowels[math.random(1, #vowels)]
- else
- name = name .. consonants[math.random(1, #consonants)]
- end
- if i == 1 then
- name = string.upper(name)
- end
- --print(name)
- end
- return name
- end
- function GenerateCharacters()
- story.protagonist = GetRandomName()
- story.antagonist = GetRandomName()
- story.neutralMain = GetRandomName()
- end
- function GenerateSentence()
- local refrence = sentences[math.random(1, #sentences)]
- local sentence = ""
- while #refrence > 0 do
- local _, en = refrence:find("^[^#]+")
- if en then
- sentence = sentence .. refrence:sub(1, en)
- refrence = refrence:sub(en+2)
- else
- refrence = refrence:sub(2)
- end
- if refrence:find("^%{.-%}") then
- local _, en, type = refrence:find("^%{(.-)%}")
- if type == "noun" then
- sentence = sentence .. string.lower(nouns[math.random(1, #nouns)])
- elseif type == "averb" then
- sentence = sentence .. string.lower(verbs.action[math.random(1, #verbs.action)])
- elseif type == "iverb" then
- sentence = sentence .. string.lower(verbs.infinitive[math.random(1, #verbs.action)])
- elseif type == "adjective" then
- sentence = sentence .. string.lower(adjectives[math.random(1, #adjectives)])
- elseif type == "protagonist" then
- sentence = sentence .. story.protagonist
- elseif type == "antagonist" then
- sentence = sentence .. story.antagonist
- elseif type == "neutral" then
- sentence = sentence .. story.neutralMain
- end
- refrence = refrence:sub(en+1)
- end
- end
- return sentence
- end
- function GenerateParagraph()
- local paragraph = "\t"
- local focus = math.random(1, 3)
- for i = 1, math.random(3, 5) do
- paragraph = paragraph .. GenerateSentence() .. "\n"
- end
- return paragraph
- end
- function GenerateStory()
- local story = ""
- for i = 1, math.random(3, 5) do
- story = story .. GenerateParagraph() .. "\n"
- end
- return story
- end
- GenerateCharacters()
- local story = GenerateStory()
- local oFile = fs.open("output", "w")
- oFile.write(story)
- oFile.close()
- shell.run("edit output")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement