|
-
Aug 15th, 2002, 07:02 AM
#1
Thread Starter
Lively Member
meaning of this for loop
Hello
can some one tell me the meaning of this for loop
for (i=0;i<52;i++)
deck[i]= 0| [i/13] | ((i%13) << 2 ) | (! (i/26) << 6 );
i am not familiar with bit manipulations. so any help would be greatly appreciated.
thanks
radhika
-
Aug 15th, 2002, 08:50 AM
#2
ok it is creating an array with with the loop going from 0 to 52
and putting thta equation into english
deck[i]= 0 Or [i divided by 13] Or ((i Modulus 13) shift left 2 bits ) Or (not (i divided by 26) shift left 6 bit )
modulus in case you dont know returns the remander after dividing those 2 numbers.
even in plain english that is still pretty confusing..
now the brackets are 1/13 im not sure of. perhaps it converts to a byte..or something..Cant be certain. Im still learning all these operators myself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|