bool priseNonObligatoire(mainJoueur *m, couleur *coulChosen){ couleur c, cMax = CARREAU; int max = valMain(m, CARREAU); int val; for(c=COEUR; c<NBRE_COUL; c++){ val = valMain(m, c); if(val>max){ max = val; cMax = c; } else if(val == max){ if(m->nbreCarteInit[c] > m->nbreCarteInit[cMax]){ max = val; cMax = c; } } } *coulChosen = cMax; return (max >= 50); }
bool prendColor(mainJoueur *m, couleur coulAtout){ return (valMain(m, coulAtout) >= 50); }
/** * This is the main function */ int main(int argc, char **argv) { int ret = 0; xmlMemSetup(free, xmalloc, xrealloc, xstrdup); gGetUnicodeOptions(argc, argv); gInitOptions(&globalOptions); gParseOptions(&globalOptions, &argc, argv); xmlSetStructuredErrorFunc(&errorInfo, reportError); if (globalOptions.quiet) suppressErrors(); if (argc <= 1) { usage(argc, argv, EXIT_BAD_ARGS); } else if (!strcmp(argv[1], "ed") || !strcmp(argv[1], "edit")) { ret = edMain(argc, argv); } else if (!strcmp(argv[1], "sel") || !strcmp(argv[1], "select")) { ret = selMain(argc, argv); } else if (!strcmp(argv[1], "tr") || !strcmp(argv[1], "transform")) { ret = trMain(argc, argv); } else if (!strcmp(argv[1], "fo") || !strcmp(argv[1], "format")) { ret = foMain(argc, argv); } else if (!strcmp(argv[1], "val") || !strcmp(argv[1], "validate")) { ret = valMain(argc, argv); } else if (!strcmp(argv[1], "el") || !strcmp(argv[1], "elements")) { ret = elMain(argc, argv); } else if (!strcmp(argv[1], "c14n") || !strcmp(argv[1], "canonic")) { ret = c14nMain(argc, argv); } else if (!strcmp(argv[1], "ls") || !strcmp(argv[1], "list")) { ret = lsMain(argc, argv); } else if (!strcmp(argv[1], "pyx") || !strcmp(argv[1], "xmln")) { ret = pyxMain(argc, argv); } else if (!strcmp(argv[1], "depyx") || !strcmp(argv[1], "p2x")) { ret = depyxMain(argc, argv); } else if (!strcmp(argv[1], "esc") || !strcmp(argv[1], "escape")) { ret = escMain(argc, argv, 1); } else if (!strcmp(argv[1], "unesc") || !strcmp(argv[1], "unescape")) { ret = escMain(argc, argv, 0); } else { usage(argc, argv, EXIT_BAD_ARGS); } exit(ret); }