Help me and I'll make you rich.

My idea:

int world [][]={ {1,1,1,1,1},
{1,0,0,F,1},
{1,M,0,0,1},
{1,0,0,P,1},
{1,1,1,1,1} }

Where 1 = boundary (can't walk thru)
0 = paths (can walk thru)
P = person
M = money
F = food

main = person walks to money and puts in pocket. Person then walks to food.

I'm certain when I understand what this looks like in C++, I'll be soon to rule the world.

P.S. How do I make my posts look like code like the rest of you?


Use the code tags under format its the picture of <>

1
2
3
4
5
int world [][]={ {1,1,1,1,1},
{1,0,0,F,1},
{1,M,0,0,1},
{1,0,0,P,1},
{1,1,1,1,1} }
Test:

1
2
3
4
5
int world [][]={ {1,1,1,1,1},
{1,0,0,F,1},
{1,M,0,0,1},
{1,0,0,P,1},
{1,1,1,1,1} }
That was easy.

Thanks.
Topic archived. No new replies allowed.