[DiscordArchive] So to get like the first 8?
[DiscordArchive] So to get like the first 8?
Archived author: Kavligula • Posted: 2018-06-03T21:01:15.337000+00:00
Original source
So to get like the first 8?
Archived author: Skarn • Posted: 2018-06-03T21:01:15.740000+00:00
Original source
for doing that reading with that example
Archived author: Skarn • Posted: 2018-06-03T21:01:27.174000+00:00
Original source
to get first 8, then 7 and then one
Archived author: Kavligula • Posted: 2018-06-03T21:01:32.301000+00:00
Original source
Okay
Archived author: Kavligula • Posted: 2018-06-03T21:01:37.261000+00:00
Original source
I *think* this is how it would go
Archived author: Kavligula • Posted: 2018-06-03T21:04:45.442000+00:00
Original source
```
16_bit_value // this is the value you're actually going to get the info from
111111110000000 // this is the mask
new_value = 16_bit_value & 1111111100000000 // This will just return the first 8 bits (I think)
other_value = 16_bit_value & (1111111100000000 >> 7) // This *should* get you the 7 bits
final_value = 16_bit_value & 0000000000000001 // This'll hopefully get you the last bit
```
Archived author: Kavligula • Posted: 2018-06-03T21:04:48.906000+00:00
Original source
I think there's a better way to do it
Archived author: Kavligula • Posted: 2018-06-03T21:05:00.791000+00:00
Original source
But I'd need time and be on an actual computer I use for development to get you the proper answer
Archived author: Kavligula • Posted: 2018-06-03T21:05:16.970000+00:00
Original source
Wait even then that'd require casting
Archived author: Kavligula • Posted: 2018-06-03T21:05:22.167000+00:00
Original source
God damn it Skarn why do you have to use python