Results 1 to 5 of 5

Thread: Logic Question Help

  1. #1

    Thread Starter
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Question Logic Question Help

    OK, before you think it is homework - it is of course not, although the title of this thread may be misleading.

    Actually, let me explain :
    In my Introduction to programming questionaire, I've always had this :
    8. Scenario: (30)
    It is the year 2010. It is your birthday and one of your presents is a brand new
    programmable robot assistant. It can do everything you instruct it do. You can even
    learn it to do tasks comprising of a number of instructions. The first task you have
    decided to teach it is to fetch mail.

    The following are objects, which it knows, either by factory programming or through
    pictures you programmed into its memory:

    Hand
    Couch
    Table
    Front door
    Door handle
    Front gate
    Mailbox
    Mailbox door
    Mail

    Your robot can automatically determine whether an object (like a door) is open or closed.
    It is however up to you to test this in the tasks you give it.

    To ensure that your robot is always safe and close by, you have decided to let it sit on the
    couch whenever inactive. Thus you have to start every task from this position.
    Remember also to always bring your robot back to this position when a task is finished.

    Your robot is programmed to use its right hand as default. If you want to do something
    with its left, you must specify “left hand”.

    Your robot understands the following commands:
    SIT DOWN / STAND UP
    WALK TO [object]
    PUT HAND ON [object]
    TAKE HAND OFF [object]
    PUSH UP/DOWN
    OPEN/CLOSE [object]
    MOVE INSIDE/OUTSIDE

    Your robot has only one flow statement, which you can use in the commands you give it:
    IF [condition] THEN
    {statements}
    END IF
    For your robot to fetch the mail, it must pass the front door, go out at the front gate to
    the mailbox, fetch the mail and put it on the table. The front door is usually left open
    for fresh air in the house, but it sometimes shuts due to strong wind. For safety reasons
    and to keep the dog from running into the street where it can be run over by cars, the
    front gate must be closed every time a person or your robot enters or exits.

    Write an algorithm for the robot to fetch the mail. Start your algorithm with “task fetch
    mail” and end it with “end task”
    The purpose of this question is to "make" the student think logically about a scenario, and make use of limited instructions and tools to get the job done.

    Now, seeing the fact that this question has been around for a while, I'd like to add another similar question ( just to reduce chances of students cheating )

    Can anyone think of an idea I could use as a question for the students ¿
    Sadly, I haven't had much time to put much thought into it, but that's a completely differnt story

    Any help would be greatly appreciated.
    VB.NET MVP 2008 - Present

  2. #2
    New Member
    Join Date
    Dec 2007
    Posts
    3

    Re: Logic Question Help

    after looking ur scenario from so many angles i have find out that this scenario is missing something...mmmm, may be u have forget a command that will "GRAB" mail from mailbox or maybe i have missunderstood this scenario, if that is the case i should stop immediatly writing programe codes.

    Regards
    Rizwan

  3. #3
    New Member
    Join Date
    Dec 2007
    Posts
    3

    Re: Logic Question Help[Forgive me if i wrote the wrong code]

    Task fetch Mail

    STAND UP
    WALK TO [Front Door]
    if OPEN [front Door] then

    MOVE OUTSIDE
    WALK TO [Mailbox]
    PUT HAND ON [Mailbox Door]
    PUSH UP
    OPEN [Mailbox Door]
    left hand
    else

    TAKE HAND ON [Door handle]
    OPEN [Door]
    TAKE HAND OFF [Door handle]
    MOVE OUTSIDE
    WALK TO [Mailbox]
    PUT HAND ON [Mailbox Door]
    PUSH UP
    OPEN [Mailbox Door]
    left hand
    ENDIF


    '''Lets suppose robot knows how to grab/collect maill
    if SO then

    ''' New Command MOVEIN/OUT that i beleive should be there
    MOVEIN PART [hand]
    OPEN [hand]
    PUT HAND ON [Mail]
    CLOSE [hand]
    MOVEOUT PART [hand]
    right hand
    PUSH DOWN [Mailbox handle]
    CLOSE [Mailbox Door]
    MOVE INSIDE
    WALK TO [Front Door]
    CLOSE [Front Door]
    WALK TO [Table]
    left hand
    PUT HAND ON [Table]
    OPEN [hand]
    PUT HAND OFF [Mail]
    PUT HAND OFF [Table]
    WALK TO [Couch]
    right hand
    SIT DOWN
    endif


    end task
    Last edited by s_rizwanahmed; Dec 10th, 2007 at 04:09 AM. Reason: twice time same command executed!!! sorry

  4. #4

    Thread Starter
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: Logic Question Help[Forgive me if i wrote the wrong code]

    Well you could've had something like this :
    Put hand on mail
    Open hand
    Close hand.

    Thanks. But this is not the object of discussion. I am looking for another similar question to the above one, so that I can switch between the different exams
    VB.NET MVP 2008 - Present

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Logic Question Help

    You've really limitted yourself because there are only a handful of nouns in the current list. Mail, Mailbox, door, and gate, are about all you have. The couch doesn't count because it is a constant starting and ending point. Furthermore, only the mail is actually moveable.

    You need something else moveable on the list. Perhaps the cat...no, that would be impossible for a robot to catch without a dart gun. Perhaps bird seed and a bird feeder. Whatever the solution, you have tied yourself to one moveable object. The only other options would be to put that moveable object elsewhere, or do something like checking whether the door or gate is in a certain state, and responding by ending up in a different location. Neither of those is all that desirable, so you really need to add something else that can be fetched or moved.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width