int main(int argc, char *argv[]) { traps(); if (argc != 4) usage(); depfile = argv[1]; target = argv[2]; cmdline = argv[3]; print_cmdline(); print_deps(); return 0; }
void gameplay(){ processUserInput(); // checks if you should change states or do something else with the game, e.g. pause, exit // Cobwebbed if (cobwebToken == 0){ moveCharacter(); // moves the character, collision detection, physics, etc } invincibility(); if (Monster == STARTGAME){ monsterDamage(); // check ghost damage } traps(); // check traps monsterSpawn(); // check for monster spawn guardMovement(); monstersMoveChecker(); // Moving trap function // sound can be played here too. // When the player dies and the gamestate switches to the game over screen if (player.health <= 0){ g_eGameState = GAMEOVER; PlaySound(L"sounds/dietheme.wav", NULL, SND_ASYNC | SND_LOOP); } // When the boss dies and the gamestate switches to the victory screen if (Bhealth <= 0){ g_eGameState = VICTORY; PlaySound(L"sounds/victorytheme.wav", NULL, SND_ASYNC | SND_LOOP); } // When player not in boss room if (gamesoundToken == 0){ if (level != BOSSROOM){ PlaySound(L"sounds/gametheme.wav", NULL, SND_ASYNC | SND_LOOP); gamesoundToken++; } } // When player in boss room if (level == BOSSROOM){ if (bossSoundToken == 0){ PlaySound(L"sounds/bosstheme.wav", NULL, SND_ASYNC | SND_LOOP); bossSoundToken++; } } }
int main(int argc, char *argv[]) { traps(); if (argc == 5 && !strcmp(argv[1], "-e")) { insert_extra_deps = 1; argv++; } else if (argc != 4) usage(); depfile = argv[1]; target = argv[2]; cmdline = argv[3]; print_cmdline(); print_deps(); return 0; }
int main() { double z = 1.0; cout << "Some inquiries into the nature of double:" << endl << "digits(z) = " << digits(z) << endl << "epsilon(z) = " << epsilon(z) << endl << "huge(z) = " << huge(z) << endl << "tiny(z) = " << tiny(z) << endl << "max_exponent(z) = " << max_exponent(z) << endl << "min_exponent(z) = " << min_exponent(z) << endl << "max_exponent10(z) = " << max_exponent10(z) << endl << "min_exponent10(z) = " << min_exponent10(z) << endl << "precision(z) = " << precision(z) << endl << "radix(z) = " << radix(z) << endl; Range r = range(z); cout << "range(z) = [ " << r.first() << ", " << r.last() << " ]" << endl; cout << endl << "More obscure properties:" << endl << "is_signed(z) = " << is_signed(z) << endl << "is_integer(z) = " << is_integer(z) << endl << "is_exact(z) = " << is_exact(z) << endl << "round_error(z) = " << round_error(z) << endl << "has_infinity(z) = " << has_infinity(z) << endl << "has_quiet_NaN(z) = " << has_quiet_NaN(z) << endl << "has_signaling_NaN(z) = " << has_signaling_NaN(z) << endl << "has_denorm(z) = " << has_denorm(z) << endl << "has_denorm_loss(z) = " << has_denorm_loss(z) << endl << "infinity(z) = " << infinity(z) << endl << "quiet_NaN(z) = " << quiet_NaN(z) << endl << "signaling_NaN(z) = " << signaling_NaN(z) << endl << "denorm_min(z) = " << denorm_min(z) << endl << "is_iec559(z) = " << is_iec559(z) << endl << "is_bounded(z) = " << is_bounded(z) << endl << "is_modulo(z) = " << is_modulo(z) << endl << "traps(z) = " << traps(z) << endl << "tinyness_before(z) = " << tinyness_before(z) << endl; return 0; }
int main(int argc, char *argv[]) { traps(); if (argc != 4) usage(); depfile = argv[1]; target = argv[2]; cmdline = argv[3]; /* hack for U-Boot */ if (!strncmp(target, "spl/", 4) || !strncmp(target, "tpl/", 4)) is_spl_build = 1; print_cmdline(); print_deps(); return 0; }
/*This function plays a computer turns by going through a series of functions * in order of priority and plays if that functions find that type of move. * The last function in the order will always play a move until the game is over * and this function is made to only make one move per turn. */ void computerTurn(int n, char board[21][21], bool humanPlayer) { int x, y; char humanPlayerC, compPlayerC; if (humanPlayer) { humanPlayerC = 'W'; compPlayerC = 'B'; } else if (!humanPlayer) { humanPlayerC = 'B'; compPlayerC = 'W'; } struct rusage usage; // a structure to hold "resource usage" (including time) struct timeval start, end; // will hold the start and end times getrusage(RUSAGE_SELF, &usage); start = usage.ru_utime; double time_start = start.tv_sec + start.tv_usec / 1000000.0; // in seconds /* PLACE THE CODE YOU WISH TO TIME HERE */ if (firstMove(n, board, compPlayerC)) largestFreeLoop(n, board, humanPlayer, humanPlayerC, compPlayerC); else if (connect6(n, board, humanPlayer, compPlayerC)); else if (block6(n, board, humanPlayer, compPlayerC)); else if (connect5(n, board, humanPlayer, humanPlayerC, compPlayerC)); else if (block5(n, board, humanPlayer, humanPlayerC, compPlayerC)); else if (connectTrap(n, board, humanPlayer, humanPlayerC, compPlayerC)); else if (blockException(n, board, humanPlayer, humanPlayerC, compPlayerC)); //Detect Enemy Traps takes up a lot of time and may not be worth using since //enemies may not have such complex traps else if (detectEnemyTraps(n, board, humanPlayer, humanPlayerC, compPlayerC)); else if (traps(n, board, humanPlayer, humanPlayerC, compPlayerC)); else largestFreeLoop(n, board, humanPlayer, humanPlayerC, compPlayerC); /* PLACE THE CODE YOU WISH TO TIME HERE */ getrusage(RUSAGE_SELF, &usage); end = usage.ru_utime; double time_end = end.tv_sec + end.tv_usec / 1000000.0; // in seconds double total_time = time_end - time_start; // total_time now holds the time printf("Total Time: %lf\n", total_time); }