Need some help with bit array
#1

I'd need an array with a size of 2048 * 500. I need only 0 or 1 in each cell.
How could I do it with bits?
Reply
#2

How about 'bool' tag? You can't have anything except 0 or 1 (false or true) using it.
Reply
#3

I buy you a beer for that. thanks
Reply
#4

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
I buy you a beer for that. thanks
Can I have one too?
Anyways why would you want 2048 * 500
In a 1 bit cell?
Reply
#5

how does a boolean array, f.ex. this
Код:
new Bool:GotHouseKey[MAX_PLAYER][2048];
looks like? maybe something set to true/false for 500 players each? for 2048 houses/cars/permissions maybe?
Reply
#6

let's imagine a 6x4 grid:
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

like if there is 6 players, and 4 property overall. the grid contains a marker.
for example, if player 3 has a key to car #2, the grid changes that way:
0 0 0 0 0 0
0 0 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

I don't need anything apart from 0 and 1. I need one bit.
new var[6][4]; vs new bool:var[6][4]; :
the first one can be from 0 to 4294967295. it stores 32 bits. i need 1 bit.
the second one can be from 0 to 1. it stores 1 bit.

remember.. this is a 6x4 grid. imagine that on a 2048x500 grid. i need only 1 bit...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)