1. I confess that I tried playing with Lua when the Hacking WoW book first came out, but then I got wizzed with Blizz and dropped the account, BESIDES, the boys were not doing all that well in school anyway.

    But I see that Lua continues to have problems with Modulo. Mod(8,3) is not 1. Not no way, Not no how. Now the Mac often gets it right, but not all the time e.g. mod(8,2)=-0 on my mac; and I contacted Lua's author to point this out. I don't know if this is a Windows box problem or not, but it seems that the problem has not been fixed yet, and I really do not know it this has any impact on the game . . . yet!

    Perhaps there is a binary or hex bit shift or drop going on in there somewhere?

  2. Ah, I found it. Evidently, contrary to number theory, Lua starts "counting from 1". Gee, so you are already one year old when you are born. I am sorry, but I feel that I gotta call caca del torro on that one.

  3. Ah, I found it. Evidently, contrary to number theory, Lua starts "counting from 1". Gee, so you are already one year old when you are born. I am sorry, but I feel that I gotta call caca del torro on that one.

    Talk to the authors of Pascal as well. The only reason counting at 0 in computer science even makes sense is due to languages like C where the value of the index can actually be used as an offset in memory to index the array. There are plenty of reasons why starting at 1 works and has just as many advantages. Programmer preference, I suppose :P

  4. I believe the point was that the book says 8 % 3 == 1 on p. 12. I'll add this to the Errata.

  5. Alas, one is going to compensate modulo or the program author is. And then he needs to find out why the find out what is going on between Macs and other boxes, and I wonder if the Intel Macs come out with the 1 rather than the 2 like mine does? Then it makes me wonder what other math errors may lay hidden in there. It's not nice to mess with mother nature.

  6. Everyone starts counting from 0: we just don't say it. We only say "one" AFTER we have counted the FIRST thing. Between the moment you decided to count a set of items and the time you counted the first one, your count was "0" weather you realized it or not. Tricky.