I have been trying to come up with a funtion were given a int it would modify a bit at a given position using bitwise operations:
For example:
modify_bit(int, pos)
modify_bit(0b10000, 1) should return 0b11000
Or modify_bit(0b10000, 6) should return 0b100001
I have done research but have not found any funtions that modify a bit at a given position in a bitboard from left to right were instead all the funtions that I have found that might be what I am looking for modify a bit from the postions right to left.
Thanks in advance!