Demo entry 6785935

1140

   

Submitted by anonymous on Mar 21, 2019 at 14:21
Language: C++. Code size: 890 Bytes.

#pragma once
#include <iostream>
#include <Windows.h>
#include <stdlib.h>
#include <time.h>
#define LINE -1	//走过的路线
#define FLOOR 0	//通路
#define WALL 1	//障碍
#define ERR 2   //死胡同
#define ON 3	//上
#define DOWN 4	//下
#define LEFT 5	//左
#define RIGHT 6	//右
#define MAXSIZE 20//地图最大范围

using namespace std;
#define OK 1
#define ERROR 0
typedef int Status;
typedef struct StackNode
{
	int y, x;//当前坐标
	int d;	//当前方向
	struct StackNode* next;
}StackNode, *LinkStack;
typedef struct RouteNode
{
	//一个Route节点就是一条路线,链表形式
	LinkStack route;
	struct RouteNode *next;
}RouteNode,*AllRoute;


Status InitStack(LinkStack &S);
Status Push(LinkStack &S, int ey, int ex, int ed);
Status Pop(LinkStack &S, int &ey, int &ex, int &ed);
Status ClearStack(LinkStack &S);
void Change(LinkStack &A, LinkStack &B);
void PrintStackxy(LinkStack S);
Status Direction(LinkStack &L);

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).