示例#1
0
void create() {
  seteuid(getuid());
  set("light", 1);
  set( "short", "The Petting Zoo." );
  set( "long", @ENDLONG
You are in a small petting zoo.
ENDLONG
  );
  set( "exits", ([
    "south" : ROOMS(zoo1),
    "east" : ROOMS(zoo4),
  ]) );
  ::create();
  fill_room(1);
}
示例#2
0
文件: parser.c 项目: ThomasSan/lem_in
t_shell	*fill_shell(t_shell *shell, char *buff)
{
	if (shell->ret == ANTS)
	{
		shell->ants = ft_atoi(buff);
		shell->type = ROOMS;
	}
	else if (shell->ret == ROOMS)
		shell->head = fill_room(shell->head, buff, shell);
	else if (shell->ret == PIPES)
	{
		fill_pipes(shell->head, buff);
		shell->type = PIPES;
	}
	return (shell);
}
示例#3
0
文件: parser.c 项目: ThomasSan/lem_in
t_shell	*parse_lines(t_shell *shell, char *buff)
{
	while (get_next_line(0, &buff))
	{
		ft_putendl(buff);
		if ((shell->ret == START || shell->ret == END) && shell->type != ANTS)
		{
			if (parsing_start_end(shell, buff) == 3)
				continue ;
			else if (parsing_start_end(shell, buff) == 2)
				break ;
			shell->head = fill_room(shell->head, buff, shell);
			shell->ret = 0;
			free(buff);
			continue;
		}
		shell->ret = ft_checkline(buff, shell->type, shell->head);
		if (shell->ret == ERROR)
			break ;
		shell = fill_shell(shell, buff);
		free(buff);
	}
	return (shell);
}
示例#4
0
reset() {
  if (!present("#BLAH#", TO)) fill_room();
}