Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9637) Ocean numbers
Home

[Freeciv-Dev] Re: (PR#9637) Ocean numbers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory.Berkolaiko@xxxxxxxxxxxxx, mburda@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9637) Ocean numbers
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Aug 2004 17:26:31 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9637 >

Marcelo Burda wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9637 >
> 
>>[mstefek - Lun. Aoû. 09 09:08:05 2004]:
>>
>>
>>>2. This code:
>>>
>>>+  if ((is_land && is_ocean(map_get_terrain(x, y)))
>>>+      || (!is_land && !is_ocean(map_get_terrain(x, y)))) {
>>>
>>
>>Proposition:
>>
>> if (!(is_land ^ is_ocean(map_get_terrain(x, y)))) {

> if (!(is_land == is_ocean(map_get_terrain(x, y)))) {
> or best
> if ((is_land != is_ocean(map_get_terrain(x, y)))) {
> 
> is the right way,m ^ is to be used with bits.

^ is to be used with bits but as long as the values are 0 or 1 it will 
work.  The == check will also work only with values of 0 and 1.  1 != 2 
but both are "true".

jason




[Prev in Thread] Current Thread [Next in Thread]