diff --git a/xwords4/common/comtypes.h b/xwords4/common/comtypes.h index d2c35f93b..2779b4906 100644 --- a/xwords4/common/comtypes.h +++ b/xwords4/common/comtypes.h @@ -212,6 +212,8 @@ typedef enum { BONUS_DOUBLE_WORD, BONUS_TRIPLE_LETTER, BONUS_TRIPLE_WORD, + BONUS_QUAD_LETTER, + BONUS_QUAD_WORD, BONUS_LAST } XWBonusType; diff --git a/xwords4/common/model.c b/xwords4/common/model.c index 016355898..1381142da 100644 --- a/xwords4/common/model.c +++ b/xwords4/common/model.c @@ -391,7 +391,7 @@ model_setSquareBonuses( ModelCtxt* model, XWBonusType* bonuses, XP_U16 nBonuses XP_FREE( model->vol.mpool, model->vol.bonuses ); } model->vol.bonuses = XP_MALLOC( model->vol.mpool, - nBonuses * sizeof(model->vol.bonuses[0]) ); + nBonuses * sizeof(model->vol.bonuses[0]) ); XP_MEMCPY( model->vol.bonuses, bonuses, nBonuses * sizeof(model->vol.bonuses[0]) ); model->vol.nBonuses = nBonuses; diff --git a/xwords4/common/mscore.c b/xwords4/common/mscore.c index 2fbc18cf3..cdc54abc8 100644 --- a/xwords4/common/mscore.c +++ b/xwords4/common/mscore.c @@ -620,6 +620,8 @@ word_multiplier( const ModelCtxt* model, XWEnv xwe, XP_U16 col, XP_U16 row ) return 2; case BONUS_TRIPLE_WORD: return 3; + case BONUS_QUAD_WORD: + return 4; default: return 1; } @@ -634,6 +636,8 @@ tile_multiplier( const ModelCtxt* model, XWEnv xwe, XP_U16 col, XP_U16 row ) return 2; case BONUS_TRIPLE_LETTER: return 3; + case BONUS_QUAD_LETTER: + return 4; default: return 1; } diff --git a/xwords4/linux/linuxutl.c b/xwords4/linux/linuxutl.c index 3f52ad43a..6101b820d 100644 --- a/xwords4/linux/linuxutl.c +++ b/xwords4/linux/linuxutl.c @@ -115,11 +115,13 @@ linux_util_makeEmptyDict( XW_UtilCtxt* XP_UNUSED_DBG(uctx), XWEnv xwe ) #define DW BONUS_DOUBLE_WORD #define TL BONUS_TRIPLE_LETTER #define TW BONUS_TRIPLE_WORD +#define QL BONUS_QUAD_LETTER +#define QW BONUS_QUAD_WORD static XWBonusType* bonusesFor( XP_U16 boardSize, XP_U16* len ) { - static XWBonusType scrabbleBoard[] = { + static XWBonusType scrabbleBoard[] = { TW,//EM,EM,DL,EM,EM,EM,TW, EM,DW,//EM,EM,EM,TL,EM,EM, @@ -133,7 +135,7 @@ bonusesFor( XP_U16 boardSize, XP_U16* len ) TW,EM,EM,DL,EM,EM,EM,DW, }; /* scrabbleBoard */ - static XWBonusType seventeen[] = { + static XWBonusType seventeen[] = { TW,//EM,EM,DL,EM,EM,EM,TW, EM,DW,//EM,EM,EM,TL,EM,EM, @@ -146,17 +148,37 @@ bonusesFor( XP_U16 boardSize, XP_U16* len ) EM,EM,DL,EM,EM,EM,DL,//EM, TW,EM,EM,DL,EM,EM,EM,DW, TW,EM,EM,DL,EM,EM,EM,DW,DW, - }; /* scrabbleBoard */ + }; /* seventeen */ + + static XWBonusType twentyOne[] = { + QW, + EM, DW, + EM, EM, DW, + DL, EM, EM, TW, + EM, TL, EM, EM, DW, + EM, EM, QL, EM, EM, DW, + EM, EM, EM, DL, EM, EM, DW, + TW, EM, EM, EM, EM, EM, EM, DW, + EM, DW, EM, EM, TL, EM, EM, EM, TL, + EM, EM, DW, EM, EM, DL, EM, EM, EM, DL, + DL, EM, EM, TW, EM, EM, DL, EM, EM, EM, DW, + }; /* twentyOne */ XWBonusType* result = NULL; - if ( boardSize == 15 ) { + switch ( boardSize ) { + case 15: result = scrabbleBoard; *len = VSIZE(scrabbleBoard); - } else if ( boardSize == 17 ) { + break; + case 17: result = seventeen; *len = VSIZE(seventeen); + break; + case 21: + result = twentyOne; + *len = VSIZE(twentyOne); + break; } - return result; }