Archived

This topic is now archived and is closed to further replies.

Genjix

#include

Recommended Posts

Guest Anonymous Poster
Can anyone please help me on understanding this topic further
http://www.brucemo.com/compchess/programming/0x88.htm the topic especially the 0x88 part i don''t get correctly i wonder if this is a zero by 88 or what can anyone explain this futher. peace.

Share this post


Link to post
Share on other sites
"The name that seems to have stuck is "0x88", which is means hexidecimal 88.

The reason it''s called 0x88 is that this constant is critical in the implementation of the scheme."

there just read the text.

Lazzar

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ive figured out why now, its none of the above, its that I need gl.h and glu.h to run glut.h
Thanks for helping me anyway
Now where to find gl.h and glu.h ... doesnt seem to turn up on google .... ;-)

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Ive figured out why now, its none of the above, its that I need gl.h and glu.h to run glut.h
Thanks for helping me anyway
Now where to find gl.h and glu.h ... doesnt seem to turn up on google .... ;-)


Are you using Dev-C++? Those 2 files tend to be included with most C/C++ IDEs.



First make it work,
then make it fast.

--Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
= ( 16^1 * 8 ) + ( 16^0 + 8 )
= 136 dec

= 1000 1000 bin

Not "zero by 88"

okay Wild pointer i see this clearly now, tell me can the C compiler going to be able to recognise a code
(!(index & 0x40))
You can explain this code to me in lay man''s term''s if you understand further bcoz am having great difficulty understanding it am an average C programmer though.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
okay Wild pointer i see this clearly now, tell me can the C compiler going to be able to recognise a code
(!(index & 0x40))
You can explain this code to me in lay man's term's if you understand further bcoz am having great difficulty understanding it am an average C programmer though.


First, you have to understand how differently-based number systems work. I'll assume you know the basics, and just say, whenever you see a number starting with "0x", you know it's in base-16, also known as hexadecimal.

As you might know, the '&' performs a bitwise AND (the logical operator, not the conjunction) between two numbers. You have to understand how Boolean logic and binary work. I'll let you research what you don't know on your own, but as an example,

0x40 (base-16, hex) = 64 (base-10, dec) = 00100000 (base-2, binary)

Let's say we had two constants, 0x40 (the same as above) and 0x10 that represent BLUE and SQUARE, respectively.

index might be a bitfield representing properties of a shape, and we want to make a shape that's both blue and square, so we'd say

index = 0x10 | 0x40;

This logically combines the values 0x10 and 0x40 to produce one number. In binary:

01000000 |
00010000
---------
01010000 = 80 (dec)

Then, when we're building our shape according to index, we might have a test that looks something like what you're asking about (yes, we're getting to the actual explanation!):

if(index & 0x40)
    // the shape is square, so do something about it

The same operation is performed (logical AND):

01010000 &
01000000 =
--------
01000000

Since if is boolean, it sees the resulting value as a logical "true", because it is not 0. Therefore, as we desire, the if statement will trigger if the index variable contains the bit pattern in 0x40.

Oi. edit: thanks to Thunder_Hawk for pointing out the logical operator typos.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links


[edited by - zealouselixir on October 22, 2003 6:34:38 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Everything is clear s far , so i guess this is pure C isn''t it. i.e. the C compiler will understand this rite?

Share this post


Link to post
Share on other sites
quote:
Original post by ZealousElixir
index might be a bitfield representing properties of a shape, and we want to make a shape that''s both blue and square, so we''d say

index = 0x10 & 0x40;

This logically combines the values 0x10 and 0x40 to produce one number. In binary:

01000000 &
00010000
---------
01010000 = 80 (dec)




Every instance of "&" here should be "|".



______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What i want to get here is how do you make a C compiler understand that you are using a particlar numbering system for instance if you say 0x88 you mean the compiler will straight away realize that you are using base 16 is this correct??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Can anyone please explain to me what a bitboard is and how one can implement it!!



===========================================
Am the reason why they have security at clubs

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Can anyone show me how to make a link i mean like if i want to refer some1 to another page i do it elegantly such that when i put a mouse there it directs me to another web page not unlike the User druzzer007 did when he refered saying
http://www.gamedev.net/reference/programming/features/chess2/page3.asp. thanx!!

=================================
The reason there is security

Share this post


Link to post
Share on other sites
quote:

Can anyone show me how to make a link i mean like if i want to refer some1 to another page i do it elegantly such that when i put a mouse there it directs me to another web page not unlike the User druzzer007 did when he refered saying...



Use html

[edited by - NullPointer33 on October 23, 2003 3:00:34 PM]

Share this post


Link to post
Share on other sites