author | erik <erik> | 2007-01-19 01:10:09 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-19 01:10:09 (UTC) |
commit | 2b45dc71e79a3eb7d4e8553273c9bc4f4282d50a (patch) (unidiff) | |
tree | 5f1b129bf6864ad8c47054471a0c4a34badeeebe | |
parent | ca67251af3f46d685afac8dc6bfe452799c2546e (diff) | |
download | opie-2b45dc71e79a3eb7d4e8553273c9bc4f4282d50a.zip opie-2b45dc71e79a3eb7d4e8553273c9bc4f4282d50a.tar.gz opie-2b45dc71e79a3eb7d4e8553273c9bc4f4282d50a.tar.bz2 |
BUG: There are only 4095 items in the buffer that is zero'd out using 4096.
FIX: Fix the number used in memset.
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index 52e2be2..8cf92ef 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp | |||
@@ -579,25 +579,25 @@ ComputerPlayer::~ComputerPlayer() | |||
579 | { | 579 | { |
580 | delete [] best; | 580 | delete [] best; |
581 | delete [] best_blankvalues; | 581 | delete [] best_blankvalues; |
582 | } | 582 | } |
583 | 583 | ||
584 | bool ComputerPlayer::step() | 584 | bool ComputerPlayer::step() |
585 | { | 585 | { |
586 | const QDawg::Node* root = dict ? Global::dawg("WordGame").root() | 586 | const QDawg::Node* root = dict ? Global::dawg("WordGame").root() |
587 | : Global::fixedDawg().root(); | 587 | : Global::fixedDawg().root(); |
588 | QPoint d = across ? QPoint(1,0) : QPoint(0,1); | 588 | QPoint d = across ? QPoint(1,0) : QPoint(0,1); |
589 | const Tile* tiles[99]; // ### max board size | 589 | const Tile* tiles[99]; // ### max board size |
590 | uchar nletter[4095]; // QDawg only handles 0..4095 | 590 | uchar nletter[4095]; // QDawg only handles 0..4095 |
591 | memset(nletter,0,4096); | 591 | memset(nletter,0,4095); |
592 | for (int i=0; i<rack->count(); i++) { | 592 | for (int i=0; i<rack->count(); i++) { |
593 | const Tile* r = rack->tileRef(i); | 593 | const Tile* r = rack->tileRef(i); |
594 | if ( r->isBlank() ) | 594 | if ( r->isBlank() ) |
595 | nletter[0]++; | 595 | nletter[0]++; |
596 | else | 596 | else |
597 | nletter[r->text()[0].unicode()]++; | 597 | nletter[r->text()[0].unicode()]++; |
598 | } | 598 | } |
599 | Tile blankvalues[99]; // ### max blanks | 599 | Tile blankvalues[99]; // ### max blanks |
600 | findBest(current, d, root, 0, nletter, tiles, 0, blankvalues, 0); | 600 | findBest(current, d, root, 0, nletter, tiles, 0, blankvalues, 0); |
601 | if ( ++current.rx() == board->xTiles() ) { | 601 | if ( ++current.rx() == board->xTiles() ) { |
602 | current.rx() = 0; | 602 | current.rx() = 0; |
603 | if ( ++current.ry() == board->yTiles() ) { | 603 | if ( ++current.ry() == board->yTiles() ) { |