Re: questions about bgt

To explain why you might want to use int8 or uint8 instead of int or uint:
A bit can either be on or off, so 0 or 1. So with 1 bit, you have 2 possibilities: on or off.
With 2 bits, you have 4 combinations: (0,0) (0,1) (1,0) (1,1). with 3 bits you have 8 combinations, which is also 2^3. With 4 bits you have 16 combinations, or 2^4. int8 has 8 bits, so you can do 2^8 = 256. Now I don't remember exactly, but this probably means that int8 can have values from -128 to 127. When we have 16 bits, much more combinations become available, 2^16 = 65536. But why would you ever use int8, int16 when you have int32, well, int8 or int16 will only have a small advantage when you have a very, very large number of them that need to be compared to other values. So for example, if you have a game board: it is a square 1000*1000, so it has a total of 1000000 squares. If 0 stands for a wall, and 1 stands for a walkable tile, and you want to make a list of all walkable tiles, it will be much faster comparing the 8-bit values to 1, then to do the same for a 32 bit value. Will it make a world of difference? no. It's just a small thing you need to think about, but if you're just starting out, you can safely ignore int8, int16 and uint and come back to them later when you have learned while loops and that sort of stuff. If you already have some more experience, you should be able to understand it now.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : kingzombie via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : roelvdwal via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Jason SW via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Jason SW via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kianoosh via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Jason SW via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : kingzombie via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to