Unsigned int and bit masks

Godot Version

v4.3

Question

I am trying to make a chess program using Godot to learn more about the engine and gdscript as a language. I want to use 64-bit integers to represent different aspects of my chess board but signed integers throw problems when I try to use numbers that would go negative. Are there any alternate unsigned 64-bit data types? I do not care about the number in my case; I care more about where the 1s and 0s are in my int so that I can use them to manipulate and interpret the board. So if anyone knows how to use unsigned 64-bit ints or any alternate data type that can accomplish the same job, I would greatly appreciate your help.

Not sure if this is useful, but you can use int’s and directly manipulate the bits.

You can use the 0b literal for binary representation,…

var x = 0b1001 # x is 9

I was using this,
var board = 0xffff00000000ffff
This representation would be the starting positions of a chess board, but it gets truncated and the value changes such that when I go to check the bits using a shift loop and checking even or odd I get the wrong answers, and debugging shows me that the number I want is truncated to fit and that screws it up

Why not using an Array[bool]?

You could use a PackedIntArray. There is a 32 bit version if you need.