Exemple #1
0
int main(void) {
  unsigned long n = 0;
  unsigned int nb_sucre;

  /* init de la random seed */
  inital();

  /* init de la grille */
  vider();

  printf("Nombre de tours ( Si 0 : jusqu'a la fin ) : ");
  scanf("%lu", &n);

  printf("Au bout de combien de chargement un emplacement de sucre s'est-il vide ?\n");
  do {
    printf("Veuillez entrer une valeur dans [0,255] :\n");
    scanf("%u", &nb_sucre);
  } while (nb_sucre > 255 || nb_sucre < 0 );

  /* placer les objets de la grille */
  placer(nb_sucre);
  simulation(n);

  return 0;
}
Exemple #2
0
void main()       //主程序
{
  printf("\n\n\t\t---------I hope to get a high mark!:)-----------\t\t\n");
  printf("\n\t\t.多道批处理作业FCFS调度演示.\n");
  inital();
  apply();
  running();
}
Exemple #3
0
void sound_init()
{
        initalmain(0,NULL);
        inital();

        outbuffer = malloc(SOUNDBUFLEN * 2 * sizeof(int16_t));
        
        sound_add_handler(sound_cd_poll, sound_cd_get_buffer, NULL);
}
Exemple #4
0
void sound_init()
{
        initalmain(0,NULL);
        inital();

        outbuffer = malloc(SOUNDBUFLEN * 2 * sizeof(int16_t));
        
        sound_cd_event = thread_create_event();
        sound_cd_thread_h = thread_create(sound_cd_thread, NULL);
}