-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.pas
More file actions
187 lines (157 loc) · 5.57 KB
/
main.pas
File metadata and controls
187 lines (157 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
(*
* Hello! Paracraft Maze Generator for Paracraft
* Copyright (C) 2014 Eric_Lian <https://github.com/ExerciseBook/HPCMG>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ===========================================================================
* 上面都是我复制粘贴的,反正最终解释权归我所有啦!
* All above that is I copied from another place .
* All in all . Don't do something wrong on my code .
*)
uses md5,dos,crt,math,
blcksock,ftpsend,httpsend,
synacode,synafpc,synaip,synautil,synsock;
{$I-}
{$h+}
type
idfm=record
ID :longint;
Fj :string; //ID:Fj
CH :Longint; //Chance 10000 set to 100%
end;
ids=array[0..4096]of idfm; //[0].ID , [0].CH is the totel
//aeraa=array[0..10000,0..110,0..10000]of idfm;
Var
way:array[0..3,1..2] of integer = ((-1,0),(1,0),(0,1),(0,-1));
bn :longint;
map:array[0..601,0..601]of integer;
b :array[0..301,0..301]of boolean;
f :array[0..1000000,1..2]of longint;
lb :longint;
sett : record //the setting of the gener
wall,botton,top : ids;
tall,road,long,wide,thick,hole,way,outway : longint;
add:boolean;
end;
i:longint;
language: string;
t : text;
randomseed:string;
version,nowversion:longint;
TheBase64Alphabet : string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'+
'abcdefghijklmnopqrstuvwxyz'+
'0123456789' + '+/';
rundir,outdir,s,s1,outname:string;
slient:boolean;
genps:longint;
c:word;
p:array [1..13]of boolean;
{$INCLUDE lib/tools.pas}
{$INCLUDE lib/worldedit.pas}
{$INCLUDE lib/base64.pas}
{$INCLUDE lib/Command.pas}
{$INCLUDE lib/CheckForUpdate.pas}
{$INCLUDE lib/file/setting.pas}
{$INCLUDE lib/file/language/zh_cn.pas}
{$INCLUDE lib/gener/DFSmazeGener.pas}
{$INCLUDE lib/gener/PRIMmazeGener.pas}
//{$INCLUDE lib/gener/AEmazeGener.pas}
{$INCLUDE lib/gener/WallDigging.pas}
{$INCLUDE lib/io/PrintOutTextMap.pas}
{$INCLUDE lib/io/io.pas}
{$INCLUDE lib/io/PrintOutMap.pas}
Procedure test;
Var
i,j:longint;
programfilename:string;
t:text;
Begin
End;
{============================================================================}
{================================ = Main = ==================================}
{============================================================================}
Begin
NowVersion:=25;
sett.add:=true;
i:=1;
rundir:='';
outdir:='';
slient:=false;
while ParamStr(i)<>'' do begin
if (upcase(ParamStr(i))<>'-RUNDIR') and
(upcase(ParamStr(i))<>'-OUTDIR') and
(upcase(ParamStr(i))<>'-OUTNAME') then slient:=true;
if upcase(ParamStr(i))='-RUNDIR' then begin
rundir:=paramstr(i+1);
while pos('/',rundir)<>0 do rundir[pos('/',rundir)]:='\';
if rundir[length(rundir)]<>'\' then rundir:=rundir+'\';
inc(i);
end;
if upcase(ParamStr(i))='-OUTDIR' then begin
outdir:=paramstr(i+1);
while pos('/',outdir)<>0 do outdir[pos('/',outdir)]:='\';
if outdir[length(outdir)]<>'\' then outdir:=outdir+'\';
inc(i);
end;
if upcase(ParamStr(i))='-OUTNAME' then begin
outname:=paramstr(i+1);
if outname[length(outname)]<>'\' then outname:=outname;
inc(i);
end;
if upcase(ParamStr(i))='-ADD' then begin
sett.add:=true;
end;
inc(i)
end;
settingfile;
languagefile;
language:=readstr('setting.ini','Language') ;
textcolor(7);
test;
if upcase(ParamStr(1))<>'-DELETETEMP' then
printtext('G_Welcome',1,1,0,0);
if paramstr(1)<>'' then command;
if (slient=false) or (sett.add=true) then
begin
CheckForUpdate;
ReadIn;
end
else
begin
Command;
end;
printtext('G_Gen',1,1,0,0);
case sett.way of
1: DFSmazeGener;
2: PRIMmazeGener;
end;
WallDigging;
printtext('G_OUT',1,1,0,0);
{Is OUTPUT Foder Exist?}
if outdir='' then begin
CreateDir(rundir+'out\'+Randomseed+'\');
end
else
begin
CreateDir(outdir);
end;
PrintOutMap;
if outdir='' then PrintOutTextMap;
if outdir='' then begin
exec('explorer',rundir+'out\'+randomseed);
printtext('G_pakte',1,1,0,0);
if ParamStr(1)='' then readkey;
end;
End.