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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
-
|
-
|
|
!
-
|
|
!
!
|
*shoki
randomize
screen 0,640,480
cls 4
buffer 3
cls 4
font "MS ゴシック",32
color 0,255,0
boxf 0,0,159,31
color 255,255,0
boxf 32,0,63,31
color 255,255,255
pos 64,0
mes "城"
color 0,0,255
boxf 96,0,127,31
color 128,128,128
pos 128,0
mes "山"
gsel 0
font "MS ゴシック",32
dim mTip,20,15
dim mCheck,20,15
sdim mData, 1024
mData = "33333300000000000000"
mData += "33330300000000000000"
mData += "33300313300000000000"
mData += "33000000330000000400"
mData += "33000000033000004400"
mData += "03004444003000044400"
mData += "01004004403000444003"
mData += "03004000403004400003"
mData += "03004020403044000033"
mData += "03004000000040000333"
mData += "03304400000000003333"
mData += "00304400000000033333"
mData += "00300440000000033333"
mData += "00000000000000033333"
mData += "00000000000000033333"
repeat 15
ycnt = cnt
repeat 20
xcnt = cnt
mTip( xcnt, ycnt )=int(strmid( mData, xcnt+ycnt*20, 1 ))
loop
loop
cx=15: cy=2
gosub *putmap
color 255,255,0
pos cx*32,cy*32
mes "●"
*hajime
if koushu=0:ux=6:uy=8:goto *premain ux=rnd(20): uy=rnd(15)
if mTip(ux,uy)>1:goto *hajime
*premain
gosub *bann
gosub *banngou
*main
*miru
wait 1
a=rnd(4)
on a goto *shori_up,*shori_down,*shori_left,*shori_right
*shori_up
tx=cx: ty=cy-1: if ty<0: goto *miru
if mCheck(tx,ty) < mCheck(cx,cy): cy=cy-1: goto *shori
goto *miru
*shori_down
tx=cx: ty=cy+1: if ty>14: goto *miru
if mCheck(tx,ty) < mCheck(cx,cy): cy=cy+1: goto *shori
goto *miru
*shori_left
tx=cx-1: ty=cy: if tx<0: goto *miru
if mCheck(tx,ty) < mCheck(cx,cy): cx=cx-1: goto *shori
goto *miru
*shori_right
tx=cx+1: ty=cy: if tx>19: goto *miru
if mCheck(tx,ty) < mCheck(cx,cy): cx=cx+1: goto *shori
goto *miru
*shori
gosub *putmap
color 255,255,0
pos cx*32,cy*32
mes "●"
color 255,0,0
pos ux*32,uy*32
mes "☆"
if (cx=ux)&(cy=uy){
wait 1
if koushu=0{
koushu=1
goto *hajime
}
else{
koushu=0
goto *hajime
}
}
wait 10
goto *main
*bann
repeat 15
ycnt = cnt
repeat 20
xcnt = cnt
mCheck( xcnt, ycnt ) = 0 loop
loop
return
*banngou
nCur=1
mCheck( ux, uy ) = nCur
repeat 60
nPre = nCur nCur++ repeat 15
ycnt = cnt
repeat 20
xcnt = cnt
if mCheck(xcnt,ycnt): continue
if mTip(xcnt,ycnt)>2 :mCheck(xcnt,ycnt)=299:goto *tugi
*hantei_left
tx=xcnt-1: ty=ycnt: if tx<0: goto *hantei_right if mCheck(tx,ty)=nPre: mCheck(xcnt,ycnt)=nCur:goto *tugi
*hantei_right
tx=xcnt+1: ty=ycnt: if tx>19: goto *hantei_up if mCheck(tx,ty)=nPre: mCheck(xcnt,ycnt)=nCur:goto *tugi
*hantei_up
tx=xcnt: ty=ycnt-1: if ty<0: goto *hantei_down if mCheck(tx,ty)=nPre: mCheck(xcnt,ycnt)=nCur:goto *tugi
*hantei_down
tx=xcnt: ty=ycnt+1: if ty>14: goto *tugi if mCheck(tx,ty)=nPre: mCheck(xcnt,ycnt)=nCur:goto *tugi
*tugi
loop
loop
loop
return
*putmap
redraw 0
repeat 15
ycnt = cnt
repeat 20
xcnt = cnt
pos xcnt*32,ycnt*32
gcopy 3,mTip( xcnt, ycnt )*32,0,32,32
loop
loop
redraw 1
return
|