Exemplo n.º 1
0
/*!
** Fonction appelée a chaque tour
*/
void play_turn(void)
{
  int i, j, k;
  while (rand() & 0x13)
    {
      fprintf(stderr, "time: %d extra: %d\n", time_remaining(), extra_time_remaining());
      for (i = 0; i < 8000; i++)
        for (j = 0; j < 8000; j++)
          k += i * j / i % j + 42;
    }
}
Exemplo n.º 2
0
static void
 chaninfo_callback(int *fd, off_t off, int action, void *hook1, void *hook2,
  dbuser * dbu, int count)
{
  char buffer[512];
  register adefchan *def;
  time_t t;

  if (count == 1 && dbu != NULL)
  {
    sprintf(buffer, "%s is registered by:", (char *)hook2);
    notice((char *)hook1, buffer);
  }

  if (dbu == NULL)
  {
    if (count == 0)
    {
      notice((char *)hook1, "That channel is not registered");
    }
    else
    {
      def = DefChanList;
      while (def && strcasecmp(def->name, (char *)hook2))
	def = def->next;

      if (def)
      {
	if (*def->topic)
	{
	  sprintf(buffer, "Desc: %s", def->topic);
	  notice((char *)hook1, buffer);
	}
	if (*def->url)
	{
	  sprintf(buffer, "URL: %s", def->url);
	  notice((char *)hook1, buffer);
	}
      }
    }
    free(hook1);
    free(hook2);
  }
  else if (dbu->access >= 500)
  {
    t = now - dbu->lastseen;

    sprintf(buffer, "%s (%s) last seen: %s ago",
      dbu->nick, dbu->match,
      time_remaining(t));
    notice((char *)hook1, buffer);
  }
}
Exemplo n.º 3
0
/*!
** Fonction de début
*/
void init_game(void)
{
  fprintf(stderr, "time: %d extra: %d\n", time_remaining(), extra_time_remaining());
}