Ask Experts Questions for FREE Help !
Ask
    Drei0614's Avatar
    Drei0614 Posts: 1, Reputation: 1
    New Member
     
    #1

    May 12, 2015, 12:28 PM
    Coloring map
    I am doing the map program use stack. I set the color in the working stack as white(0), and other four colors in valid(1-4). However, when I run the program, it doesn't actually color the map. Could someone help to find my mistake?

    public void go(){
    Integer counter = 0;
    Integer backup = 0;
    while(!Working.empty()){
    // work on the item at the top of the working stack
    NodeInfo Current = Working.peek();

    // Insert this statement every time you change the color of a map node
    M.displayElement(Current.getName(), C[Current.getColor()], frame);

    if(Current.getColor()>4){ // out from rank, use color other than white, red, yellow, green and blue
    Current.setColor(0); // set color back to white
    Working.push(Valid.pop()); //push back from Valid to Working
    }
    else{
    Current.setColor(Current.getColor()+1); // set a new color if it doesn't run out rank 1-4
    Valid.push(Working.pop()); //push from Working to Valid
    }
    }
    /*Move items from one stack to the other with statements like
    *
    * Working.push(Valid.pop());
    * and
    * Valid.push(Working.pop());
    *
    */
    }

Check out some similar questions!

Take coloring out [ 0 Answers ]

I want to remove the dark brown from my hair and replace it with a light brown. What do I need?

What is the difference between a vicinty map and a location map [ 2 Answers ]

Is there a difference between a vicinty map and a location map

Google map? [ 16 Answers ]

Hi, I will be driving from West Coast of Canada to the East coast of USA. Where can I get accurate directions for my travels? How accurate is Google map for international travel directions?

Coloring ? [ 3 Answers ]

Well I'm going to be dying my hair to different colors here real soon, underneath is where I need help, OK I already got the color picked out but I just don't know how I'm supposed to part my hair to make it look right =/. I've seen some sites that say to just pull your hair back and just drop out...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.