Ejemplo n.º 1
0
int main(){

	int opt, flag = -1;
	SetConsoleTitle("Firework Columns");
	rank rrank;
	rrank.read();

	while(1){
		opt = 1;
		g_title();
		_getch();
		g_menu();
		while(k_menu(&opt) == 1){
			flag *= -1;
			g_cheat(flag);
		}

		switch(opt){
			case 1:
				playset game;
				game.cheat = flag;
				g_setf(flag);
				if(game.set() == 0) break;
				g_gamef();
				game.initialize();
				game.random();
				game.drop();
				if(game.opt == 4) break;
				if(k_wait() == 0) break;
				game.record(&rrank);
				g_rank();
				rrank.srank();
				if(k_wait() == 0) break;
				break;
			case 2:
				g_help();
				k_wait();
				break;
			case 3:
				g_rank();
				rrank.srank();
				k_wait();
				break;
			case 4:
				exit(0);
				break;
		}

	}
	return 0;
}
Ejemplo n.º 2
0
Archivo: krnl.c Proyecto: jdn-aau/krnl
int
k_sleep (int time)
{
    int r;
    if (time <= 0)
	return -1;
    r = k_wait (pSleepSem, time);
    if (r == -1)		// timeout ? yes :-)
	return 0;
}
Ejemplo n.º 3
0
//----------------------------------------------------------------------------
int
k_wait_lost (struct k_t *sem, int timeout, int *lost)
{
	DI();
	if (lost != NULL) {
		*lost = sem->clip;
		sem->clip = 0;
	}
  return k_wait(sem,timeout);
}
Ejemplo n.º 4
0
int
k_sleep (int time)
{
  return k_wait (pSleepSem, time);
}