Thursday, June 3, 2010

Programming Error

Alright, most people who read this won't understand how this works, but I'll try my best to explain it. This all began last week when Jared asked me to fence him without it going on to the record. I realized that the reason for this was that he thought that last semester he wasn't promoted because his battles against Green knights hurt his score. To remedy this, I modified it so that matches against knights of two more or less than you wouldn't contribute to your scores. It changed from

If Wcolor > LColor then increase Winner's wins against lowers
If Wcolor < LColor then increase Winner's wins against highers

to

If Wcolo = LColor+1 then increase Winner's wins against lowers
If Wcolor = LColor-1 then increase Winner's wins against highers

All of a sudden there were some random matches that weren't recorded. I was stunned. What could be happening? When I went back to look at the code, I saw it instantly. If you didn't see it, you can look at it above. The variable "Wcolo" does not exist. Therefore if the winner's color was higher than the loser's color, the match wasn't recorded. I went ahead and put them in by hand since they were all recorded in the "Today's Matches" section. And of course I fixed the error.

2 comments:

  1. Of course, when someone beats a knight two ranks higher than them (like Matthew did), that apparently no longer contributes to their score. Which is too bad for anyone who beats a knight 2 ranks above them. Perhaps similar wins can be taken into account, when recorded in the "Today's Matches" section, even though the computer has been trained to ignore it?

    ReplyDelete
  2. If you haven't already guessed, there was some grief and consternation about this change. I didn't affect a certain party's score though, so I'm not sure why he was so worked up.

    ReplyDelete