jscrab
jscrab copied to clipboard
pointers to debug
Hi,
I like your work. Each time I run the game, I get new set of tiles. However, for live-debugging what the code does, whats recommended strategy?
There must be a way to manually set the racks (opponent as well as player). Can you provide some guidance here.
Hi,
Sorry for the late reply - just realised I don't get any notifications when new messages arrive.
Don't know if it's still relevant, but here it is:
The following methods in ui.js set the racks of the player and the opponent. Notice where they are used and change the letters placed on the racks according to what you require.
self.setPlayerRack = function( letters )
{
self.setLetters( 1, letters );
if (self.firstrack) {
self.firstrack = false;
self.initRedips();
}
};
self.setOpponentRack = function( letters )
{
self.setLetters( 2, letters );
};