作者doall (狂人)
看板mud_sanc
标题[问题] 程式发生问题。
时间Wed Dec 5 10:23:55 2007
很久以前编写过一个判断自己的档名而创造出口的小code,但是到了sanc却不能使用
可以请小宝帮我看看问题出在哪里吗?
:::::::::::::: /u/d/dolla/area/3_7_1.c ::::::::::::::
#include <path.h>
inherit ROOM;
inherit __DIR__"auto_exits";
void create()
{
::create();
seteuid(getuid());
mapping exit;
exit = ([]);
int *coor;
string *other;
other = ({"",""});//""内分别输入enter and out的档案位置,若无,请保持空白
set("light",1);
set("short",WHT+"西大道"+NOR);
//------05--------10--------15--------20--------25----28--30 <--字数量
尺
set("long",@LONG
银白雪花依然飘落,似乎终年不停。道旁顶了层白的银杏,随着
冷冽的风艰难的晃着头。在南北两方好似各有着一条青砖小道,因着
两旁高大的建筑显得相当狭小。
LONG);
//------------------------------------------------------------------------------
coor = getcoordination();
exit = set_exit(coor[0],coor[1],coor[2]other[0],other[1]) + exit;
set("exits",exit["exits"]);
set("coordinate","("+coor[0]+","+coor[1]+","+coor[2]+")");
reset();
}
:::::::::::::: /u/d/dolla/area/auto_exits.c ::::::::::::::
int *getcoordination(){
string name;
int x,y,z;
name = file_name();
sscanf(name,"%d_%d_%d",x,y,z);
return ({x,y,z});
}
string *mean_sit(int x,int y,int z){
string n,s,e,w,u,d;
n = x+"_"+(y+1)+"_"+z;
s = x+"_"+(y-1)+"_"+z;
e = (x+1)+"_"+y+"_"+z;
w = (x-1)+"_"+y+"_"+z;
u = x+"_"+y+"_"+(z+1);
d = x+"_"+y+"_"+(z-1);
return ({n,s,e,w,u,d});
}
mapping set_exit(int x,int y,int x,string enter,string out){
mapping map = ([
"exits":([ ]),
]);
int i;
string *temp;
string *exit = ({"north","south","east","west","up","down"});
temp = mean_sit(x,y,z);
for(i=0;i<6;i++){
if(file_size(__DIR__+("%s",temp[i])+".c") >= 0){
map["exits"] = ([ exit[i] :
__DIR__+("%s",temp[i]), ]) + map["exits"];
}
}
if(enter != "") map["exits"] = (["enter" : ("%s",enter),]) +
map["exits"];
if(out != "") map["exits"] = (["out" : ("%s",out),]) + map["exits"];
return map;
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 124.8.138.169