Talk from old wiki
Jump to navigation
Jump to search
Revision as of 4 September 2011 at 16:50.
This is the thread's initial revision.
This is the thread's initial revision.
You should release a MegaBot called LifelongObsession to go with it. --David Alves
- I could release it if you promise to take over development :) -- Simonton
Hey, you released WeekendObsession S 1.0 on friday, that not a weekend! Please keep your naming consistent ;-) -- GrubbmGait
- :) Sorry. I couln't help myself. Can I plead the holiday time?? -- Simonton
I was looking at the code and I couldn't figure out why you cast the char to a short instead of int:
// aim. do { a += (short) enemyHistory.charAt(--matchPos) / dist; } while (--i > 0);
-- Kinsen
Good question! Are you familiar with the 2's compliment format for binary numbers? In java, casting from a char to an int does not do any sign extention, so (int) (char) -1 != -1 (it equals some large number instead). A Java "char" is the same length as a Java "short", (short) (char) -1 == -1. -- Simonton