Ejemplo n.º 1
0
void snake::move_snake()
{
    if(direction!=0)
    {
        if(direction==UP){node n('*',head->Pos_x,head->Pos_y-1); insert_body(n);}
        else if(direction==DOWN){node n2('*',head->Pos_x,head->Pos_y+1); insert_body(n2);}
        else if(direction==LEFT){node n3('*',head->Pos_x-2,head->Pos_y); insert_body(n3);}
        else if(direction==RIGHT){node n4('*',head->Pos_x+2,head->Pos_y); insert_body(n4);}

        if(head->Pos_x!=apple_x||head->Pos_y!=apple_y)//判断是否吃苹果
        delete_tail();
        else
        creat_food();
        show_food();
    }
}
Ejemplo n.º 2
0
/* Insert the next line into the parser. Return 0 on success or true
   on error with errno set appropriately. */
int
rfc822parse_insert (rfc822parse_t msg, const unsigned char *line, size_t length)
{
  return (msg->in_body
          ? insert_body (msg, line, length)
          : insert_header (msg, line, length));
}
Ejemplo n.º 3
0
Archivo: rfc822.c Proyecto: gpg/geam
int
rfc822_insert( RFC822 msg, char *line, size_t length )
{
    return msg->in_body? insert_body( msg, line, length )
           : insert_header( msg, line, length );
}