+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
pt = &_board_15x15_7;
} else if (strcmp (name, "22x22-7") == 0) {
pt = &_board_22x22_7;
+ } else if (strcmp (name, "list") == 0) {
+ printf ("board: 8x8-7 8x15-7 15x15-7 22x22-7\n");
+ pt = (board_t *)(-1);
}
return pt;
pt->tiles = _tiles_nl;
pt->nbletters = NB_LETTERVALUES_NL;
pt->lettervalues = _lettervalues_nl;
+ } else if (strcmp (lang, "list") == 0) {
+ printf ("language: de en es fr it nl\n");
+ pt = (bag_t *)(-1);
}
return pt;
{
FILE *fd = ret ? stderr : stdout;
fprintf (fd, "usage: %s [-b board] [-c] [-d dict] [-h] [-l lang] [-n nb] [-r file] [-s pattern] [-v level]\n", progname);
- fprintf (fd, " -b: board (%s)\n", boardname);
+ fprintf (fd, " -b: board (%s|list)\n", boardname);
fprintf (fd, " -c: cache dictionary\n");
fprintf (fd, " -d: dictionary (%s)\n", (dict) ? dict : "none");
fprintf (fd, " -h: help message\n");
- fprintf (fd, " -l: language (%s)\n", language);
+ fprintf (fd, " -l: language (%s|list)\n", language);
fprintf (fd, " -n: number of players (%d)\n", nbplayers);
fprintf (fd, " -r: restore game (%s)\n", (file) ? file : "none");
fprintf (fd, " -s: save pattern (%s)\n", (pattern) ? pattern : "none");
}
board_t *board = getboard (boardname);
- if (!board) {
+ if (board == (board_t *)(-1)) {
+ return 0;
+ } else if (!board) {
VERBOSE (ERROR, fprintf (stderr, "board not found\n"));
return 1;
}
bag_t *bag = getbag (language);
- if (!bag) {
+ if (bag == (bag_t *)(-1)) {
+ return 0;
+ } else if (!bag) {
VERBOSE (ERROR, fprintf (stderr, "language not found\n"));
return 1;
}
/* test: scrabble.exe -b 2>&1 | grep 'no board' */
/* test: scrabble.exe -b 6x6-7i 2>&1 | grep 'not found' */
+/* test: scrabble.exe -b list | grep 'board:' */
/* test: scrabble.exe -d 2>&1 | grep 'no dictionary' */
/* test: scrabble.exe -d none.dict 2>&1 | grep 'not found' */
/* test: scrabble.exe -h | grep usage */
/* test: scrabble.exe -l 2>&1 | grep 'no language' */
/* test: scrabble.exe -l aa 2>&1 | grep 'not found' */
+/* test: scrabble.exe -l list | grep 'language:' */
/* test: scrabble.exe -n 2>&1 | grep 'no number' */
/* test: scrabble.exe -n 5 2>&1 | grep 'incorrect' */
/* test: scrabble.exe -r 2>&1 | grep 'missing file name' */