HELP PLEASE for anyone who knows C++

Discussion in 'Rants, Musings and Ideas' started by Darker Than Black, Jan 25, 2009.

  1. Darker Than Black

    Darker Than Black Well-Known Member

    I can't get this right, for anybody who know C++. I'm doing this soln code for Karel the robot. So basically he is in a hallway, and want to get to a window but not jump through, just stop and face the window. I don't know how to start this solution.

    heres what i have right now, which does not look right at all..:(

    void task()
    {
    goToWall();
    loop (5)
    {
    if (!northIsClear())
    {
    faceEast();
    if (!eastIsClear())
    {
    faceSouth();
    if (!westIsClear())
    {
    faceSouth();
    if (!southIsClear())
    {
    faceNorth();
    }
    else
    {
    if (frontIsClear())
    {
    move();
    }
    }
    }
    }
    }
    }
    }

    and there is like 10 different worlds for him to be tested in and on solution code for all 10 worlds.


    If I don't get this, then I'm gonna start crying again, or get more sad or start cutting myself, I flip out when I dont get something..I feel angry..:mad:..I'm so dumb :(
     
  2. Darker Than Black

    Darker Than Black Well-Known Member

    nvm i got it