Path: chuka.playstation.co.uk!news From: "Chris Wallace" Newsgroups: scee.yaroze.freetalk.english Subject: C++ and an &... Date: Mon, 28 Nov 2005 19:15:21 -0800 Organization: PlayStation Net Yaroze (SCEE) Lines: 23 Message-ID: NNTP-Posting-Host: cpc3-with3-3-0-cust26.bagu.cable.ntl.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Hi again all! I decided to start work on my rule based AI and thought, to give my self somewhere to start from I could use one or two bits from Drum 'n' Race. Well I found the following line in there and I know what it does, and I know its what I need to be doing... but it wont compile in my new program. dir_diff=(((target_dir-direction)+(ONE/2))&(ONE-1))-(ONE/2); The code is meant to return the difference between where the car is facing and where it should be facing. If its less that 0, turn left, greater than 0, turn right. Problem is that the & throws up an exception and I don't blame it, as far as I know it gets an address! This line was given to me by James Herbert and I never questioned it, it worked so I was happy! I know that ONE has to be replaced with a full circle (assuming then that is 2*PI) but the & I don't have a clue. Is there a simple way of getting this to work or do I have to get out the pen and paper and working it all out by hand? Cheers, Chris.