pave road to castle

Discussion in 'C++' started by sherif, Dec 28, 2014.

  1. sherif

    sherif New Member

    Joined:
    Dec 28, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    ok so now i need to write C++ function called paver enemies where
    all enemies can approach to the castle 1 meter every time step only if next meter is paved.
    there are 2 type of enemies 1- normal who hit castle 2-paver whose job to pave road for 1 to hit castle.
    the last 30 meter before castle are not paved and only paver enemies can enter and paved it so 1 can enter paved distance in next time step.
    any help would be appreciated thanks
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    I have no idea what you are talking about. Is this the question as it was given to you, or is it your interpretation of the question? If the latter, please post the original question without any editing. Also please post an example of the input you might give the function and the output you might expect, explaining why that output would be expected.

    On the face of it it appears extremely trivial:

    for M=30 to 1
    paver advance to M+1 and pave M
    everyone advance to M now that it's paved
    end loop
    now everyone is at the castle they can hit it.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice