Advertisement

Story Time! Program your stories here...

Started by March 12, 2014 05:47 PM
18 comments, last by OandO 10 years, 10 months ago

This story was written in LUA. I have to check my syntax (grammar) and logic.


--Joseph was hungry, so he decided to go to the store to get some food. 
 
joey = newPerson("Joseph")
 
if joey.hungry then 
    GoToStore()
    GetSomeFood()
end
 
--However, when Joseph got to the store it was closed. This made Joseph really upset! So he pouted all the way home.
 
store = newBuilding()
 
if store.closed then
    joey.upset = true
    PoutAllTheWayHome()
elseif store.open then
    joey.upset = false
    GetSomeFood()
    BeContent()
end
 
--When Joseph got home, he went to the fridge and peered in. 
 
home = newBuilding()
fridge = newObject()
 
if joey.isHome then
    GoToFridge()
    PeerIn()
end
 
--He saw some flour and some water. So he decided to make bread.
 
flour = newObject()
water = newObject()
 
if flour.seen and water.seen then
MakeBread()
    elseif not flour.seen and not water.seen then
    LookLikeASadPuppy()
end
 
--He had to mix the flour and water for 30 minutes. Then he had to knead it for 45 minutes. He had to let it rise three times, 20 minutes each time.
 
for m=0,30 do
    Mix(flour,bread)
    m= m +1 
end
 
for k =0, 45 do
    Knead(flour,bread)
    k = k +1

end
 
for r =0,3 do
    for k=0, 20 do
        LetRise(flour,water)
        k = k +1
    end
    r = r +1
end
 
--He then had to let the bread bake for about 2 hours
 
for t =0, 120 do
    Bake(bread)
    t = t+1
end
 
--Joey could finally eat!
joey.EatTheBread()
joey.happy = true
 
End()

Your turn! Make it Legible.

They call me the Tutorial Doctor.

no comments in code allowed

Advertisement

Life life = new Life("My Name");

life.liveLife();

life.getOld();

life = null;

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson


if (code.quote(true))
{
code.scary(true);
}

Lua looks really good and your code needs no explanation. Really clear.

UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32

--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

If you just mix flour and water you will get glue, not bread, lol. Need some yeast if you want it to rise! Most breads also contain at least one of eggs, sugar, and/or milk.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

Wait, if you are adding eggs, sugar, and milk with flour and water....are we making a cake?

Advertisement

[source]

post_message = "

[source]

post_message = \"%s\";

alnite = new User();

host = new Host(\"www.gamedev.net\");

for (Topic t : host.topics) {

if (t.id == 654373) {

alnite.postf(t, post_message, post_message);

break;

}

}

[/source]";

alnite = new User();

host = new Host("www.gamedev.net");

for (Topic t : host.topics) {

if (t.id == 654373) {

alnite.postf(t, post_message, post_message);

break;

}

}

[/source]

Does that count as a quine?

Wait, if you are adding eggs, sugar, and milk with flour and water....are we making a cake?

mmm ... caek

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

If you just mix flour and water you will get glue, not bread, lol.

hahaha! good point.

joey.isSick = true

They call me the Tutorial Doctor.

If you just mix flour and water you will get glue, not bread, lol.

Flat bread, known as "unleavened bread" .

my-matzoh.jpg

I cannot remember the books I've read any more than the meals I have eaten; even so, they have made me.

~ Ralph Waldo Emerson

This topic is closed to new replies.

Advertisement