Thread: Logic Problem

  1. #16
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Not that this matters a great deal, but you only need to bitwise-and with 0xffffff in one place:
    Code:
    private void CheckSelectFirework(Point point)
    {
    	foreach(Firework firework in Fireworks)
    	{
    		if(PointOverRect(point.X,
    		                 point.Y, 
    		                 firework.X, 
    		                 firework.Y,
    		                 FireworkTypes[firework.Angle][firework.Colour].Width,
    		                 FireworkTypes[firework.Angle][firework.Colour].Height))
    		{					
    			foreach(Firework firework2 in Fireworks)
    			{
    				if(((LastColorSelected & firework.Colour.ToArgb()) & 0xffffff) == 0)
    				{	
    					firework2.IsSelected = false;
    				}
    			}
    					
    			firework.IsSelected = true;
    			LastColorSelected = firework.Colour.ToArgb();
    		}
    	}
    }
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  2. #17
    Registered User
    Join Date
    Dec 2008
    Posts
    65
    Thanks for all of your help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Logic
    By LordBronz in forum C++ Programming
    Replies: 6
    Last Post: 05-23-2006, 05:41 PM
  2. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  3. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  4. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM

Tags for this Thread