Raised This Month: $ Target: $400
 0% 

Bit - include file (formally Boolean)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Lulu the hero
Senior Member
Join Date: Oct 2009
Location: Budapest, Hungary
Old 12-06-2010 , 07:40   Bit - include file (formally Boolean)
Reply With Quote #1

Hi, everyone!

I was using some bit manipulating stocks far more often, then to copy paste them everywhere all the time. I got a handful, and put it into an include file. Hope this set of stocks/functions - gonna add more if get new ones - will help everyone, who needs bit manipulation.

The macros/stocks:
PHP Code:
#define toggle_player_flag(%1,%2)
#define toggle_flag(%1,%2)

#define clear_player_flag(%1,%2)
#define clear_flag(%1,%2)

#define set_player_flag(%1,%2)
#define set_flag(%1,%2)

#define is_player_flag_set(%1,%2)
#define is_flag_set(%1,%2)

stock num_to_binstr(numdest[], zero_fill 0)
stock num_to_hexstr(numdest[], zero_fill 0)

stock rol(integerstep 1)
stock ror(integerstep 1)

stock get_highest(integercount_type// COUNT_BIT|COUNT_NIBBLE
stock count_bits(integer) 
Last update(dd.mm.yyyy): 03.03.2011.
Attached Files
File Type: inc bit.inc (3.1 KB, 379 views)

Last edited by Lulu the hero; 03-04-2011 at 11:48.
Lulu the hero is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode