• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Weird error situation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird error situation


  • Subject: Re: Weird error situation
  • From: Laurence Harris <email@hidden>
  • Date: Mon, 24 Sep 2007 01:23:24 -0400


On Sep 24, 2007, at 12:57 AM, Adam wrote:

Here's the code:

bool collision_check()
{
	//if something's in the way return false otherwise return true
}

bool tile_down()
{
	next_piece = curr_piece;
	next_piece.y--;
	if (!collision_check())
	{
		return false;
	}else
	{
		return true;
	}
}

If collision_check returns false then tile_down should also return false! ... right?

Given the definition of collision_check above, exactly when do you expect it to return false? Since you don't actually return anything from collision_check() it always returns true, so tile_down() will also.


What does any of this have to do with Xcode? This is really basic C programming that has nothing to do with the use of Xcode. This list is for questions related to the use of Xcode and related tools, not general programming questions for people who happen to be using Xcode. There are lots of other mailing lists and news groups for beginning programmers to ask these kinds of questions.

Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Weird error situation
      • From: Scott Ribe <email@hidden>
References: 
 >Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)
 >Re: Weird error situation (From: Chris Espinosa <email@hidden>)
 >Re: Weird error situation (From: Adam <email@hidden>)

  • Prev by Date: Re: C++ Constructors on global vars not being run ?
  • Next by Date: subversion in xcode not showing anything
  • Previous by thread: Re: Weird error situation
  • Next by thread: Re: Weird error situation
  • Index(es):
    • Date
    • Thread