Jump to content

Pseudo Code help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
mictamcody2000

mictamcody2000

    Newbie

  • Members
  • Pip
  • 2 posts
I really need some help on this, it's some homework and it's due tomorrow, here's what I need changed (I don't mind if you do it for me:P...but i also want to learn more about it after I turn the assignment in.):

This is what I need changed into Psuedo code.

MAIN:

SWW_CORNER

GO_XY

UP

SWW_CORNER

DOWN

SEE_CORNER

GO_XY

UP

SEE_CORNER

DOWN

NWN_CORNER

GO_XY

UP

NWN_CORNER

DOWN

NEE_CORNER

GO_XY

UP

NEE_CORNER

DOWN

NWN_CORNER

UP

NEE_CORNER

LOOP XPOS > 6

WEST

DOWN

SWW_CORNER

UP

NEE_CORNER

LOOP XPOS > 5

WEST

DOWN

SEE_CORNER

UP

NEE_CORNER

LOOP XPOS > 4

WEST

DOWN

SWW_CORNER


GO_XY:

FIND

LOOP XPOS < X

EAST

LOOP XPOS > X

WEST

LOOP YPOS < Y

NORTH

LOOP YPOS > Y

SOUTH


SW_CORNER:

LOOP XPOS < 3

EAST

LOOP YPOS < 3

NORTH


SWW_CORNER:

LOOP XPOS > 0

WEST

LOOP YPOS > 0

SOUTH


SE_CORNER:

LOOP XPOS > 7

EAST

LOOP YPOS > 3

SOUTH


SEE_CORNER:

LOOP XPOS < 7

EAST

LOOP YPOS > 0

SOUTH


NW_CORNER:

LOOP XPOS > 3

WEST

LOOP YPOS < 4

NORTH


NWN_CORNER:

LOOP XPOS > 0

WEST

LOOP YPOS < 7

NORTH


NE_CORNER:

LOOP XPOS < 4

EAST

LOOP YPOS < 4

NORTH


NEE_CORNER:

LOOP XPOS < 7

EAST

LOOP YPOS < 7

NORTH 


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I have no idea what that code is trying to do. It looks like it's some sort of coordinate motion program, but a few more details of what you're trying to do would help.

In particular, you clearly have functions, and commands like
LOOP (condition)
(direction to move)
would represent
while (condition)
move (direction)

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
mictamcody2000

mictamcody2000

    Newbie

  • Members
  • Pip
  • 2 posts
Yeah, it's meant for a robot simulater kind of thing, to move the smiley face to the apples then move the apples to the corner.

Thanks for that help though :).