the astar demo sample program
BlitzMax Forums/BlitzMax Beginners Area/the astar demo sample program
| ||
I learn blitz max by looking the samples come with blitz max. right now I learn the astar demo program. I have a problem to understand the next command in the loadmap method that belong to the astardemo type that locate in the astar_demo.bmx file: Local stream:TStream = ReadStream("littleendian::map"+mapNumber) I cant find what is "littleendian::map" and where it is defined ? |
| ||
Well, "map" is the first part of the filename. About Little Endian... Long version: I don't normally (i.e. ever) bother myself with endianness as I've simply never needed to, so I'm not exactly 100% clued up on the intricacies of it. But the gist of the idea is that by using Little Endian (or Big Endian - I can never remember which is which) lets you store the least significant bit/byte either first, or last. "littleendian::" just tells ReadStream to use little endian protocol when reading data. Short version: Don't worry about it. |
| ||
See http://en.wikipedia.org/wiki/Endianness a description on Big and Little endian. In general it is the order of how a number/address can be written/stored. For example using decimal (base 10): units,10s,100's,1000's (little endian) or 1000's,100's,10's,units (big end endian). Which version is used depends on the CPU. You should read about how a number is stored in binary (base 2). Numbers can be represented in 3 ways integer, floating point and Binary-Code Decimal. You will also see that there is a relationship between hexadecimal (base 16) numbers and binary. |
| ||
thank you for replying. it was very helpful. |