OSDN Git Service

First commit
[dicend/dicend.git] / sourcdos.bas
1 Screen 12
2 DefInt A-Z
3 Randomize Timer
4
5 declare sub dice1 ()
6 declare sub dice2 ()
7 declare sub dice3 ()
8 declare sub dice4 ()
9 declare sub dice5 ()
10 declare sub dice6 ()
11 declare sub dice7 ()
12 declare sub dice8 ()
13 declare sub dice9 ()
14 declare sub dice0 ()
15 declare sub number1 ()
16 declare sub number2 ()
17 declare sub number3 ()
18 declare sub number4 ()
19 declare sub number5 ()
20 declare sub number6 ()
21 declare sub number7 ()
22 declare sub number8 ()
23 declare sub number9 ()
24 declare sub number0 ()
25 declare sub numberA ()
26 declare sub numberB ()
27 declare sub numberC ()
28 declare sub numberD ()
29 declare sub numberE ()
30 declare sub numberF ()
31 declare sub numberG ()
32 declare sub numberH ()
33 declare sub numberI ()
34 declare sub numberJ ()
35 declare sub letter1 ()
36 declare sub letter2 ()
37 declare sub letter3 ()
38 declare sub letter4 ()
39 declare sub letter5 ()
40 declare sub letter6 ()
41 declare sub letter7 ()
42 declare sub letter8 ()
43 declare sub letter9 ()
44 declare sub letter0 ()
45 declare sub letterA ()
46 declare sub letterB ()
47 declare sub letterC ()
48 declare sub letterD ()
49 declare sub letterE ()
50 declare sub letterF ()
51 declare sub letterG ()
52 declare sub letterH ()
53 declare sub letterI ()
54 declare sub letterJ ()
55 declare sub king ()
56 declare sub queen ()
57 declare sub bishop ()
58 declare sub knight ()
59 declare sub rook ()
60 declare sub pawn ()
61 declare sub cannon ()
62 declare sub lance ()
63 declare sub general ()
64 declare sub tokin ()
65 declare sub dragon ()
66 declare sub horse ()
67 declare sub dame ()
68 declare sub checker ()
69 declare sub cells ()
70 declare sub dices ()
71 declare sub chessboard ()
72 declare sub makrukboard ()
73 declare sub xiangqiboard ()
74 declare sub shogiboard ()
75 declare sub draughtsboard ()
76 declare sub chess ()
77 declare sub makruk ()
78 declare sub xiangqi ()
79 declare sub shogi ()
80 declare sub draughts ()
81 declare sub chessfen ()
82 declare sub makrukfen ()
83 declare sub xiangqifen ()
84 declare sub shogifen ()
85 declare sub draughtsfen ()
86
87 Common Shared x, y, cd1, cd2, cn, cl, cf, cb1, cb2, cb3, cb4, cb5 As Integer
88 Common Shared dc1, dc2, dc3, dc4, dc5, dc6, w1, b1, w2, b2, w3, b3, w4, b4, fw1, fb1, fw2, fb2, fw3, fb3, fw4, fb4, row, col, index, count As Integer
89 Common Shared fw1x, fw1y, fb1x, fb1y, fw2x, fw2y, fb2x, fb2y, fw3x, fw3y, fb3x, fb3y, fw4x, fw4y, fb4x, fb4y As Integer
90 Common Shared fig1w, fig1b, fig2w, fig2b, fig3w, fig3b, fig4w, fig4b, mas1, mas2, mas3, mas4, mas5, mas6, mas7, mas8, mas9, mas0, lin1, lin2, lin3, lin4, lin5, lin6, lin7, lin8, lin9, lin0, fen As String
91 Let cd1 = 2: Let cd2 = 15: Let cn = 7: Let cl = 14: Let cf = 1: Let cb1 = 7: Let cb2 = 6: Let cb3 = 3: Let cb4 = 13: Let cb5 = 9
92
93 Dim Shared board(8, 8) As Integer
94 Let index = 100
95 For row = 1 To 8: For col = 1 To 8
96     Let board(row, col) = index + 1
97     Let index = index + 1
98 Next col: Next row
99
100 Dim Shared xiabo(10, 9) As Integer
101 Let index = 100
102 For row = 1 To 10: For col = 1 To 9
103     Let xiabo(row, col) = index + 1
104     Let index = index + 1
105 Next col: Next row
106
107 Dim Shared shobo(9, 9) As Integer
108 Let index = 100
109 For row = 1 To 9: For col = 1 To 9
110     Let shobo(row, col) = index + 1
111     Let index = index + 1
112 Next col: Next row
113
114 Dim Shared drabo(10, 10) As Integer
115 Let index = 100
116 For row = 1 To 10: For col = 1 To 10
117     Let drabo(row, col) = index + 1
118     Let index = index + 1
119 Next col: Let index = index + 1: Next row
120
121 Line (2, 2)-(122, 4), 14, BF: Line -(120, 338), 14, BF: Line -(2, 336), 14, BF: Line -(4, 2), 14, BF
122 Line (4, 42)-(120, 44), 14, BF: Paint (20, 20), 8, 14
123 Line (128, 2)-(248, 4), 14, BF: Line -(246, 338), 14, BF: Line -(128, 336), 14, BF: Line -(130, 2), 14, BF
124 Line (130, 42)-(246, 44), 14, BF: Paint (160, 20), 8, 14
125 Line (254, 2)-(394, 4), 14, BF: Line -(392, 386), 14, BF: Line -(254, 384), 14, BF: Line -(256, 2), 14, BF
126 Line (256, 42)-(392, 44), 14, BF: Paint (300, 20), 8, 14
127 Line (400, 2)-(637, 4), 14, BF: Line -(635, 338), 14, BF: Line -(400, 336), 14, BF: Line -(402, 2), 14, BF
128 Line (402, 42)-(635, 44), 14, BF: Paint (440, 20), 8, 14
129 Line (2, 344)-(248, 346), 14, BF: Line -(246, 432), 14, BF: Line -(2, 430), 14, BF: Line -(4, 344), 14, BF
130 Line (4, 378)-(246, 376), 14, BF: Paint (20, 360), 8, 14
131 Color 14, 8: Locate 2, 4: Print "1 - Chess": Locate 2, 19: Print "2 - Makruk": Locate 2, 36: Print "3 - Xiangqi": Locate 2, 61: Print "4 - Shogi": Locate 23, 10: Print "5 - Draughts"
132 Color 12, 0: Locate 23, 52: Print "Press number to select game": Locate 24, 59: Print "or Esc to exit"
133
134 Color 11, 0
135 Let x = 10: For y = 50 To 300 Step 48
136     Call cells
137 Next y
138 Let x = 10: Let y = 50: Call king
139 Let x = 10: Let y = y + 48: Call queen
140 Let x = 10: Let y = y + 48: Call bishop
141 Let x = 10: Let y = y + 48: Call knight
142 Let x = 10: Let y = y + 48: Call rook
143 Let x = 10: Let y = y + 48: Call pawn
144 Locate 5, 9: Print "King": Locate 8, 9: Print "Queen"
145 Locate 11, 9: Print "Bishop": Locate 14, 9: Print "Knight"
146 Locate 17, 9: Print "Rook": Locate 20, 9: Print "Pawn"
147 Let x = 136: For y = 50 To 300 Step 48
148     Call cells
149 Next y
150 Let x = 136: Let y = 50: Call king
151 Let x = 136: Let y = y + 48: Call queen
152 Let x = 136: Let y = y + 48: Call bishop
153 Let x = 136: Let y = y + 48: Call knight
154 Let x = 136: Let y = y + 48: Call rook
155 Let x = 136: Let y = y + 48: Call checker
156 Locate 5, 25: Print "Lord": Locate 8, 25: Print "Seed"
157 Locate 11, 25: Print "Noble": Locate 14, 25: Print "Horse"
158 Locate 17, 25: Print "Boat": Locate 20, 25: Print "Shell"
159 Let x = 262: For y = 50 To 350 Step 48
160     Call cells
161 Next y
162 Let x = 262: Let y = 50: Call king
163 Let x = 262: Let y = y + 48: Call queen
164 Let x = 262: Let y = y + 48: Call bishop
165 Let x = 262: Let y = y + 48: Call knight
166 Let x = 262: Let y = y + 48: Call rook
167 Let x = 262: Let y = y + 48: Call cannon
168 Let x = 262: Let y = y + 48: Call pawn
169 Locate 5, 41: Print "General": Locate 8, 41: Print "Advisor"
170 Locate 11, 41: Print "Elephant": Locate 14, 41: Print "Horse"
171 Locate 17, 41: Print "Chariot": Locate 20, 41: Print "Cannon"
172 Locate 23, 41: Print "Soldier"
173 Let x = 408: For y = 50 To 300 Step 48
174     Call cells
175 Next y
176 Let x = 528: For y = 50 To 250 Step 48
177     Call cells
178 Next y
179 Let x = 408: Let y = 50: Call king
180 Let x = 408: Let y = y + 48: Call queen
181 Let x = 408: Let y = y + 48: Call general
182 Let x = 408: Let y = y + 48: Call bishop
183 Let x = 408: Let y = y + 48: Call knight
184 Let x = 408: Let y = y + 48: Call rook
185 Let x = 528: Let y = 50: Call lance
186 Let x = 528: Let y = y + 48: Call pawn
187 Let x = 528: Let y = y + 48: Call horse
188 Let x = 528: Let y = y + 48: Call dragon
189 Let x = 528: Let y = y + 48: Call tokin
190 Locate 5, 59: Print "King": Locate 8, 59: Print "Gold"
191 Locate 11, 59: Print "Silver": Locate 14, 59: Print "Bishop"
192 Locate 17, 59: Print "Knight": Locate 20, 59: Print "Rook"
193 Locate 5, 74: Print "Lance": Locate 8, 74: Print "Pawn"
194 Locate 11, 74: Print "Horse": Locate 14, 74: Print "Dragon"
195 Locate 17, 74: Print "Tokin"
196 Let x = 10: Let y = 384
197 Call cells: Call checker
198 Let x = 136: Let y = 384
199 Call cells: Call dame
200 Locate 26, 9: Print "Checker": Locate 26, 25: Print "Dame"
201
202 Do
203     Select Case InKey$
204         Case Is = Chr$(49)
205             Cls
206             Call message
207             Call chessboard
208             Call dices
209             Call chess
210         Case Is = Chr$(50)
211             Cls
212             Call message
213             Call makrukboard
214             Call dices
215             Call makruk
216         Case Is = Chr$(51)
217             Cls
218             Call message
219             Call xiangqiboard
220             Call dices
221             Call xiangqi
222         Case Is = Chr$(52)
223             Cls
224             Call message
225             Call shogiboard
226             Call dices
227             Call shogi
228         Case Is = Chr$(53)
229             Cls
230             Call message
231             Call draughtsboard
232             Call dices
233             Call draughts
234         Case Is = Chr$(27)
235             Exit Do
236     End Select
237 Loop
238 End
239
240 Sub dice1
241     Line (x, y)-(40 + x, 40 + y), cd1, BF
242     Line (16 + x, 16 + y)-(24 + x, 24 + y), cd2, BF
243 End Sub
244
245 Sub dice2
246     Line (x, y)-(40 + x, 40 + y), cd1, BF
247     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
248     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
249 End Sub
250
251 Sub dice3
252     Line (x, y)-(40 + x, 40 + y), cd1, BF
253     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
254     Line (16 + x, 16 + y)-(24 + x, 24 + y), cd2, BF
255     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
256 End Sub
257
258 Sub dice4
259     Line (x, y)-(40 + x, 40 + y), cd1, BF
260     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
261     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
262     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
263     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
264 End Sub
265
266 Sub dice5
267     Line (x, y)-(40 + x, 40 + y), cd1, BF
268     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
269     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
270     Line (16 + x, 16 + y)-(24 + x, 24 + y), cd2, BF
271     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
272     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
273 End Sub
274
275 Sub dice6
276     Line (x, y)-(40 + x, 40 + y), cd1, BF
277     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
278     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
279     Line (4 + x, 16 + y)-(12 + x, 24 + y), cd2, BF
280     Line (28 + x, 16 + y)-(36 + x, 24 + y), cd2, BF
281     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
282     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
283 End Sub
284
285 Sub dice7
286     Line (x, y)-(40 + x, 40 + y), cd1, BF
287     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
288     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
289     Line (4 + x, 16 + y)-(12 + x, 24 + y), cd2, BF
290     Line (16 + x, 16 + y)-(24 + x, 24 + y), cd2, BF
291     Line (28 + x, 16 + y)-(36 + x, 24 + y), cd2, BF
292     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
293     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
294 End Sub
295
296 Sub dice8
297     Line (x, y)-(40 + x, 40 + y), cd1, BF
298     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
299     Line (16 + x, 4 + y)-(24 + x, 12 + y), cd2, BF
300     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
301     Line (4 + x, 16 + y)-(12 + x, 24 + y), cd2, BF
302     Line (28 + x, 16 + y)-(36 + x, 24 + y), cd2, BF
303     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
304     Line (16 + x, 28 + y)-(24 + x, 36 + y), cd2, BF
305     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
306 End Sub
307
308 Sub dice9
309     Line (x, y)-(40 + x, 40 + y), cd1, BF
310     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
311     Line (16 + x, 4 + y)-(24 + x, 12 + y), cd2, BF
312     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
313     Line (4 + x, 16 + y)-(12 + x, 24 + y), cd2, BF
314     Line (16 + x, 16 + y)-(24 + x, 24 + y), cd2, BF
315     Line (28 + x, 16 + y)-(36 + x, 24 + y), cd2, BF
316     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
317     Line (16 + x, 28 + y)-(24 + x, 36 + y), cd2, BF
318     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
319 End Sub
320
321 Sub dice0
322     Line (x, y)-(40 + x, 40 + y), cd1, BF
323     Line (4 + x, 4 + y)-(12 + x, 12 + y), cd2, BF
324     Line (28 + x, 4 + y)-(36 + x, 12 + y), cd2, BF
325     Line (4 + x, 16 + y)-(12 + x, 24 + y), cd2, BF
326     Line (28 + x, 16 + y)-(36 + x, 24 + y), cd2, BF
327     Line (4 + x, 28 + y)-(12 + x, 36 + y), cd2, BF
328     Line (28 + x, 28 + y)-(36 + x, 36 + y), cd2, BF
329     Line (16 + x, 1 + y)-(24 + x, 9 + y), cd2, BF
330     Line (16 + x, 11 + y)-(24 + x, 19 + y), cd2, BF
331     Line (16 + x, 21 + y)-(24 + x, 29 + y), cd2, BF
332     Line (16 + x, 31 + y)-(24 + x, 39 + y), cd2, BF
333 End Sub
334
335 Sub number1
336     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
337     Line (5 + x, 8 + y)-(6 + x, 1 + y), cn, BF
338     Line (4 + x, 2 + y)-(1 + x, 5 + y), cn
339     Line (4 + x, 3 + y)-(1 + x, 6 + y), cn
340 End Sub
341
342 Sub number2
343     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
344     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
345     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
346     Line (1 + x, 8 + y)-(2 + x, 7 + y), cn, BF
347     Line (10 + x, 4 + y)-(9 + x, 3 + y), cn, BF
348 End Sub
349
350 Sub number3
351     Line (2 + x, 2 + y)-(9 + x, 1 + y), cn, BF
352     Line (2 + x, 10 + y)-(9 + x, 9 + y), cn, BF
353     Line (5 + x, 5 + y)-(9 + x, 6 + y), cn, BF
354     Line (9 + x, 2 + y)-(10 + x, 4 + y), cn, BF
355     Line (9 + x, 7 + y)-(10 + x, 9 + y), cn, BF
356 End Sub
357
358 Sub number4
359     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
360     Line (1 + x, 1 + y)-(2 + x, 4 + y), cn, BF
361     Line (9 + x, 1 + y)-(10 + x, 10 + y), cn, BF
362 End Sub
363
364 Sub number5
365     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
366     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
367     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
368     Line (10 + x, 8 + y)-(9 + x, 7 + y), cn, BF
369     Line (2 + x, 4 + y)-(1 + x, 3 + y), cn, BF
370 End Sub
371
372 Sub number6
373     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
374     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
375     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
376     Line (10 + x, 8 + y)-(9 + x, 7 + y), cn, BF
377     Line (1 + x, 8 + y)-(2 + x, 3 + y), cn, BF
378 End Sub
379
380 Sub number7
381     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
382     Line (10 + x, 3 + y)-(3 + x, 10 + y), cn
383     Line (9 + x, 3 + y)-(2 + x, 10 + y), cn
384     Line (8 + x, 3 + y)-(1 + x, 10 + y), cn
385 End Sub
386
387 Sub number8
388     Line (2 + x, 2 + y)-(9 + x, 1 + y), cn, BF
389     Line (2 + x, 10 + y)-(9 + x, 9 + y), cn, BF
390     Line (2 + x, 6 + y)-(9 + x, 5 + y), cn, BF
391     Line (1 + x, 2 + y)-(2 + x, 4 + y), cn, BF
392     Line (1 + x, 7 + y)-(2 + x, 9 + y), cn, BF
393     Line (9 + x, 2 + y)-(10 + x, 4 + y), cn, BF
394     Line (9 + x, 7 + y)-(10 + x, 9 + y), cn, BF
395 End Sub
396
397 Sub number9
398     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
399     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
400     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
401     Line (10 + x, 8 + y)-(9 + x, 3 + y), cn, BF
402     Line (2 + x, 4 + y)-(1 + x, 3 + y), cn, BF
403 End Sub
404
405 Sub number0
406     Line (2 + x, 2 + y)-(9 + x, 1 + y), cn, BF
407     Line (2 + x, 10 + y)-(9 + x, 9 + y), cn, BF
408     Line (1 + x, 2 + y)-(2 + x, 9 + y), cn, BF
409     Line (9 + x, 2 + y)-(10 + x, 9 + y), cn, BF
410 End Sub
411
412 Sub numberA
413     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
414     Line (1 + x, 2 + y)-(2 + x, 10 + y), cn, BF
415     Line (9 + x, 2 + y)-(10 + x, 10 + y), cn, BF
416     Line (2 + x, 2 + y)-(9 + x, 1 + y), cn, BF
417 End Sub
418
419 Sub numberB
420     Line (1 + x, 1 + y)-(2 + x, 10 + y), cn, BF
421     Line (1 + x, 10 + y)-(9 + x, 9 + y), cn, BF
422     Line (1 + x, 6 + y)-(9 + x, 5 + y), cn, BF
423     Line (1 + x, 2 + y)-(9 + x, 1 + y), cn, BF
424     Line (9 + x, 2 + y)-(10 + x, 4 + y), cn, BF
425     Line (9 + x, 7 + y)-(10 + x, 9 + y), cn, BF
426 End Sub
427
428 Sub numberC
429     Line (1 + x, 1 + y)-(2 + x, 10 + y), cn, BF
430     Line (1 + x, 1 + y)-(10 + x, 2 + y), cn, BF
431     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
432 End Sub
433
434 Sub numberD
435     Line (2 + x, 2 + y)-(9 + x, 1 + y), cn, BF
436     Line (2 + x, 10 + y)-(9 + x, 9 + y), cn, BF
437     Line (1 + x, 1 + y)-(2 + x, 10 + y), cn, BF
438     Line (9 + x, 2 + y)-(10 + x, 9 + y), cn, BF
439 End Sub
440
441 Sub numberE
442     Line (1 + x, 1 + y)-(2 + x, 10 + y), cn, BF
443     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
444     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
445     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
446 End Sub
447
448 Sub numberF
449     Line (1 + x, 1 + y)-(2 + x, 10 + y), cn, BF
450     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
451     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
452 End Sub
453
454 Sub numberG
455     Line (1 + x, 10 + y)-(10 + x, 9 + y), cn, BF
456     Line (8 + x, 6 + y)-(6 + x, 5 + y), cn, BF
457     Line (1 + x, 2 + y)-(10 + x, 1 + y), cn, BF
458     Line (10 + x, 8 + y)-(9 + x, 5 + y), cn, BF
459     Line (1 + x, 8 + y)-(2 + x, 3 + y), cn, BF
460 End Sub
461
462 Sub numberH
463     Line (1 + x, 6 + y)-(10 + x, 5 + y), cn, BF
464     Line (1 + x, 1 + y)-(2 + x, 10 + y), cn, BF
465     Line (9 + x, 1 + y)-(10 + x, 10 + y), cn, BF
466 End Sub
467
468 Sub numberI
469     Line (3 + x, 2 + y)-(8 + x, 1 + y), cn, BF
470     Line (3 + x, 10 + y)-(8 + x, 9 + y), cn, BF
471     Line (5 + x, 3 + y)-(6 + x, 8 + y), cn, BF
472 End Sub
473
474 Sub numberJ
475     Line (1 + x, 6 + y)-(2 + x, 9 + y), cn, BF
476     Line (9 + x, 1 + y)-(10 + x, 9 + y), cn, BF
477     Line (2 + x, 9 + y)-(9 + x, 10 + y), cn, BF
478 End Sub
479
480 Sub letter1
481     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
482     Line (18 + x, 31 + y)-(22 + x, 4 + y), cl, BF
483     Line (17 + x, 4 + y)-(4 + x, 17 + y), cl
484     Line (17 + x, 5 + y)-(5 + x, 17 + y), cl
485     Line (17 + x, 6 + y)-(6 + x, 17 + y), cl
486     Line (17 + x, 7 + y)-(7 + x, 17 + y), cl
487 End Sub
488
489 Sub letter2
490     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
491     Line (4 + x, 18 + y)-(36 + x, 22 + y), cl, BF
492     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
493     Line (32 + x, 9 + y)-(36 + x, 17 + y), cl, BF
494     Line (4 + x, 23 + y)-(8 + x, 31 + y), cl, BF
495 End Sub
496
497 Sub letter3
498     Line (4 + x, 4 + y)-(34 + x, 8 + y), cl, BF
499     Line (4 + x, 36 + y)-(34 + x, 32 + y), cl, BF
500     Line (36 + x, 23 + y)-(32 + x, 34 + y), cl, BF
501     Line (32 + x, 6 + y)-(36 + x, 17 + y), cl, BF
502     Line (18 + x, 18 + y)-(34 + x, 22 + y), cl, BF
503     Line (30 + x, 17 + y)-(31 + x, 17 + y), cl
504     Line (30 + x, 23 + y)-(31 + x, 23 + y), cl
505     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
506     Line (30 + x, 31 + y)-(31 + x, 31 + y), cl
507     PSet (31 + x, 10 + y), cl: PSet (31 + x, 30 + y), cl
508     PSet (31 + x, 16 + y), cl: PSet (31 + x, 24 + y), cl
509     PSet (35 + x, 18 + y), cl: PSet (35 + x, 22 + y), cl
510     PSet (35 + x, 5 + y), cl: PSet (35 + x, 35 + y), cl
511 End Sub
512
513 Sub letter4
514     Line (4 + x, 4 + y)-(8 + x, 17 + y), cl, BF
515     Line (32 + x, 4 + y)-(36 + x, 36 + y), cl, BF
516     Line (4 + x, 18 + y)-(34 + x, 22 + y), cl, BF
517 End Sub
518
519 Sub letter5
520     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
521     Line (4 + x, 18 + y)-(36 + x, 22 + y), cl, BF
522     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
523     Line (4 + x, 9 + y)-(8 + x, 17 + y), cl, BF
524     Line (32 + x, 23 + y)-(36 + x, 31 + y), cl, BF
525 End Sub
526
527 Sub letter6
528     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
529     Line (4 + x, 18 + y)-(36 + x, 22 + y), cl, BF
530     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
531     Line (4 + x, 9 + y)-(8 + x, 31 + y), cl, BF
532     Line (32 + x, 23 + y)-(36 + x, 31 + y), cl, BF
533 End Sub
534
535 Sub letter7
536     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
537     Line (8 + x, 36 + y)-(35 + x, 9 + y), cl
538     Line (7 + x, 36 + y)-(34 + x, 9 + y), cl
539     Line (6 + x, 36 + y)-(33 + x, 9 + y), cl
540     Line (5 + x, 36 + y)-(32 + x, 9 + y), cl
541 End Sub
542
543 Sub letter8
544     Line (8 + x, 23 + y)-(4 + x, 34 + y), cl, BF
545     Line (4 + x, 6 + y)-(8 + x, 17 + y), cl, BF
546     Line (6 + x, 4 + y)-(34 + x, 8 + y), cl, BF
547     Line (6 + x, 36 + y)-(34 + x, 32 + y), cl, BF
548     Line (36 + x, 23 + y)-(32 + x, 34 + y), cl, BF
549     Line (32 + x, 6 + y)-(36 + x, 17 + y), cl, BF
550     Line (6 + x, 18 + y)-(34 + x, 22 + y), cl, BF
551     Line (30 + x, 17 + y)-(31 + x, 17 + y), cl
552     Line (30 + x, 23 + y)-(31 + x, 23 + y), cl
553     Line (10 + x, 17 + y)-(9 + x, 17 + y), cl
554     Line (10 + x, 23 + y)-(9 + x, 23 + y), cl
555     Line (9 + x, 31 + y)-(10 + x, 31 + y), cl
556     Line (30 + x, 31 + y)-(31 + x, 31 + y), cl
557     Line (9 + x, 9 + y)-(10 + x, 9 + y), cl
558     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
559     PSet (35 + x, 5 + y), cl: PSet (35 + x, 35 + y), cl
560     PSet (5 + x, 5 + y), cl: PSet (5 + x, 35 + y), cl
561     PSet (9 + x, 30 + y), cl: PSet (31 + x, 30 + y), cl
562     PSet (9 + x, 10 + y), cl: PSet (31 + x, 10 + y), cl
563     PSet (5 + x, 18 + y), cl: PSet (5 + x, 22 + y), cl
564     PSet (9 + x, 16 + y), cl: PSet (9 + x, 24 + y), cl
565     PSet (31 + x, 16 + y), cl: PSet (31 + x, 24 + y), cl
566     PSet (35 + x, 18 + y), cl: PSet (35 + x, 22 + y), cl
567 End Sub
568
569 Sub letter9
570     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
571     Line (4 + x, 18 + y)-(36 + x, 22 + y), cl, BF
572     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
573     Line (32 + x, 9 + y)-(36 + x, 31 + y), cl, BF
574 End Sub
575
576 Sub letter0
577     Line (6 + x, 4 + y)-(34 + x, 8 + y), cl, BF
578     Line (6 + x, 36 + y)-(34 + x, 32 + y), cl, BF
579     Line (4 + x, 6 + y)-(8 + x, 34 + y), cl, BF
580     Line (36 + x, 6 + y)-(32 + x, 34 + y), cl, BF
581     Line (9 + x, 9 + y)-(10 + x, 9 + y), cl
582     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
583     Line (9 + x, 31 + y)-(10 + x, 31 + y), cl
584     Line (30 + x, 31 + y)-(31 + x, 31 + y), cl
585     Line (9 + x, 9 + y)-(10 + x, 9 + y), cl
586     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
587     PSet (35 + x, 5 + y), cl: PSet (35 + x, 35 + y), cl
588     PSet (5 + x, 5 + y), cl: PSet (5 + x, 35 + y), cl
589     PSet (9 + x, 30 + y), cl: PSet (31 + x, 30 + y), cl
590     PSet (9 + x, 10 + y), cl: PSet (31 + x, 10 + y), cl
591 End Sub
592
593 Sub letterA
594     Line (4 + x, 6 + y)-(8 + x, 36 + y), cl, BF
595     Line (32 + x, 6 + y)-(36 + x, 36 + y), cl, BF
596     Line (4 + x, 18 + y)-(34 + x, 22 + y), cl, BF
597     Line (6 + x, 4 + y)-(34 + x, 8 + y), cl, BF
598     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
599     Line (9 + x, 9 + y)-(10 + x, 9 + y), cl
600     PSet (9 + x, 10 + y), cl: PSet (31 + x, 10 + y), cl
601     PSet (5 + x, 5 + y), cl: PSet (35 + x, 5 + y), cl
602 End Sub
603
604 Sub letterB
605     Line (4 + x, 9 + y)-(8 + x, 31 + y), cl, BF
606     Line (4 + x, 4 + y)-(34 + x, 8 + y), cl, BF
607     Line (4 + x, 36 + y)-(34 + x, 32 + y), cl, BF
608     Line (36 + x, 23 + y)-(32 + x, 34 + y), cl, BF
609     Line (32 + x, 6 + y)-(36 + x, 17 + y), cl, BF
610     Line (9 + x, 18 + y)-(34 + x, 22 + y), cl, BF
611     Line (30 + x, 17 + y)-(31 + x, 17 + y), cl
612     Line (30 + x, 23 + y)-(31 + x, 23 + y), cl
613     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
614     Line (30 + x, 31 + y)-(31 + x, 31 + y), cl
615     PSet (31 + x, 10 + y), cl: PSet (31 + x, 30 + y), cl
616     PSet (31 + x, 16 + y), cl: PSet (31 + x, 24 + y), cl
617     PSet (35 + x, 18 + y), cl: PSet (35 + x, 22 + y), cl
618     PSet (35 + x, 5 + y), cl: PSet (35 + x, 35 + y), cl
619 End Sub
620
621 Sub letterC
622     Line (6 + x, 4 + y)-(36 + x, 8 + y), cl, BF
623     Line (6 + x, 36 + y)-(36 + x, 32 + y), cl, BF
624     Line (4 + x, 6 + y)-(8 + x, 34 + y), cl, BF
625     Line (9 + x, 9 + y)-(10 + x, 9 + y), cl
626     Line (9 + x, 31 + y)-(10 + x, 31 + y), cl
627     PSet (9 + x, 10 + y), cl: PSet (9 + x, 30 + y), cl
628     PSet (5 + x, 5 + y), cl: PSet (5 + x, 35 + y), cl
629 End Sub
630
631 Sub letterD
632     Line (4 + x, 4 + y)-(34 + x, 8 + y), cl, BF
633     Line (4 + x, 36 + y)-(34 + x, 32 + y), cl, BF
634     Line (4 + x, 4 + y)-(8 + x, 36 + y), cl, BF
635     Line (32 + x, 6 + y)-(36 + x, 34 + y), cl, BF
636     Line (30 + x, 9 + y)-(31 + x, 9 + y), cl
637     Line (30 + x, 31 + y)-(31 + x, 31 + y), cl
638     PSet (31 + x, 10 + y), cl: PSet (31 + x, 30 + y), cl
639     PSet (35 + x, 5 + y), cl: PSet (35 + x, 35 + y), cl
640 End Sub
641
642 Sub letterE
643     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
644     Line (4 + x, 18 + y)-(36 + x, 22 + y), cl, BF
645     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
646     Line (4 + x, 4 + y)-(8 + x, 36 + y), cl, BF
647 End Sub
648
649 Sub letterF
650     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
651     Line (4 + x, 18 + y)-(36 + x, 22 + y), cl, BF
652     Line (4 + x, 4 + y)-(8 + x, 36 + y), cl, BF
653 End Sub
654
655 Sub letterG
656     Line (4 + x, 4 + y)-(36 + x, 8 + y), cl, BF
657     Line (20 + x, 18 + y)-(36 + x, 22 + y), cl, BF
658     Line (4 + x, 36 + y)-(36 + x, 32 + y), cl, BF
659     Line (4 + x, 9 + y)-(8 + x, 31 + y), cl, BF
660     Line (32 + x, 23 + y)-(36 + x, 31 + y), cl, BF
661 End Sub
662
663 Sub letterH
664     Line (4 + x, 4 + y)-(8 + x, 36 + y), cl, BF
665     Line (32 + x, 4 + y)-(36 + x, 36 + y), cl, BF
666     Line (4 + x, 18 + y)-(34 + x, 22 + y), cl, BF
667 End Sub
668
669 Sub letterI
670     Line (8 + x, 36 + y)-(32 + x, 32 + y), cl, BF
671     Line (18 + x, 31 + y)-(22 + x, 9 + y), cl, BF
672     Line (8 + x, 8 + y)-(32 + x, 3 + y), cl, BF
673 End Sub
674
675 Sub letterJ
676     Line (6 + x, 36 + y)-(34 + x, 32 + y), cl, BF
677     Line (32 + x, 4 + y)-(36 + x, 34 + y), cl, BF
678     Line (4 + x, 18 + y)-(8 + x, 34 + y), cl, BF
679     Line (9 + x, 31 + y)-(10 + x, 31 + y), cl
680     Line (30 + x, 31 + y)-(31 + x, 31 + y), cl
681     PSet (9 + x, 30 + y), cl: PSet (31 + x, 30 + y), cl
682     PSet (5 + x, 35 + y), cl: PSet (35 + x, 35 + y), cl
683 End Sub
684
685 Sub king
686     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
687     Line (12 + x, 31 + y)-(28 + x, 31 + y), cf
688     Line (13 + x, 30 + y)-(27 + x, 30 + y), cf
689     Line (14 + x, 29 + y)-(26 + x, 29 + y), cf
690     Line (15 + x, 28 + y)-(25 + x, 28 + y), cf
691     Line (16 + x, 27 + y)-(24 + x, 10 + y), cf, BF
692     Line (15 + x, 24 + y)-(25 + x, 24 + y), cf
693     Line (14 + x, 23 + y)-(26 + x, 23 + y), cf
694     Line (13 + x, 22 + y)-(27 + x, 22 + y), cf
695     Line (12 + x, 21 + y)-(28 + x, 21 + y), cf
696     Line (11 + x, 20 + y)-(29 + x, 20 + y), cf
697     Line (10 + x, 19 + y)-(30 + x, 19 + y), cf
698     Line (9 + x, 18 + y)-(31 + x, 18 + y), cf
699     Line (8 + x, 17 + y)-(32 + x, 17 + y), cf
700     Line (7 + x, 16 + y)-(33 + x, 16 + y), cf
701     Line (6 + x, 15 + y)-(34 + x, 15 + y), cf
702     Line (5 + x, 14 + y)-(35 + x, 14 + y), cf
703     Line (4 + x, 13 + y)-(36 + x, 12 + y), cf, BF
704     Line (4 + x, 11 + y)-(14 + x, 10 + y), cf, BF
705     Line (5 + x, 9 + y)-(13 + x, 9 + y), cf
706     Line (6 + x, 8 + y)-(12 + x, 8 + y), cf
707     Line (7 + x, 7 + y)-(11 + x, 7 + y), cf
708     Line (26 + x, 11 + y)-(36 + x, 10 + y), cf, BF
709     Line (27 + x, 9 + y)-(35 + x, 9 + y), cf
710     Line (28 + x, 8 + y)-(34 + x, 8 + y), cf
711     Line (29 + x, 7 + y)-(33 + x, 7 + y), cf
712     Line (17 + x, 9 + y)-(23 + x, 8 + y), cf, BF
713     Line (18 + x, 7 + y)-(22 + x, 6 + y), cf, BF
714     Line (19 + x, 5 + y)-(21 + x, 4 + y), cf, BF
715 End Sub
716
717 Sub queen
718     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
719     Line (9 + x, 31 + y)-(31 + x, 31 + y), cf
720     Line (10 + x, 30 + y)-(30 + x, 30 + y), cf
721     Line (11 + x, 29 + y)-(29 + x, 29 + y), cf
722     Line (12 + x, 28 + y)-(28 + x, 14 + y), cf, BF
723     Line (11 + x, 24 + y)-(29 + x, 24 + y), cf
724     Line (10 + x, 23 + y)-(30 + x, 23 + y), cf
725     Line (9 + x, 22 + y)-(31 + x, 22 + y), cf
726     Line (8 + x, 21 + y)-(32 + x, 21 + y), cf
727     Line (7 + x, 20 + y)-(33 + x, 20 + y), cf
728     Line (6 + x, 19 + y)-(34 + x, 18 + y), cf, BF
729     Line (6 + x, 17 + y)-(7 + x, 10 + y), cf, BF
730     Line (5 + x, 11 + y)-(8 + x, 14 + y), cf, BF
731     Line (4 + x, 12 + y)-(9 + x, 13 + y), cf, BF
732     Line (34 + x, 17 + y)-(33 + x, 10 + y), cf, BF
733     Line (35 + x, 11 + y)-(32 + x, 14 + y), cf, BF
734     Line (36 + x, 12 + y)-(31 + x, 13 + y), cf, BF
735     Line (12 + x, 13 + y)-(13 + x, 6 + y), cf, BF
736     Line (11 + x, 7 + y)-(14 + x, 10 + y), cf, BF
737     Line (10 + x, 8 + y)-(15 + x, 9 + y), cf, BF
738     Line (27 + x, 13 + y)-(28 + x, 6 + y), cf, BF
739     Line (26 + x, 7 + y)-(29 + x, 10 + y), cf, BF
740     Line (25 + x, 8 + y)-(30 + x, 9 + y), cf, BF
741     Line (19 + x, 13 + y)-(21 + x, 4 + y), cf, BF
742     Line (18 + x, 5 + y)-(22 + x, 8 + y), cf, BF
743     Line (17 + x, 6 + y)-(23 + x, 7 + y), cf, BF
744 End Sub
745
746 Sub bishop
747     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
748     Line (18 + x, 31 + y)-(22 + x, 6 + y), cf, BF
749     Line (19 + x, 5 + y)-(21 + x, 4 + y), cf, BF
750     Line (12 + x, 31 + y)-(28 + x, 31 + y), cf
751     Line (13 + x, 30 + y)-(27 + x, 30 + y), cf
752     Line (14 + x, 29 + y)-(26 + x, 29 + y), cf
753     Line (15 + x, 28 + y)-(25 + x, 28 + y), cf
754     Line (16 + x, 27 + y)-(24 + x, 27 + y), cf
755     Line (17 + x, 26 + y)-(23 + x, 26 + y), cf
756     Line (17 + x, 21 + y)-(23 + x, 8 + y), cf, BF
757     Line (16 + x, 19 + y)-(24 + x, 10 + y), cf, BF
758     Line (15 + x, 17 + y)-(25 + x, 12 + y), cf, BF
759     Line (14 + x, 15 + y)-(26 + x, 14 + y), cf, BF
760 End Sub
761
762 Sub knight
763     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
764     Line (12 + x, 31 + y)-(28 + x, 31 + y), cf
765     Line (13 + x, 30 + y)-(29 + x, 30 + y), cf
766     Line (14 + x, 29 + y)-(30 + x, 29 + y), cf
767     Line (15 + x, 28 + y)-(31 + x, 28 + y), cf
768     Line (16 + x, 27 + y)-(32 + x, 27 + y), cf
769     Line (17 + x, 26 + y)-(33 + x, 26 + y), cf
770     Line (18 + x, 25 + y)-(34 + x, 25 + y), cf
771     Line (19 + x, 24 + y)-(35 + x, 24 + y), cf
772     Line (20 + x, 23 + y)-(36 + x, 18 + y), cf, BF
773     Line (4 + x, 17 + y)-(35 + x, 17 + y), cf
774     Line (4 + x, 16 + y)-(34 + x, 16 + y), cf
775     Line (5 + x, 15 + y)-(33 + x, 15 + y), cf
776     Line (6 + x, 14 + y)-(32 + x, 14 + y), cf
777     Line (7 + x, 13 + y)-(31 + x, 13 + y), cf
778     Line (8 + x, 12 + y)-(30 + x, 12 + y), cf
779     Line (9 + x, 11 + y)-(29 + x, 11 + y), cf
780     Line (10 + x, 10 + y)-(28 + x, 10 + y), cf
781     Line (11 + x, 9 + y)-(27 + x, 9 + y), cf
782     Line (12 + x, 8 + y)-(26 + x, 8 + y), cf
783     Line (13 + x, 7 + y)-(25 + x, 7 + y), cf
784     Line (14 + x, 6 + y)-(24 + x, 6 + y), cf
785     Line (15 + x, 5 + y)-(23 + x, 5 + y), cf
786     Line (16 + x, 4 + y)-(22 + x, 4 + y), cf
787 End Sub
788
789 Sub rook
790     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
791     Line (4 + x, 4 + y)-(8 + x, 12 + y), cf, BF
792     Line (13 + x, 4 + y)-(17 + x, 12 + y), cf, BF
793     Line (23 + x, 4 + y)-(27 + x, 12 + y), cf, BF
794     Line (32 + x, 4 + y)-(36 + x, 12 + y), cf, BF
795     Line (4 + x, 12 + y)-(36 + x, 16 + y), cf, BF
796     Line (12 + x, 16 + y)-(28 + x, 32 + y), cf, BF
797     Line (9 + x, 16 + y)-(11 + x, 16 + y), cf
798     Line (29 + x, 16 + y)-(31 + x, 16 + y), cf
799     Line (10 + x, 17 + y)-(11 + x, 17 + y), cf
800     Line (29 + x, 17 + y)-(30 + x, 17 + y), cf
801     PSet (11 + x, 18 + y), cf: PSet (29 + x, 18 + y), cf
802     Line (9 + x, 31 + y)-(11 + x, 31 + y), cf
803     Line (29 + x, 31 + y)-(31 + x, 31 + y), cf
804     Line (10 + x, 30 + y)-(11 + x, 30 + y), cf
805     Line (29 + x, 30 + y)-(30 + x, 30 + y), cf
806     PSet (11 + x, 29 + y), cf: PSet (29 + x, 29 + y), cf
807 End Sub
808
809 Sub pawn
810     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
811     Line (18 + x, 32 + y)-(22 + x, 4 + y), cf, BF
812     Line (12 + x, 9 + y)-(28 + x, 14 + y), cf, BF
813     Line (9 + x, 31 + y)-(31 + x, 31 + y), cf
814     Line (10 + x, 30 + y)-(30 + x, 30 + y), cf
815     Line (11 + x, 29 + y)-(29 + x, 29 + y), cf
816     Line (12 + x, 28 + y)-(28 + x, 28 + y), cf
817     Line (13 + x, 27 + y)-(27 + x, 27 + y), cf
818     Line (14 + x, 26 + y)-(26 + x, 26 + y), cf
819     Line (15 + x, 25 + y)-(25 + x, 25 + y), cf
820     Line (16 + x, 24 + y)-(24 + x, 24 + y), cf
821     Line (17 + x, 23 + y)-(23 + x, 23 + y), cf
822     Line (17 + x, 19 + y)-(23 + x, 19 + y), cf
823     Line (16 + x, 18 + y)-(24 + x, 18 + y), cf
824     Line (15 + x, 17 + y)-(25 + x, 17 + y), cf
825     Line (14 + x, 16 + y)-(26 + x, 16 + y), cf
826     Line (13 + x, 15 + y)-(27 + x, 15 + y), cf
827     Line (13 + x, 8 + y)-(27 + x, 8 + y), cf
828     Line (14 + x, 7 + y)-(26 + x, 7 + y), cf
829     Line (15 + x, 6 + y)-(25 + x, 6 + y), cf
830     Line (16 + x, 5 + y)-(24 + x, 5 + y), cf
831     Line (17 + x, 4 + y)-(23 + x, 4 + y), cf
832 End Sub
833
834 Sub cannon
835     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
836     Line (9 + x, 31 + y)-(31 + x, 31 + y), cf
837     Line (10 + x, 30 + y)-(30 + x, 30 + y), cf
838     Line (11 + x, 29 + y)-(29 + x, 29 + y), cf
839     Line (12 + x, 28 + y)-(28 + x, 28 + y), cf
840     Line (13 + x, 27 + y)-(27 + x, 27 + y), cf
841     Line (14 + x, 26 + y)-(26 + x, 26 + y), cf
842     Line (15 + x, 25 + y)-(25 + x, 25 + y), cf
843     Line (16 + x, 24 + y)-(24 + x, 4 + y), cf, BF
844     Line (6 + x, 9 + y)-(36 + x, 12 + y), cf, BF
845     Line (4 + x, 10 + y)-(6 + x, 11 + y), cf, BF
846     Line (14 + x, 16 + y)-(25 + x, 16 + y), cf
847     Line (12 + x, 15 + y)-(26 + x, 15 + y), cf
848     Line (10 + x, 14 + y)-(27 + x, 14 + y), cf
849     Line (8 + x, 13 + y)-(28 + x, 13 + y), cf
850     Line (8 + x, 8 + y)-(28 + x, 8 + y), cf
851     Line (10 + x, 7 + y)-(27 + x, 7 + y), cf
852     Line (12 + x, 6 + y)-(26 + x, 6 + y), cf
853     Line (14 + x, 5 + y)-(25 + x, 5 + y), cf
854     Line (16 + x, 4 + y)-(24 + x, 4 + y), cf
855 End Sub
856
857 Sub general
858     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
859     Line (9 + x, 31 + y)-(31 + x, 31 + y), cf
860     Line (10 + x, 30 + y)-(30 + x, 30 + y), cf
861     Line (11 + x, 29 + y)-(29 + x, 29 + y), cf
862     Line (12 + x, 28 + y)-(28 + x, 28 + y), cf
863     Line (13 + x, 27 + y)-(27 + x, 27 + y), cf
864     Line (14 + x, 26 + y)-(26 + x, 26 + y), cf
865     Line (13 + x, 25 + y)-(27 + x, 22 + y), cf, BF
866     Line (16 + x, 21 + y)-(24 + x, 20 + y), cf, BF
867     Line (18 + x, 19 + y)-(22 + x, 12 + y), cf, BF
868     Line (19 + x, 11 + y)-(21 + x, 4 + y), cf, BF
869     Line (18 + x, 10 + y)-(22 + x, 5 + y), cf, BF
870     Line (17 + x, 9 + y)-(23 + x, 6 + y), cf, BF
871     Line (16 + x, 8 + y)-(24 + x, 7 + y), cf, BF
872     Line (15 + x, 20 + y)-(16 + x, 19 + y), cf, BF
873     Line (14 + x, 19 + y)-(15 + x, 18 + y), cf, BF
874     Line (13 + x, 18 + y)-(14 + x, 17 + y), cf, BF
875     Line (24 + x, 20 + y)-(25 + x, 19 + y), cf, BF
876     Line (25 + x, 19 + y)-(26 + x, 18 + y), cf, BF
877     Line (26 + x, 18 + y)-(27 + x, 17 + y), cf, BF
878     Line (11 + x, 18 + y)-(12 + x, 11 + y), cf, BF
879     Line (10 + x, 17 + y)-(13 + x, 12 + y), cf, BF
880     Line (9 + x, 16 + y)-(14 + x, 13 + y), cf, BF
881     Line (8 + x, 15 + y)-(15 + x, 14 + y), cf, BF
882     Line (28 + x, 18 + y)-(29 + x, 11 + y), cf, BF
883     Line (27 + x, 17 + y)-(30 + x, 12 + y), cf, BF
884     Line (26 + x, 16 + y)-(31 + x, 13 + y), cf, BF
885     Line (25 + x, 15 + y)-(32 + x, 14 + y), cf, BF
886     Line (4 + x, 24 + y)-(36 + x, 23 + y), cf, BF
887     Line (29 + x, 25 + y)-(35 + x, 22 + y), cf, BF
888     Line (30 + x, 26 + y)-(34 + x, 21 + y), cf, BF
889     Line (31 + x, 27 + y)-(33 + x, 20 + y), cf, BF
890     Line (5 + x, 25 + y)-(11 + x, 22 + y), cf, BF
891     Line (6 + x, 26 + y)-(10 + x, 21 + y), cf, BF
892     Line (7 + x, 27 + y)-(9 + x, 20 + y), cf, BF
893 End Sub
894
895 Sub tokin
896     Line (10 + x, 10 + y)-(30 + x, 30 + y), cf, BF
897     Line (4 + x, 4 + y)-(5 + x, 5 + y), cf, BF
898     Line (5 + x, 5 + y)-(7 + x, 7 + y), cf, BF
899     Line (6 + x, 6 + y)-(9 + x, 9 + y), cf, BF
900     Line (7 + x, 7 + y)-(11 + x, 11 + y), cf, BF
901     Line (8 + x, 8 + y)-(12 + x, 12 + y), cf, BF
902     Line (36 + x, 4 + y)-(35 + x, 5 + y), cf, BF
903     Line (35 + x, 5 + y)-(33 + x, 7 + y), cf, BF
904     Line (34 + x, 6 + y)-(31 + x, 9 + y), cf, BF
905     Line (33 + x, 7 + y)-(29 + x, 11 + y), cf, BF
906     Line (32 + x, 8 + y)-(28 + x, 12 + y), cf, BF
907     Line (36 + x, 36 + y)-(35 + x, 35 + y), cf, BF
908     Line (35 + x, 35 + y)-(33 + x, 33 + y), cf, BF
909     Line (34 + x, 34 + y)-(31 + x, 31 + y), cf, BF
910     Line (33 + x, 33 + y)-(29 + x, 29 + y), cf, BF
911     Line (32 + x, 32 + y)-(28 + x, 28 + y), cf, BF
912     Line (4 + x, 36 + y)-(5 + x, 35 + y), cf, BF
913     Line (5 + x, 35 + y)-(7 + x, 33 + y), cf, BF
914     Line (6 + x, 34 + y)-(9 + x, 31 + y), cf, BF
915     Line (7 + x, 33 + y)-(11 + x, 29 + y), cf, BF
916     Line (8 + x, 32 + y)-(12 + x, 28 + y), cf, BF
917     Line (17 + x, 9 + y)-(23 + x, 8 + y), cf, BF
918     Line (18 + x, 7 + y)-(22 + x, 6 + y), cf, BF
919     Line (19 + x, 5 + y)-(21 + x, 4 + y), cf, BF
920     Line (17 + x, 31 + y)-(23 + x, 32 + y), cf, BF
921     Line (18 + x, 33 + y)-(22 + x, 34 + y), cf, BF
922     Line (19 + x, 35 + y)-(21 + x, 36 + y), cf, BF
923     Line (8 + x, 17 + y)-(9 + x, 23 + y), cf, BF
924     Line (6 + x, 18 + y)-(7 + x, 22 + y), cf, BF
925     Line (4 + x, 19 + y)-(5 + x, 21 + y), cf, BF
926     Line (32 + x, 17 + y)-(31 + x, 23 + y), cf, BF
927     Line (34 + x, 18 + y)-(33 + x, 22 + y), cf, BF
928     Line (36 + x, 19 + y)-(35 + x, 21 + y), cf, BF
929 End Sub
930
931 Sub lance
932     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
933     Line (9 + x, 31 + y)-(31 + x, 31 + y), cf
934     Line (10 + x, 30 + y)-(30 + x, 30 + y), cf
935     Line (11 + x, 29 + y)-(29 + x, 29 + y), cf
936     Line (12 + x, 28 + y)-(28 + x, 28 + y), cf
937     Line (13 + x, 27 + y)-(27 + x, 27 + y), cf
938     Line (14 + x, 26 + y)-(26 + x, 24 + y), cf, BF
939     Line (15 + x, 23 + y)-(25 + x, 20 + y), cf, BF
940     Line (16 + x, 19 + y)-(24 + x, 16 + y), cf, BF
941     Line (17 + x, 15 + y)-(23 + x, 12 + y), cf, BF
942     Line (18 + x, 11 + y)-(22 + x, 8 + y), cf, BF
943     Line (19 + x, 7 + y)-(21 + x, 4 + y), cf, BF
944 End Sub
945
946 Sub dragon
947     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
948     Line (9 + x, 31 + y)-(31 + x, 31 + y), cf
949     Line (10 + x, 30 + y)-(30 + x, 30 + y), cf
950     Line (11 + x, 29 + y)-(29 + x, 29 + y), cf
951     Line (12 + x, 28 + y)-(28 + x, 28 + y), cf
952     Line (13 + x, 27 + y)-(27 + x, 27 + y), cf
953     Line (14 + x, 26 + y)-(26 + x, 26 + y), cf
954     Line (15 + x, 25 + y)-(25 + x, 25 + y), cf
955     Line (15 + x, 20 + y)-(25 + x, 20 + y), cf
956     Line (14 + x, 19 + y)-(26 + x, 19 + y), cf
957     Line (13 + x, 18 + y)-(27 + x, 18 + y), cf
958     Line (16 + x, 24 + y)-(24 + x, 8 + y), cf, BF
959     Line (17 + x, 7 + y)-(23 + x, 6 + y), cf, BF
960     Line (18 + x, 5 + y)-(22 + x, 5 + y), cf
961     Line (19 + x, 4 + y)-(21 + x, 4 + y), cf
962     Line (9 + x, 12 + y)-(31 + x, 17 + y), cf, BF
963     Line (10 + x, 11 + y)-(13 + x, 11 + y), cf
964     Line (11 + x, 10 + y)-(12 + x, 10 + y), cf
965     Line (27 + x, 11 + y)-(30 + x, 11 + y), cf
966     Line (28 + x, 10 + y)-(29 + x, 10 + y), cf
967     Line (10 + x, 11 + y)-(10 + x, 18 + y), cf
968     Line (9 + x, 12 + y)-(9 + x, 19 + y), cf
969     Line (8 + x, 13 + y)-(8 + x, 20 + y), cf
970     Line (7 + x, 14 + y)-(7 + x, 21 + y), cf
971     Line (6 + x, 15 + y)-(6 + x, 22 + y), cf
972     Line (5 + x, 16 + y)-(5 + x, 23 + y), cf
973     Line (4 + x, 17 + y)-(4 + x, 24 + y), cf
974     Line (30 + x, 11 + y)-(30 + x, 18 + y), cf
975     Line (31 + x, 12 + y)-(31 + x, 19 + y), cf
976     Line (32 + x, 13 + y)-(32 + x, 20 + y), cf
977     Line (33 + x, 14 + y)-(33 + x, 21 + y), cf
978     Line (34 + x, 15 + y)-(34 + x, 22 + y), cf
979     Line (35 + x, 16 + y)-(35 + x, 23 + y), cf
980     Line (36 + x, 17 + y)-(36 + x, 24 + y), cf
981 End Sub
982
983 Sub horse
984     Line (8 + x, 36 + y)-(32 + x, 32 + y), cf, BF
985     Line (10 + x, 31 + y)-(11 + x, 26 + y), cf, BF
986     Line (16 + x, 31 + y)-(17 + x, 26 + y), cf, BF
987     Line (23 + x, 31 + y)-(24 + x, 26 + y), cf, BF
988     Line (29 + x, 31 + y)-(30 + x, 26 + y), cf, BF
989     Line (8 + x, 25 + y)-(32 + x, 14 + y), cf, BF
990     Line (7 + x, 24 + y)-(7 + x, 15 + y), cf
991     Line (6 + x, 23 + y)-(6 + x, 16 + y), cf
992     Line (5 + x, 22 + y)-(5 + x, 17 + y), cf
993     Line (4 + x, 21 + y)-(4 + x, 18 + y), cf
994     Line (33 + x, 24 + y)-(33 + x, 15 + y), cf
995     Line (34 + x, 23 + y)-(34 + x, 16 + y), cf
996     Line (35 + x, 22 + y)-(35 + x, 17 + y), cf
997     Line (36 + x, 21 + y)-(36 + x, 18 + y), cf
998     Line (14 + x, 13 + y)-(26 + x, 10 + y), cf, BF
999     Line (10 + x, 9 + y)-(30 + x, 7 + y), cf, BF
1000     Line (10 + x, 6 + y)-(13 + x, 6 + y), cf
1001     Line (10 + x, 5 + y)-(12 + x, 5 + y), cf
1002     Line (10 + x, 4 + y)-(11 + x, 4 + y), cf
1003     Line (30 + x, 6 + y)-(27 + x, 6 + y), cf
1004     Line (30 + x, 5 + y)-(28 + x, 5 + y), cf
1005     Line (30 + x, 4 + y)-(29 + x, 4 + y), cf
1006     Line (16 + x, 6 + y)-(24 + x, 6 + y), cf
1007     Line (17 + x, 5 + y)-(23 + x, 5 + y), cf
1008     Line (18 + x, 4 + y)-(22 + x, 4 + y), cf
1009 End Sub
1010
1011 Sub dame
1012     Line (14 + x, 36 + y)-(26 + x, 28 + y), cf, BF
1013     Line (14 + x, 4 + y)-(26 + x, 12 + y), cf, BF
1014     Line (4 + x, 14 + y)-(12 + x, 26 + y), cf, BF
1015     Line (28 + x, 14 + y)-(36 + x, 26 + y), cf, BF
1016     Line (17 + x, 36 + y)-(17 + x, 27 + y), cf
1017     Line (16 + x, 36 + y)-(16 + x, 26 + y), cf
1018     Line (15 + x, 36 + y)-(15 + x, 25 + y), cf
1019     Line (14 + x, 36 + y)-(14 + x, 24 + y), cf
1020     Line (13 + x, 35 + y)-(13 + x, 23 + y), cf
1021     Line (12 + x, 34 + y)-(12 + x, 22 + y), cf
1022     Line (23 + x, 36 + y)-(23 + x, 27 + y), cf
1023     Line (24 + x, 36 + y)-(24 + x, 26 + y), cf
1024     Line (25 + x, 36 + y)-(25 + x, 25 + y), cf
1025     Line (26 + x, 36 + y)-(26 + x, 24 + y), cf
1026     Line (27 + x, 35 + y)-(27 + x, 23 + y), cf
1027     Line (28 + x, 34 + y)-(28 + x, 22 + y), cf
1028     Line (17 + x, 4 + y)-(17 + x, 13 + y), cf
1029     Line (16 + x, 4 + y)-(16 + x, 14 + y), cf
1030     Line (15 + x, 4 + y)-(15 + x, 15 + y), cf
1031     Line (14 + x, 4 + y)-(14 + x, 16 + y), cf
1032     Line (13 + x, 5 + y)-(13 + x, 17 + y), cf
1033     Line (12 + x, 6 + y)-(12 + x, 18 + y), cf
1034     Line (23 + x, 4 + y)-(23 + x, 13 + y), cf
1035     Line (24 + x, 4 + y)-(24 + x, 14 + y), cf
1036     Line (25 + x, 4 + y)-(25 + x, 15 + y), cf
1037     Line (26 + x, 4 + y)-(26 + x, 16 + y), cf
1038     Line (27 + x, 5 + y)-(27 + x, 17 + y), cf
1039     Line (28 + x, 6 + y)-(28 + x, 18 + y), cf
1040     Line (5 + x, 13 + y)-(5 + x, 27 + y), cf
1041     Line (6 + x, 12 + y)-(6 + x, 28 + y), cf
1042     Line (7 + x, 11 + y)-(7 + x, 29 + y), cf
1043     Line (8 + x, 10 + y)-(8 + x, 30 + y), cf
1044     Line (9 + x, 9 + y)-(9 + x, 31 + y), cf
1045     Line (10 + x, 8 + y)-(10 + x, 32 + y), cf
1046     Line (11 + x, 7 + y)-(11 + x, 33 + y), cf
1047     Line (35 + x, 13 + y)-(35 + x, 27 + y), cf
1048     Line (34 + x, 12 + y)-(34 + x, 28 + y), cf
1049     Line (33 + x, 11 + y)-(33 + x, 29 + y), cf
1050     Line (32 + x, 10 + y)-(32 + x, 30 + y), cf
1051     Line (31 + x, 9 + y)-(31 + x, 31 + y), cf
1052     Line (30 + x, 8 + y)-(30 + x, 32 + y), cf
1053     Line (29 + x, 7 + y)-(29 + x, 33 + y), cf
1054 End Sub
1055
1056 Sub checker
1057     Line (14 + x, 36 + y)-(26 + x, 32 + y), cf, BF
1058     Line (14 + x, 4 + y)-(26 + x, 8 + y), cf, BF
1059     Line (4 + x, 14 + y)-(8 + x, 26 + y), cf, BF
1060     Line (32 + x, 14 + y)-(36 + x, 26 + y), cf, BF
1061     Line (13 + x, 35 + y)-(13 + x, 31 + y), cf
1062     Line (12 + x, 34 + y)-(12 + x, 30 + y), cf
1063     Line (11 + x, 33 + y)-(11 + x, 29 + y), cf
1064     Line (10 + x, 32 + y)-(10 + x, 28 + y), cf
1065     Line (9 + x, 31 + y)-(9 + x, 27 + y), cf
1066     Line (8 + x, 30 + y)-(8 + x, 26 + y), cf
1067     Line (27 + x, 35 + y)-(27 + x, 31 + y), cf
1068     Line (28 + x, 34 + y)-(28 + x, 30 + y), cf
1069     Line (29 + x, 33 + y)-(29 + x, 29 + y), cf
1070     Line (30 + x, 32 + y)-(30 + x, 28 + y), cf
1071     Line (31 + x, 31 + y)-(31 + x, 27 + y), cf
1072     Line (32 + x, 30 + y)-(32 + x, 26 + y), cf
1073     Line (13 + x, 5 + y)-(13 + x, 9 + y), cf
1074     Line (12 + x, 6 + y)-(12 + x, 10 + y), cf
1075     Line (11 + x, 7 + y)-(11 + x, 11 + y), cf
1076     Line (10 + x, 8 + y)-(10 + x, 12 + y), cf
1077     Line (9 + x, 9 + y)-(9 + x, 13 + y), cf
1078     Line (8 + x, 10 + y)-(8 + x, 14 + y), cf
1079     Line (27 + x, 5 + y)-(27 + x, 9 + y), cf
1080     Line (28 + x, 6 + y)-(28 + x, 10 + y), cf
1081     Line (29 + x, 7 + y)-(29 + x, 11 + y), cf
1082     Line (30 + x, 8 + y)-(30 + x, 12 + y), cf
1083     Line (31 + x, 9 + y)-(31 + x, 13 + y), cf
1084     Line (32 + x, 10 + y)-(32 + x, 14 + y), cf
1085     Line (5 + x, 13 + y)-(5 + x, 27 + y), cf
1086     Line (6 + x, 12 + y)-(6 + x, 28 + y), cf
1087     Line (7 + x, 11 + y)-(7 + x, 29 + y), cf
1088     Line (35 + x, 13 + y)-(35 + x, 27 + y), cf
1089     Line (34 + x, 12 + y)-(34 + x, 28 + y), cf
1090     Line (33 + x, 11 + y)-(33 + x, 29 + y), cf
1091     Line (17 + x, 28 + y)-(23 + x, 24 + y), cf, BF
1092     Line (17 + x, 12 + y)-(23 + x, 16 + y), cf, BF
1093     Line (12 + x, 17 + y)-(16 + x, 23 + y), cf, BF
1094     Line (24 + x, 17 + y)-(28 + x, 23 + y), cf, BF
1095     Line (18 + x, 28 + y)-(18 + x, 23 + y), cf
1096     Line (17 + x, 28 + y)-(17 + x, 22 + y), cf
1097     Line (16 + x, 27 + y)-(16 + x, 21 + y), cf
1098     Line (22 + x, 28 + y)-(22 + x, 23 + y), cf
1099     Line (23 + x, 28 + y)-(23 + x, 22 + y), cf
1100     Line (24 + x, 27 + y)-(24 + x, 21 + y), cf
1101     Line (18 + x, 12 + y)-(18 + x, 17 + y), cf
1102     Line (17 + x, 12 + y)-(17 + x, 18 + y), cf
1103     Line (16 + x, 13 + y)-(16 + x, 19 + y), cf
1104     Line (22 + x, 12 + y)-(22 + x, 17 + y), cf
1105     Line (23 + x, 12 + y)-(23 + x, 18 + y), cf
1106     Line (24 + x, 13 + y)-(24 + x, 19 + y), cf
1107     Line (13 + x, 16 + y)-(13 + x, 24 + y), cf
1108     Line (14 + x, 15 + y)-(14 + x, 25 + y), cf
1109     Line (15 + x, 14 + y)-(15 + x, 26 + y), cf
1110     Line (27 + x, 16 + y)-(27 + x, 24 + y), cf
1111     Line (26 + x, 15 + y)-(26 + x, 25 + y), cf
1112     Line (25 + x, 14 + y)-(25 + x, 26 + y), cf
1113 End Sub
1114
1115 Sub cells
1116     Line (x, y)-(x + 40, y + 40), cd1, BF
1117     Line (x - 1, y - 1)-(x + 41, y + 41), cb1, B
1118 End Sub
1119
1120 Sub dices
1121     Line (20, 160)-(60, 200), cd1, BF
1122     Line (20, 220)-(60, 260), cd1, BF
1123     Line (20, 280)-(60, 320), cd1, BF
1124     Line (580, 160)-(620, 200), cd1, BF
1125     Line (580, 220)-(620, 260), cd1, BF
1126     Line (580, 280)-(620, 320), cd1, BF
1127     Line (19, 159)-(61, 201), cb1, B
1128     Line (19, 219)-(61, 261), cb1, B
1129     Line (19, 279)-(61, 321), cb1, B
1130     Line (579, 159)-(621, 201), cb1, B
1131     Line (579, 219)-(621, 261), cb1, B
1132     Line (579, 279)-(621, 321), cb1, B
1133 End Sub
1134
1135 Sub chessboard
1136     Line (160, 80)-(480, 400), cb2, BF
1137     For x = 160 To 480 Step 40
1138         Line (x, 80)-(x, 400), cb1
1139     Next x
1140     For y = 80 To 400 Step 40
1141         Line (160, y)-(480, y), cb1
1142     Next y
1143     For y = 320 To 80 Step -80: For x = 400 To 160 Step -80
1144         Line (x + 1, y + 1)-(x + 39, y + 39), cb3, BF
1145         Line (x + 41, y + 41)-(x + 79, y + 79), cb3, BF
1146     Next x: Next y
1147     Let y = 405
1148     Let x = 175: Call numberA
1149     Let x = 215: Call numberB
1150     Let x = 255: Call numberC
1151     Let x = 295: Call numberD
1152     Let x = 335: Call numberE
1153     Let x = 375: Call numberF
1154     Let x = 415: Call numberG
1155     Let x = 455: Call numberH
1156     Let x = 145
1157     Let y = 95: Call number8
1158     Let y = 135: Call number7
1159     Let y = 175: Call number6
1160     Let y = 215: Call number5
1161     Let y = 255: Call number4
1162     Let y = 295: Call number3
1163     Let y = 335: Call number2
1164     Let y = 375: Call number1
1165 End Sub
1166
1167 Sub makrukboard
1168     Line (160, 80)-(480, 400), cb2, BF
1169     For x = 160 To 480 Step 40
1170         Line (x, 80)-(x, 400), cb1
1171     Next x
1172     For y = 80 To 400 Step 40
1173         Line (160, y)-(480, y), cb1
1174     Next y
1175     Let y = 405
1176     Let x = 175: Call numberA
1177     Let x = 215: Call numberB
1178     Let x = 255: Call numberC
1179     Let x = 295: Call numberD
1180     Let x = 335: Call numberE
1181     Let x = 375: Call numberF
1182     Let x = 415: Call numberG
1183     Let x = 455: Call numberH
1184     Let x = 145
1185     Let y = 95: Call number8
1186     Let y = 135: Call number7
1187     Let y = 175: Call number6
1188     Let y = 215: Call number5
1189     Let y = 255: Call number4
1190     Let y = 295: Call number3
1191     Let y = 335: Call number2
1192     Let y = 375: Call number1
1193 End Sub
1194
1195 Sub xiangqiboard
1196     Line (140, 40)-(500, 440), cb2, BF
1197     For x = 140 To 500 Step 40
1198         Line (x, 40)-(x, 440), cb1
1199     Next x
1200     For y = 40 To 440 Step 40
1201         Line (140, y)-(500, y), cb1
1202     Next y
1203     Line (259, 161)-(381, 159), cb4, BF
1204     Line (259, 41)-(261, 159), cb4, BF
1205     Line (379, 41)-(381, 159), cb4, BF
1206     Line (259, 321)-(381, 319), cb4, BF
1207     Line (259, 439)-(261, 319), cb4, BF
1208     Line (379, 439)-(381, 319), cb4, BF
1209     Line (141, 238)-(499, 242), cb5, BF
1210     Let y = 445
1211     Let x = 155: Call numberA
1212     Let x = 195: Call numberB
1213     Let x = 235: Call numberC
1214     Let x = 275: Call numberD
1215     Let x = 315: Call numberE
1216     Let x = 355: Call numberF
1217     Let x = 395: Call numberG
1218     Let x = 435: Call numberH
1219     Let x = 475: Call numberI
1220     Let x = 125
1221     Let y = 55: Call number0
1222     Let y = 95: Call number9
1223     Let y = 135: Call number8
1224     Let y = 175: Call number7
1225     Let y = 215: Call number6
1226     Let y = 255: Call number5
1227     Let y = 295: Call number4
1228     Let y = 335: Call number3
1229     Let y = 375: Call number2
1230     Let y = 415: Call number1
1231 End Sub
1232
1233 Sub shogiboard
1234     Line (140, 60)-(500, 420), cb2, BF
1235     For x = 140 To 500 Step 40
1236         Line (x, 60)-(x, 420), cb1
1237     Next x
1238     For y = 60 To 400 Step 40
1239         Line (140, y)-(500, y), cb1
1240     Next y
1241     Let y = 425
1242     Let x = 155: Call numberA
1243     Let x = 195: Call numberB
1244     Let x = 235: Call numberC
1245     Let x = 275: Call numberD
1246     Let x = 315: Call numberE
1247     Let x = 355: Call numberF
1248     Let x = 395: Call numberG
1249     Let x = 435: Call numberH
1250     Let x = 475: Call numberI
1251     Let x = 125
1252     Let y = 75: Call number9
1253     Let y = 115: Call number8
1254     Let y = 155: Call number7
1255     Let y = 195: Call number6
1256     Let y = 235: Call number5
1257     Let y = 275: Call number4
1258     Let y = 315: Call number3
1259     Let y = 355: Call number2
1260     Let y = 395: Call number1
1261 End Sub
1262
1263 Sub draughtsboard
1264     Line (120, 40)-(520, 440), cb2, BF
1265     For x = 120 To 520 Step 40
1266         Line (x, 40)-(x, 440), cb1
1267     Next x
1268     For y = 40 To 440 Step 40
1269         Line (120, y)-(520, y), cb1
1270     Next y
1271     For y = 360 To 40 Step -80: For x = 440 To 120 Step -80
1272         Line (x + 1, y + 1)-(x + 39, y + 39), cb3, BF
1273         Line (x + 41, y + 41)-(x + 79, y + 79), cb3, BF
1274     Next x: Next y
1275     Let y = 445
1276     Let x = 135: Call numberA
1277     Let x = 175: Call numberB
1278     Let x = 215: Call numberC
1279     Let x = 255: Call numberD
1280     Let x = 295: Call numberE
1281     Let x = 335: Call numberF
1282     Let x = 375: Call numberG
1283     Let x = 415: Call numberH
1284     Let x = 455: Call numberI
1285     Let x = 495: Call numberJ
1286     Let x = 105
1287     Let y = 55: Call number0
1288     Let y = 95: Call number9
1289     Let y = 135: Call number8
1290     Let y = 175: Call number7
1291     Let y = 215: Call number6
1292     Let y = 255: Call number5
1293     Let y = 295: Call number4
1294     Let y = 335: Call number3
1295     Let y = 375: Call number2
1296     Let y = 415: Call number1
1297 End Sub
1298
1299 Sub chess
1300
1301     Rem 1st roll
1302     Let count = 0: Let index = 0
1303     Let dc1 = Int(Rnd * 8 + 1)
1304     Let dc2 = Int(Rnd * 8 + 1)
1305     Let dc3 = 1
1306     Let dc4 = Int(Rnd * 8 + 1)
1307     Let dc5 = Int(Rnd * 8 + 1)
1308     Let dc6 = 1
1309     Let w1 = board(dc2, dc1): Let b1 = board(dc5, dc4)
1310
1311     Do
1312         Let count = count + 1
1313         Let dc1 = Int(Rnd * 8 + 1)
1314         Let dc2 = Int(Rnd * 8 + 1)
1315         Let dc4 = Int(Rnd * 8 + 1)
1316         Let dc5 = Int(Rnd * 8 + 1)
1317         Let w1 = board(dc2, dc1): Let b1 = board(dc5, dc4)
1318         If count > 8000 Then Exit Do
1319     Loop While Abs(w1 - b1) < 10
1320
1321     Let w1 = board(dc2, dc1): Let b1 = board(dc5, dc4)
1322     Let fw1x = dc1: Let fw1y = dc2: Let fb1x = dc4: Let fb1y = dc5
1323     Let fw1 = dc3: Let fb1 = dc6
1324
1325     Let x = 20: Let y = 160: Let cf = 15
1326     If dc3 = 1 Then Call king
1327     If dc3 = 2 Then Call queen
1328     If dc3 = 3 Then Call bishop
1329     If dc3 = 4 Then Call knight
1330     If dc3 = 5 Then Call rook
1331     If dc3 = 6 Then Call pawn
1332     Let x = 580: Let y = 160: Let cf = 0
1333     If dc6 = 1 Then Call king
1334     If dc6 = 2 Then Call queen
1335     If dc6 = 3 Then Call bishop
1336     If dc6 = 4 Then Call knight
1337     If dc6 = 5 Then Call rook
1338     If dc6 = 6 Then Call pawn
1339     Let x = 20: Let y = 220
1340     If dc1 = 1 Then Call letterA
1341     If dc1 = 2 Then Call letterB
1342     If dc1 = 3 Then Call letterC
1343     If dc1 = 4 Then Call letterD
1344     If dc1 = 5 Then Call letterE
1345     If dc1 = 6 Then Call letterF
1346     If dc1 = 7 Then Call letterG
1347     If dc1 = 8 Then Call letterH
1348     Let x = 20: Let y = 280
1349     If dc2 = 1 Then Call letter1
1350     If dc2 = 2 Then Call letter2
1351     If dc2 = 3 Then Call letter3
1352     If dc2 = 4 Then Call letter4
1353     If dc2 = 5 Then Call letter5
1354     If dc2 = 6 Then Call letter6
1355     If dc2 = 7 Then Call letter7
1356     If dc2 = 8 Then Call letter8
1357     Let x = 580: Let y = 220
1358     If dc4 = 1 Then Call letterA
1359     If dc4 = 2 Then Call letterB
1360     If dc4 = 3 Then Call letterC
1361     If dc4 = 4 Then Call letterD
1362     If dc4 = 5 Then Call letterE
1363     If dc4 = 6 Then Call letterF
1364     If dc4 = 7 Then Call letterG
1365     If dc4 = 8 Then Call letterH
1366     Let x = 580: Let y = 280
1367     If dc5 = 1 Then Call letter1
1368     If dc5 = 2 Then Call letter2
1369     If dc5 = 3 Then Call letter3
1370     If dc5 = 4 Then Call letter4
1371     If dc5 = 5 Then Call letter5
1372     If dc5 = 6 Then Call letter6
1373     If dc5 = 7 Then Call letter7
1374     If dc5 = 8 Then Call letter8
1375     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
1376     Let cf = 15: Call king
1377     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
1378     Let cf = 0: Call king
1379
1380     Do
1381         Select Case InKey$
1382             Case Is = Chr$(32)
1383                 Exit Do
1384             Case Is = Chr$(13)
1385                 Call chessfen
1386             Case Is = Chr$(27)
1387                 End
1388         End Select
1389     Loop
1390
1391     Call dices
1392
1393     Rem 2nd roll
1394     Let count = 0: Let index = 0
1395     Let dc1 = Int(Rnd * 8 + 1)
1396     Let dc2 = Int(Rnd * 8 + 1)
1397     Let dc3 = Int(Rnd * 5 + 2)
1398     Let dc4 = Int(Rnd * 8 + 1)
1399     Let dc5 = Int(Rnd * 8 + 1)
1400     Let dc6 = Int(Rnd * 5 + 2)
1401     Let w2 = board(dc2, dc1): Let b2 = board(dc5, dc4)
1402
1403     Select Case dc3
1404         Case Is = 1
1405             Rem
1406         Case Is = 2
1407             Do
1408                 Let count = count + 1
1409                 Let dc1 = Int(Rnd * 8 + 1)
1410                 Let dc2 = Int(Rnd * 8 + 1)
1411                 Let fw2x = dc1: Let fw2y = dc2
1412                 Let w2 = board(dc2, dc1)
1413                 If count > 8000 Then Exit Do
1414             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1415         Case Is = 3
1416             Do
1417                 Let count = count + 1
1418                 Let dc1 = Int(Rnd * 8 + 1)
1419                 Let dc2 = Int(Rnd * 8 + 1)
1420                 Let w2 = board(dc2, dc1)
1421                 If count > 8000 Then Exit Do
1422             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1423         Case Is = 4
1424             Do
1425                 Let count = count + 1
1426                 Let dc1 = Int(Rnd * 8 + 1)
1427                 Let dc2 = Int(Rnd * 8 + 1)
1428                 Let w2 = board(dc2, dc1)
1429                 If count > 8000 Then Exit Do
1430             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1431         Case Is = 5
1432             Do
1433                 Let count = count + 1
1434                 Let dc1 = Int(Rnd * 8 + 1)
1435                 Let dc2 = Int(Rnd * 8 + 1)
1436                 Let fw2x = dc1: Let fw2y = dc2
1437                 Let w2 = board(dc2, dc1)
1438                 If count > 8000 Then Exit Do
1439             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1440         Case Is = 6
1441             Do
1442                 Let count = count + 1
1443                 Let dc1 = Int(Rnd * 8 + 1)
1444                 Let dc2 = Int(Rnd * 8 + 1)
1445                 Let w2 = board(dc2, dc1)
1446                 If count > 8000 Then Exit Do
1447             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc2 = 1 Or dc2 = 8
1448     End Select
1449     Select Case dc6
1450         Case Is = 1
1451             Rem
1452         Case Is = 2
1453             Do
1454                 Let count = count + 1
1455                 Let dc4 = Int(Rnd * 8 + 1)
1456                 Let dc5 = Int(Rnd * 8 + 1)
1457                 Let fb2x = dc4: Let fb2y = dc5
1458                 Let b2 = board(dc5, dc4)
1459                 If count > 8000 Then Exit Do
1460             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1461         Case Is = 3
1462             Do
1463                 Let count = count + 1
1464                 Let dc4 = Int(Rnd * 8 + 1)
1465                 Let dc5 = Int(Rnd * 8 + 1)
1466                 Let b2 = board(dc5, dc4)
1467                 If count > 8000 Then Exit Do
1468             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1469         Case Is = 4
1470             Do
1471                 Let count = count + 1
1472                 Let dc4 = Int(Rnd * 8 + 1)
1473                 Let dc5 = Int(Rnd * 8 + 1)
1474                 Let b2 = board(dc5, dc4)
1475                 If count > 8000 Then Exit Do
1476             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1477         Case Is = 5
1478             Do
1479                 Let count = count + 1
1480                 Let dc4 = Int(Rnd * 8 + 1)
1481                 Let dc5 = Int(Rnd * 8 + 1)
1482                 Let fb2x = dc4: Let fb2y = dc5
1483                 Let b2 = board(dc5, dc4)
1484                 If count > 8000 Then Exit Do
1485             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
1486         Case Is = 6
1487             Do
1488                 Let count = count + 1
1489                 Let dc4 = Int(Rnd * 8 + 1)
1490                 Let dc5 = Int(Rnd * 8 + 1)
1491                 Let b2 = board(dc5, dc4)
1492                 If count > 8000 Then Exit Do
1493             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc5 = 1 Or dc5 = 8
1494     End Select
1495
1496     Let w2 = board(dc2, dc1): Let b2 = board(dc5, dc4)
1497     Let fw2x = dc1: Let fw2y = dc2: Let fb2x = dc4: Let fb2y = dc5
1498     Let fw2 = dc3: Let fb2 = dc6
1499
1500     Let x = 20: Let y = 160: Let cf = 15
1501     If dc3 = 1 Then Call king
1502     If dc3 = 2 Then Call queen
1503     If dc3 = 3 Then Call bishop
1504     If dc3 = 4 Then Call knight
1505     If dc3 = 5 Then Call rook
1506     If dc3 = 6 Then Call pawn
1507     Let x = 580: Let y = 160: Let cf = 0
1508     If dc6 = 1 Then Call king
1509     If dc6 = 2 Then Call queen
1510     If dc6 = 3 Then Call bishop
1511     If dc6 = 4 Then Call knight
1512     If dc6 = 5 Then Call rook
1513     If dc6 = 6 Then Call pawn
1514     Let x = 20: Let y = 220
1515     If dc1 = 1 Then Call letterA
1516     If dc1 = 2 Then Call letterB
1517     If dc1 = 3 Then Call letterC
1518     If dc1 = 4 Then Call letterD
1519     If dc1 = 5 Then Call letterE
1520     If dc1 = 6 Then Call letterF
1521     If dc1 = 7 Then Call letterG
1522     If dc1 = 8 Then Call letterH
1523     Let x = 20: Let y = 280
1524     If dc2 = 1 Then Call letter1
1525     If dc2 = 2 Then Call letter2
1526     If dc2 = 3 Then Call letter3
1527     If dc2 = 4 Then Call letter4
1528     If dc2 = 5 Then Call letter5
1529     If dc2 = 6 Then Call letter6
1530     If dc2 = 7 Then Call letter7
1531     If dc2 = 8 Then Call letter8
1532     Let x = 580: Let y = 220
1533     If dc4 = 1 Then Call letterA
1534     If dc4 = 2 Then Call letterB
1535     If dc4 = 3 Then Call letterC
1536     If dc4 = 4 Then Call letterD
1537     If dc4 = 5 Then Call letterE
1538     If dc4 = 6 Then Call letterF
1539     If dc4 = 7 Then Call letterG
1540     If dc4 = 8 Then Call letterH
1541     Let x = 580: Let y = 280
1542     If dc5 = 1 Then Call letter1
1543     If dc5 = 2 Then Call letter2
1544     If dc5 = 3 Then Call letter3
1545     If dc5 = 4 Then Call letter4
1546     If dc5 = 5 Then Call letter5
1547     If dc5 = 6 Then Call letter6
1548     If dc5 = 7 Then Call letter7
1549     If dc5 = 8 Then Call letter8
1550     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
1551     Let cf = 15
1552     If dc3 = 1 Then Call king
1553     If dc3 = 2 Then Call queen
1554     If dc3 = 3 Then Call bishop
1555     If dc3 = 4 Then Call knight
1556     If dc3 = 5 Then Call rook
1557     If dc3 = 6 Then Call pawn
1558     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
1559     Let cf = 0
1560     If dc6 = 1 Then Call king
1561     If dc6 = 2 Then Call queen
1562     If dc6 = 3 Then Call bishop
1563     If dc6 = 4 Then Call knight
1564     If dc6 = 5 Then Call rook
1565     If dc6 = 6 Then Call pawn
1566
1567     Do
1568         Select Case InKey$
1569             Case Is = Chr$(32)
1570                 Exit Do
1571             Case Is = Chr$(13)
1572                 Call chessfen
1573             Case Is = Chr$(27)
1574                 End
1575         End Select
1576     Loop
1577
1578     Call dices
1579
1580     Rem 3rd roll
1581     Let count = 0: Let index = 0
1582     Let dc1 = Int(Rnd * 8 + 1)
1583     Let dc2 = Int(Rnd * 8 + 1)
1584     Let dc3 = Int(Rnd * 5 + 2)
1585     Let dc4 = Int(Rnd * 8 + 1)
1586     Let dc5 = Int(Rnd * 8 + 1)
1587     Let dc6 = Int(Rnd * 5 + 2)
1588     Let w3 = board(dc2, dc1): Let b3 = board(dc5, dc4)
1589
1590     Select Case dc3
1591         Case Is = 1
1592             Rem
1593         Case Is = 2
1594             Do
1595                 Let count = count + 1
1596                 Let dc1 = Int(Rnd * 8 + 1)
1597                 Let dc2 = Int(Rnd * 8 + 1)
1598                 Let fw3x = dc1: Let fw3y = dc2
1599                 Let w3 = board(dc2, dc1)
1600                 If count > 8000 Then Exit Do
1601             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1602         Case Is = 3
1603             Do
1604                 Let count = count + 1
1605                 Let dc1 = Int(Rnd * 8 + 1)
1606                 Let dc2 = Int(Rnd * 8 + 1)
1607                 Let w3 = board(dc2, dc1)
1608                 If count > 8000 Then Exit Do
1609             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1610         Case Is = 4
1611             Do
1612                 Let count = count + 1
1613                 Let dc1 = Int(Rnd * 8 + 1)
1614                 Let dc2 = Int(Rnd * 8 + 1)
1615                 Let w3 = board(dc2, dc1)
1616                 If count > 8000 Then Exit Do
1617             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1618         Case Is = 5
1619             Do
1620                 Let count = count + 1
1621                 Let dc1 = Int(Rnd * 8 + 1)
1622                 Let dc2 = Int(Rnd * 8 + 1)
1623                 Let fw3x = dc1: Let fw3y = dc2
1624                 Let w3 = board(dc2, dc1)
1625                 If count > 8000 Then Exit Do
1626             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1627         Case Is = 6
1628             Do
1629                 Let count = count + 1
1630                 Let dc1 = Int(Rnd * 8 + 1)
1631                 Let dc2 = Int(Rnd * 8 + 1)
1632                 Let w3 = board(dc2, dc1)
1633                 If count > 8000 Then Exit Do
1634             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc2 = 1 Or dc2 = 8
1635     End Select
1636     Select Case dc6
1637         Case Is = 1
1638             Rem
1639         Case Is = 2
1640             Do
1641                 Let count = count + 1
1642                 Let dc4 = Int(Rnd * 8 + 1)
1643                 Let dc5 = Int(Rnd * 8 + 1)
1644                 Let fb3x = dc4: Let fb3y = dc5
1645                 Let b3 = board(dc5, dc4)
1646                 If count > 8000 Then Exit Do
1647             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1648         Case Is = 3
1649             Do
1650                 Let count = count + 1
1651                 Let dc4 = Int(Rnd * 8 + 1)
1652                 Let dc5 = Int(Rnd * 8 + 1)
1653                 Let b3 = board(dc5, dc4)
1654                 If count > 8000 Then Exit Do
1655             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1656         Case Is = 4
1657             Do
1658                 Let count = count + 1
1659                 Let dc4 = Int(Rnd * 8 + 1)
1660                 Let dc5 = Int(Rnd * 8 + 1)
1661                 Let b3 = board(dc5, dc4)
1662                 If count > 8000 Then Exit Do
1663             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1664         Case Is = 5
1665             Do
1666                 Let count = count + 1
1667                 Let dc4 = Int(Rnd * 8 + 1)
1668                 Let dc5 = Int(Rnd * 8 + 1)
1669                 Let fb3x = dc4: Let fb3y = dc5
1670                 Let b3 = board(dc5, dc4)
1671                 If count > 8000 Then Exit Do
1672             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
1673         Case Is = 6
1674             Do
1675                 Let count = count + 1
1676                 Let dc4 = Int(Rnd * 8 + 1)
1677                 Let dc5 = Int(Rnd * 8 + 1)
1678                 Let b3 = board(dc5, dc4)
1679                 If count > 8000 Then Exit Do
1680             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc5 = 1 Or dc5 = 8
1681     End Select
1682
1683     Let w3 = board(dc2, dc1): Let b3 = board(dc5, dc4)
1684     Let fw3x = dc1: Let fw3y = dc2: Let fb3x = dc4: Let fb3y = dc5
1685     Let fw3 = dc3: Let fb3 = dc6
1686
1687     Let x = 20: Let y = 160: Let cf = 15
1688     If dc3 = 1 Then Call king
1689     If dc3 = 2 Then Call queen
1690     If dc3 = 3 Then Call bishop
1691     If dc3 = 4 Then Call knight
1692     If dc3 = 5 Then Call rook
1693     If dc3 = 6 Then Call pawn
1694     Let x = 580: Let y = 160: Let cf = 0
1695     If dc6 = 1 Then Call king
1696     If dc6 = 2 Then Call queen
1697     If dc6 = 3 Then Call bishop
1698     If dc6 = 4 Then Call knight
1699     If dc6 = 5 Then Call rook
1700     If dc6 = 6 Then Call pawn
1701     Let x = 20: Let y = 220
1702     If dc1 = 1 Then Call letterA
1703     If dc1 = 2 Then Call letterB
1704     If dc1 = 3 Then Call letterC
1705     If dc1 = 4 Then Call letterD
1706     If dc1 = 5 Then Call letterE
1707     If dc1 = 6 Then Call letterF
1708     If dc1 = 7 Then Call letterG
1709     If dc1 = 8 Then Call letterH
1710     Let x = 20: Let y = 280
1711     If dc2 = 1 Then Call letter1
1712     If dc2 = 2 Then Call letter2
1713     If dc2 = 3 Then Call letter3
1714     If dc2 = 4 Then Call letter4
1715     If dc2 = 5 Then Call letter5
1716     If dc2 = 6 Then Call letter6
1717     If dc2 = 7 Then Call letter7
1718     If dc2 = 8 Then Call letter8
1719     Let x = 580: Let y = 220
1720     If dc4 = 1 Then Call letterA
1721     If dc4 = 2 Then Call letterB
1722     If dc4 = 3 Then Call letterC
1723     If dc4 = 4 Then Call letterD
1724     If dc4 = 5 Then Call letterE
1725     If dc4 = 6 Then Call letterF
1726     If dc4 = 7 Then Call letterG
1727     If dc4 = 8 Then Call letterH
1728     Let x = 580: Let y = 280
1729     If dc5 = 1 Then Call letter1
1730     If dc5 = 2 Then Call letter2
1731     If dc5 = 3 Then Call letter3
1732     If dc5 = 4 Then Call letter4
1733     If dc5 = 5 Then Call letter5
1734     If dc5 = 6 Then Call letter6
1735     If dc5 = 7 Then Call letter7
1736     If dc5 = 8 Then Call letter8
1737     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
1738     Let cf = 15
1739     If dc3 = 1 Then Call king
1740     If dc3 = 2 Then Call queen
1741     If dc3 = 3 Then Call bishop
1742     If dc3 = 4 Then Call knight
1743     If dc3 = 5 Then Call rook
1744     If dc3 = 6 Then Call pawn
1745     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
1746     Let cf = 0
1747     If dc6 = 1 Then Call king
1748     If dc6 = 2 Then Call queen
1749     If dc6 = 3 Then Call bishop
1750     If dc6 = 4 Then Call knight
1751     If dc6 = 5 Then Call rook
1752     If dc6 = 6 Then Call pawn
1753
1754     Do
1755         Select Case InKey$
1756             Case Is = Chr$(32)
1757                 Exit Do
1758             Case Is = Chr$(13)
1759                 Call chessfen
1760             Case Is = Chr$(27)
1761                 End
1762         End Select
1763     Loop
1764
1765     Call dices
1766
1767     Rem 4th roll
1768     Let count = 0: Let index = 0
1769     Let dc1 = Int(Rnd * 8 + 1)
1770     Let dc2 = Int(Rnd * 8 + 1)
1771     Let dc3 = Int(Rnd * 5 + 2)
1772     Let dc4 = Int(Rnd * 8 + 1)
1773     Let dc5 = Int(Rnd * 8 + 1)
1774     Let dc6 = Int(Rnd * 5 + 2)
1775     Let w4 = board(dc2, dc1): Let b4 = board(dc5, dc4)
1776
1777     Select Case dc3
1778         Case Is = 1
1779             Rem
1780         Case Is = 2
1781             Do
1782                 Let count = count + 1
1783                 Let dc1 = Int(Rnd * 8 + 1)
1784                 Let dc2 = Int(Rnd * 8 + 1)
1785                 Let fw4x = dc1: Let fw4y = dc2
1786                 Let w4 = board(dc2, dc1)
1787                 If count > 8000 Then Exit Do
1788             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1789         Case Is = 3
1790             Do
1791                 Let count = count + 1
1792                 Let dc1 = Int(Rnd * 8 + 1)
1793                 Let dc2 = Int(Rnd * 8 + 1)
1794                 Let w4 = board(dc2, dc1)
1795                 If count > 8000 Then Exit Do
1796             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1797         Case Is = 4
1798             Do
1799                 Let count = count + 1
1800                 Let dc1 = Int(Rnd * 8 + 1)
1801                 Let dc2 = Int(Rnd * 8 + 1)
1802                 Let w4 = board(dc2, dc1)
1803                 If count > 8000 Then Exit Do
1804             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1805         Case Is = 5
1806             Do
1807                 Let count = count + 1
1808                 Let dc1 = Int(Rnd * 8 + 1)
1809                 Let dc2 = Int(Rnd * 8 + 1)
1810                 Let fw4x = dc1: Let fw4y = dc2
1811                 Let w4 = board(dc2, dc1)
1812                 If count > 8000 Then Exit Do
1813             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1814         Case Is = 6
1815             Do
1816                 Let count = count + 1
1817                 Let dc1 = Int(Rnd * 8 + 1)
1818                 Let dc2 = Int(Rnd * 8 + 1)
1819                 Let w4 = board(dc2, dc1)
1820                 If count > 8000 Then Exit Do
1821             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc2 = 1 Or dc2 = 8
1822     End Select
1823     Select Case dc6
1824         Case Is = 1
1825             Rem
1826         Case Is = 2
1827             Do
1828                 Let count = count + 1
1829                 Let dc4 = Int(Rnd * 8 + 1)
1830                 Let dc5 = Int(Rnd * 8 + 1)
1831                 Let fb4x = dc4: Let fb4y = dc5
1832                 Let b4 = board(dc5, dc4)
1833                 If count > 8000 Then Exit Do
1834             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1835         Case Is = 3
1836             Do
1837                 Let count = count + 1
1838                 Let dc4 = Int(Rnd * 8 + 1)
1839                 Let dc5 = Int(Rnd * 8 + 1)
1840                 Let b4 = board(dc5, dc4)
1841                 If count > 8000 Then Exit Do
1842             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1843         Case Is = 4
1844             Do
1845                 Let count = count + 1
1846                 Let dc4 = Int(Rnd * 8 + 1)
1847                 Let dc5 = Int(Rnd * 8 + 1)
1848                 Let b4 = board(dc5, dc4)
1849                 If count > 8000 Then Exit Do
1850             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1851         Case Is = 5
1852             Do
1853                 Let count = count + 1
1854                 Let dc4 = Int(Rnd * 8 + 1)
1855                 Let dc5 = Int(Rnd * 8 + 1)
1856                 Let fb4x = dc4: Let fb4y = dc5
1857                 Let b4 = board(dc5, dc4)
1858                 If count > 8000 Then Exit Do
1859             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
1860         Case Is = 6
1861             Do
1862                 Let count = count + 1
1863                 Let dc4 = Int(Rnd * 8 + 1)
1864                 Let dc5 = Int(Rnd * 8 + 1)
1865                 Let b4 = board(dc5, dc4)
1866                 If count > 8000 Then Exit Do
1867             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc5 = 1 Or dc5 = 8
1868     End Select
1869
1870     Let w4 = board(dc2, dc1): Let b4 = board(dc5, dc4)
1871     Let fw4x = dc1: Let fw4y = dc2: Let fb4x = dc4: Let fb4y = dc5
1872     Let fw4 = dc3: Let fb4 = dc6
1873
1874     Let x = 20: Let y = 160: Let cf = 15
1875     If dc3 = 1 Then Call king
1876     If dc3 = 2 Then Call queen
1877     If dc3 = 3 Then Call bishop
1878     If dc3 = 4 Then Call knight
1879     If dc3 = 5 Then Call rook
1880     If dc3 = 6 Then Call pawn
1881     Let x = 580: Let y = 160: Let cf = 0
1882     If dc6 = 1 Then Call king
1883     If dc6 = 2 Then Call queen
1884     If dc6 = 3 Then Call bishop
1885     If dc6 = 4 Then Call knight
1886     If dc6 = 5 Then Call rook
1887     If dc6 = 6 Then Call pawn
1888     Let x = 20: Let y = 220
1889     If dc1 = 1 Then Call letterA
1890     If dc1 = 2 Then Call letterB
1891     If dc1 = 3 Then Call letterC
1892     If dc1 = 4 Then Call letterD
1893     If dc1 = 5 Then Call letterE
1894     If dc1 = 6 Then Call letterF
1895     If dc1 = 7 Then Call letterG
1896     If dc1 = 8 Then Call letterH
1897     Let x = 20: Let y = 280
1898     If dc2 = 1 Then Call letter1
1899     If dc2 = 2 Then Call letter2
1900     If dc2 = 3 Then Call letter3
1901     If dc2 = 4 Then Call letter4
1902     If dc2 = 5 Then Call letter5
1903     If dc2 = 6 Then Call letter6
1904     If dc2 = 7 Then Call letter7
1905     If dc2 = 8 Then Call letter8
1906     Let x = 580: Let y = 220
1907     If dc4 = 1 Then Call letterA
1908     If dc4 = 2 Then Call letterB
1909     If dc4 = 3 Then Call letterC
1910     If dc4 = 4 Then Call letterD
1911     If dc4 = 5 Then Call letterE
1912     If dc4 = 6 Then Call letterF
1913     If dc4 = 7 Then Call letterG
1914     If dc4 = 8 Then Call letterH
1915     Let x = 580: Let y = 280
1916     If dc5 = 1 Then Call letter1
1917     If dc5 = 2 Then Call letter2
1918     If dc5 = 3 Then Call letter3
1919     If dc5 = 4 Then Call letter4
1920     If dc5 = 5 Then Call letter5
1921     If dc5 = 6 Then Call letter6
1922     If dc5 = 7 Then Call letter7
1923     If dc5 = 8 Then Call letter8
1924     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
1925     Let cf = 15
1926     If dc3 = 1 Then Call king
1927     If dc3 = 2 Then Call queen
1928     If dc3 = 3 Then Call bishop
1929     If dc3 = 4 Then Call knight
1930     If dc3 = 5 Then Call rook
1931     If dc3 = 6 Then Call pawn
1932     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
1933     Let cf = 0
1934     If dc6 = 1 Then Call king
1935     If dc6 = 2 Then Call queen
1936     If dc6 = 3 Then Call bishop
1937     If dc6 = 4 Then Call knight
1938     If dc6 = 5 Then Call rook
1939     If dc6 = 6 Then Call pawn
1940
1941     Do
1942         Select Case InKey$
1943             Case Is = Chr$(32)
1944                 Rem
1945             Case Is = Chr$(13)
1946                 Call chessfen
1947             Case Is = Chr$(27)
1948                 End
1949         End Select
1950     Loop
1951 End Sub
1952
1953 Sub makruk
1954
1955     Rem 1st roll
1956     Let count = 0: Let index = 0
1957     Let dc1 = Int(Rnd * 8 + 1)
1958     Let dc2 = Int(Rnd * 8 + 1)
1959     Let dc3 = 1
1960     Let dc4 = Int(Rnd * 8 + 1)
1961     Let dc5 = Int(Rnd * 8 + 1)
1962     Let dc6 = 1
1963     Let w1 = board(dc2, dc1): Let b1 = board(dc5, dc4)
1964
1965     Do
1966         Let count = count + 1
1967         Let dc1 = Int(Rnd * 8 + 1)
1968         Let dc2 = Int(Rnd * 8 + 1)
1969         Let dc4 = Int(Rnd * 8 + 1)
1970         Let dc5 = Int(Rnd * 8 + 1)
1971         Let w1 = board(dc2, dc1): Let b1 = board(dc5, dc4)
1972         If count > 8000 Then Exit Do
1973     Loop While Abs(w1 - b1) < 10
1974
1975     Let w1 = board(dc2, dc1): Let b1 = board(dc5, dc4)
1976     Let fw1x = dc1: Let fw1y = dc2: Let fb1x = dc4: Let fb1y = dc5
1977     Let fw1 = dc3: Let fb1 = dc6
1978
1979     Let x = 20: Let y = 160: Let cf = 15
1980     If dc3 = 1 Then Call king
1981     If dc3 = 2 Then Call queen
1982     If dc3 = 3 Then Call bishop
1983     If dc3 = 4 Then Call knight
1984     If dc3 = 5 Then Call rook
1985     If dc3 = 6 Then Call checker
1986     Let x = 580: Let y = 160: Let cf = 0
1987     If dc6 = 1 Then Call king
1988     If dc6 = 2 Then Call queen
1989     If dc6 = 3 Then Call bishop
1990     If dc6 = 4 Then Call knight
1991     If dc6 = 5 Then Call rook
1992     If dc6 = 6 Then Call checker
1993     Let x = 20: Let y = 220
1994     If dc1 = 1 Then Call letterA
1995     If dc1 = 2 Then Call letterB
1996     If dc1 = 3 Then Call letterC
1997     If dc1 = 4 Then Call letterD
1998     If dc1 = 5 Then Call letterE
1999     If dc1 = 6 Then Call letterF
2000     If dc1 = 7 Then Call letterG
2001     If dc1 = 8 Then Call letterH
2002     Let x = 20: Let y = 280
2003     If dc2 = 1 Then Call letter1
2004     If dc2 = 2 Then Call letter2
2005     If dc2 = 3 Then Call letter3
2006     If dc2 = 4 Then Call letter4
2007     If dc2 = 5 Then Call letter5
2008     If dc2 = 6 Then Call letter6
2009     If dc2 = 7 Then Call letter7
2010     If dc2 = 8 Then Call letter8
2011     Let x = 580: Let y = 220
2012     If dc4 = 1 Then Call letterA
2013     If dc4 = 2 Then Call letterB
2014     If dc4 = 3 Then Call letterC
2015     If dc4 = 4 Then Call letterD
2016     If dc4 = 5 Then Call letterE
2017     If dc4 = 6 Then Call letterF
2018     If dc4 = 7 Then Call letterG
2019     If dc4 = 8 Then Call letterH
2020     Let x = 580: Let y = 280
2021     If dc5 = 1 Then Call letter1
2022     If dc5 = 2 Then Call letter2
2023     If dc5 = 3 Then Call letter3
2024     If dc5 = 4 Then Call letter4
2025     If dc5 = 5 Then Call letter5
2026     If dc5 = 6 Then Call letter6
2027     If dc5 = 7 Then Call letter7
2028     If dc5 = 8 Then Call letter8
2029     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
2030     Let cf = 15: Call king
2031     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
2032     Let cf = 0: Call king
2033
2034     Do
2035         Select Case InKey$
2036             Case Is = Chr$(32)
2037                 Exit Do
2038             Case Is = Chr$(13)
2039                 Call makrukfen
2040             Case Is = Chr$(27)
2041                 End
2042         End Select
2043     Loop
2044
2045     Call dices
2046
2047     Rem 2nd roll
2048     Let count = 0: Let index = 0
2049     Let dc1 = Int(Rnd * 8 + 1)
2050     Let dc2 = Int(Rnd * 8 + 1)
2051     Let dc3 = Int(Rnd * 5 + 2)
2052     Let dc4 = Int(Rnd * 8 + 1)
2053     Let dc5 = Int(Rnd * 8 + 1)
2054     Let dc6 = Int(Rnd * 5 + 2)
2055     Let w2 = board(dc2, dc1): Let b2 = board(dc5, dc4)
2056
2057     Select Case dc3
2058         Case Is = 1
2059             Rem
2060         Case Is = 2
2061             Do
2062                 Let count = count + 1
2063                 Let dc1 = Int(Rnd * 8 + 1)
2064                 Let dc2 = Int(Rnd * 8 + 1)
2065                 Let w2 = board(dc2, dc1)
2066                 If count > 8000 Then Exit Do
2067             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2068         Case Is = 3
2069             Let indexw3 = 1
2070             Do
2071                 Let count = count + 1
2072                 Let dc1 = Int(Rnd * 8 + 1)
2073                 Let dc2 = Int(Rnd * 8 + 1)
2074                 Let w2 = board(dc2, dc1)
2075                 If count > 8000 Then Exit Do
2076             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2077         Case Is = 4
2078             Let indexw4 = 1
2079             Do
2080                 Let count = count + 1
2081                 Let dc1 = Int(Rnd * 8 + 1)
2082                 Let dc2 = Int(Rnd * 8 + 1)
2083                 Let w2 = board(dc2, dc1)
2084                 If count > 8000 Then Exit Do
2085             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2086         Case Is = 5
2087             Let indexw5 = 1
2088             Do
2089                 Let count = count + 1
2090                 Let dc1 = Int(Rnd * 8 + 1)
2091                 Let dc2 = Int(Rnd * 8 + 1)
2092                 Let fw2x = dc1: Let fw2y = dc2
2093                 Let w2 = board(dc2, dc1)
2094                 If count > 8000 Then Exit Do
2095             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2096         Case Is = 6
2097             Do
2098                 Let count = count + 1
2099                 Let dc1 = Int(Rnd * 8 + 1)
2100                 Let dc2 = Int(Rnd * 8 + 1)
2101                 Let w2 = board(dc2, dc1)
2102                 If count > 8000 Then Exit Do
2103             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc2 < 3 Or dc2 > 5
2104     End Select
2105     Select Case dc6
2106         Case Is = 1
2107             Rem
2108         Case Is = 2
2109             Do
2110                 Let count = count + 1
2111                 Let dc4 = Int(Rnd * 8 + 1)
2112                 Let dc5 = Int(Rnd * 8 + 1)
2113                 Let b2 = board(dc5, dc4)
2114                 If count > 8000 Then Exit Do
2115             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2116         Case Is = 3
2117             Let indexb3 = 1
2118             Do
2119                 Let count = count + 1
2120                 Let dc4 = Int(Rnd * 8 + 1)
2121                 Let dc5 = Int(Rnd * 8 + 1)
2122                 Let b2 = board(dc5, dc4)
2123                 If count > 8000 Then Exit Do
2124             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2125         Case Is = 4
2126             Let indexb4 = 1
2127             Do
2128                 Let count = count + 1
2129                 Let dc4 = Int(Rnd * 8 + 1)
2130                 Let dc5 = Int(Rnd * 8 + 1)
2131                 Let b2 = board(dc5, dc4)
2132                 If count > 8000 Then Exit Do
2133             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2134         Case Is = 5
2135             Let indexb5 = 1
2136             Do
2137                 Let count = count + 1
2138                 Let dc4 = Int(Rnd * 8 + 1)
2139                 Let dc5 = Int(Rnd * 8 + 1)
2140                 Let fb2x = dc4: Let fb2y = dc5
2141                 Let b2 = board(dc5, dc4)
2142                 If count > 8000 Then Exit Do
2143             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2144         Case Is = 6
2145             Do
2146                 Let count = count + 1
2147                 Let dc4 = Int(Rnd * 8 + 1)
2148                 Let dc5 = Int(Rnd * 8 + 1)
2149                 Let b2 = board(dc5, dc4)
2150                 If count > 8000 Then Exit Do
2151             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc5 < 4 Or dc5 > 6
2152     End Select
2153
2154     Let w2 = board(dc2, dc1): Let b2 = board(dc5, dc4)
2155     Let fw2x = dc1: Let fw2y = dc2: Let fb2x = dc4: Let fb2y = dc5
2156     Let fw2 = dc3: Let fb2 = dc6
2157
2158     Let x = 20: Let y = 160: Let cf = 15
2159     If dc3 = 1 Then Call king
2160     If dc3 = 2 Then Call queen
2161     If dc3 = 3 Then Call bishop
2162     If dc3 = 4 Then Call knight
2163     If dc3 = 5 Then Call rook
2164     If dc3 = 6 Then Call checker
2165     Let x = 580: Let y = 160: Let cf = 0
2166     If dc6 = 1 Then Call king
2167     If dc6 = 2 Then Call queen
2168     If dc6 = 3 Then Call bishop
2169     If dc6 = 4 Then Call knight
2170     If dc6 = 5 Then Call rook
2171     If dc6 = 6 Then Call checker
2172     Let x = 20: Let y = 220
2173     If dc1 = 1 Then Call letterA
2174     If dc1 = 2 Then Call letterB
2175     If dc1 = 3 Then Call letterC
2176     If dc1 = 4 Then Call letterD
2177     If dc1 = 5 Then Call letterE
2178     If dc1 = 6 Then Call letterF
2179     If dc1 = 7 Then Call letterG
2180     If dc1 = 8 Then Call letterH
2181     Let x = 20: Let y = 280
2182     If dc2 = 1 Then Call letter1
2183     If dc2 = 2 Then Call letter2
2184     If dc2 = 3 Then Call letter3
2185     If dc2 = 4 Then Call letter4
2186     If dc2 = 5 Then Call letter5
2187     If dc2 = 6 Then Call letter6
2188     If dc2 = 7 Then Call letter7
2189     If dc2 = 8 Then Call letter8
2190     Let x = 580: Let y = 220
2191     If dc4 = 1 Then Call letterA
2192     If dc4 = 2 Then Call letterB
2193     If dc4 = 3 Then Call letterC
2194     If dc4 = 4 Then Call letterD
2195     If dc4 = 5 Then Call letterE
2196     If dc4 = 6 Then Call letterF
2197     If dc4 = 7 Then Call letterG
2198     If dc4 = 8 Then Call letterH
2199     Let x = 580: Let y = 280
2200     If dc5 = 1 Then Call letter1
2201     If dc5 = 2 Then Call letter2
2202     If dc5 = 3 Then Call letter3
2203     If dc5 = 4 Then Call letter4
2204     If dc5 = 5 Then Call letter5
2205     If dc5 = 6 Then Call letter6
2206     If dc5 = 7 Then Call letter7
2207     If dc5 = 8 Then Call letter8
2208     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
2209     Let cf = 15
2210     If dc3 = 1 Then Call king
2211     If dc3 = 2 Then Call queen
2212     If dc3 = 3 Then Call bishop
2213     If dc3 = 4 Then Call knight
2214     If dc3 = 5 Then Call rook
2215     If dc3 = 6 Then Call checker
2216     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
2217     Let cf = 0
2218     If dc6 = 1 Then Call king
2219     If dc6 = 2 Then Call queen
2220     If dc6 = 3 Then Call bishop
2221     If dc6 = 4 Then Call knight
2222     If dc6 = 5 Then Call rook
2223     If dc6 = 6 Then Call checker
2224
2225     Do
2226         Select Case InKey$
2227             Case Is = Chr$(32)
2228                 Exit Do
2229             Case Is = Chr$(13)
2230                 Call makrukfen
2231             Case Is = Chr$(27)
2232                 End
2233         End Select
2234     Loop
2235
2236     Call dices
2237
2238     Rem 3rd roll
2239     Let count = 0: Let index = 0
2240     Let dc1 = Int(Rnd * 8 + 1)
2241     Let dc2 = Int(Rnd * 8 + 1)
2242     Let dc3 = Int(Rnd * 5 + 2)
2243     Let dc4 = Int(Rnd * 8 + 1)
2244     Let dc5 = Int(Rnd * 8 + 1)
2245     Let dc6 = Int(Rnd * 5 + 2)
2246     Let w3 = board(dc2, dc1): Let b3 = board(dc5, dc4)
2247
2248     Select Case dc3
2249         Case Is = 1
2250             Rem
2251         Case Is = 2
2252             Do
2253                 Let count = count + 1
2254                 Let dc1 = Int(Rnd * 8 + 1)
2255                 Let dc2 = Int(Rnd * 8 + 1)
2256                 Let w3 = board(dc2, dc1)
2257                 If count > 8000 Then Exit Do
2258             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2259         Case Is = 3
2260             Let indexw3 = indexw3 + 1
2261             Do
2262                 Let count = count + 1
2263                 Let dc1 = Int(Rnd * 8 + 1)
2264                 Let dc2 = Int(Rnd * 8 + 1)
2265                 Let w3 = board(dc2, dc1)
2266                 If count > 8000 Then Exit Do
2267             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2268         Case Is = 4
2269             Let indexw4 = indexw4 + 1
2270             Do
2271                 Let count = count + 1
2272                 Let dc1 = Int(Rnd * 8 + 1)
2273                 Let dc2 = Int(Rnd * 8 + 1)
2274                 Let w3 = board(dc2, dc1)
2275                 If count > 8000 Then Exit Do
2276             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2277         Case Is = 5
2278             Let indexw5 = indexw5 + 1
2279             Do
2280                 Let count = count + 1
2281                 Let dc1 = Int(Rnd * 8 + 1)
2282                 Let dc2 = Int(Rnd * 8 + 1)
2283                 Let fw3x = dc1: Let fw3y = dc2
2284                 Let w3 = board(dc2, dc1)
2285                 If count > 8000 Then Exit Do
2286             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2287         Case Is = 6
2288             Do
2289                 Let count = count + 1
2290                 Let dc1 = Int(Rnd * 8 + 1)
2291                 Let dc2 = Int(Rnd * 8 + 1)
2292                 Let w3 = board(dc2, dc1)
2293                 If count > 8000 Then Exit Do
2294             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc2 < 3 Or dc2 > 5
2295     End Select
2296     Select Case dc6
2297         Case Is = 1
2298             Rem
2299         Case Is = 2
2300             Do
2301                 Let count = count + 1
2302                 Let dc4 = Int(Rnd * 8 + 1)
2303                 Let dc5 = Int(Rnd * 8 + 1)
2304                 Let b3 = board(dc5, dc4)
2305                 If count > 8000 Then Exit Do
2306             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2307         Case Is = 3
2308             Let indexb3 = indexb3 + 1
2309             Do
2310                 Let count = count + 1
2311                 Let dc4 = Int(Rnd * 8 + 1)
2312                 Let dc5 = Int(Rnd * 8 + 1)
2313                 Let b3 = board(dc5, dc4)
2314                 If count > 8000 Then Exit Do
2315             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2316         Case Is = 4
2317             Let indexb4 = indexb4 + 1
2318             Do
2319                 Let count = count + 1
2320                 Let dc4 = Int(Rnd * 8 + 1)
2321                 Let dc5 = Int(Rnd * 8 + 1)
2322                 Let b3 = board(dc5, dc4)
2323                 If count > 8000 Then Exit Do
2324             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2325         Case Is = 5
2326             Let indexb5 = indexb5 + 1
2327             Do
2328                 Let count = count + 1
2329                 Let dc4 = Int(Rnd * 8 + 1)
2330                 Let dc5 = Int(Rnd * 8 + 1)
2331                 Let fb3x = dc4: Let fb3y = dc5
2332                 Let b3 = board(dc5, dc4)
2333                 If count > 8000 Then Exit Do
2334             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
2335         Case Is = 6
2336             Do
2337                 Let count = count + 1
2338                 Let dc4 = Int(Rnd * 8 + 1)
2339                 Let dc5 = Int(Rnd * 8 + 1)
2340                 Let b3 = board(dc5, dc4)
2341                 If count > 8000 Then Exit Do
2342             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc5 < 4 Or dc5 > 6
2343     End Select
2344
2345     Let w3 = board(dc2, dc1): Let b3 = board(dc5, dc4)
2346     Let fw3x = dc1: Let fw3y = dc2: Let fb3x = dc4: Let fb3y = dc5
2347     Let fw3 = dc3: Let fb3 = dc6
2348
2349     Let x = 20: Let y = 160: Let cf = 15
2350     If dc3 = 1 Then Call king
2351     If dc3 = 2 Then Call queen
2352     If dc3 = 3 Then Call bishop
2353     If dc3 = 4 Then Call knight
2354     If dc3 = 5 Then Call rook
2355     If dc3 = 6 Then Call checker
2356     Let x = 580: Let y = 160: Let cf = 0
2357     If dc6 = 1 Then Call king
2358     If dc6 = 2 Then Call queen
2359     If dc6 = 3 Then Call bishop
2360     If dc6 = 4 Then Call knight
2361     If dc6 = 5 Then Call rook
2362     If dc6 = 6 Then Call checker
2363     Let x = 20: Let y = 220
2364     If dc1 = 1 Then Call letterA
2365     If dc1 = 2 Then Call letterB
2366     If dc1 = 3 Then Call letterC
2367     If dc1 = 4 Then Call letterD
2368     If dc1 = 5 Then Call letterE
2369     If dc1 = 6 Then Call letterF
2370     If dc1 = 7 Then Call letterG
2371     If dc1 = 8 Then Call letterH
2372     Let x = 20: Let y = 280
2373     If dc2 = 1 Then Call letter1
2374     If dc2 = 2 Then Call letter2
2375     If dc2 = 3 Then Call letter3
2376     If dc2 = 4 Then Call letter4
2377     If dc2 = 5 Then Call letter5
2378     If dc2 = 6 Then Call letter6
2379     If dc2 = 7 Then Call letter7
2380     If dc2 = 8 Then Call letter8
2381     Let x = 580: Let y = 220
2382     If dc4 = 1 Then Call letterA
2383     If dc4 = 2 Then Call letterB
2384     If dc4 = 3 Then Call letterC
2385     If dc4 = 4 Then Call letterD
2386     If dc4 = 5 Then Call letterE
2387     If dc4 = 6 Then Call letterF
2388     If dc4 = 7 Then Call letterG
2389     If dc4 = 8 Then Call letterH
2390     Let x = 580: Let y = 280
2391     If dc5 = 1 Then Call letter1
2392     If dc5 = 2 Then Call letter2
2393     If dc5 = 3 Then Call letter3
2394     If dc5 = 4 Then Call letter4
2395     If dc5 = 5 Then Call letter5
2396     If dc5 = 6 Then Call letter6
2397     If dc5 = 7 Then Call letter7
2398     If dc5 = 8 Then Call letter8
2399     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
2400     Let cf = 15
2401     If dc3 = 1 Then Call king
2402     If dc3 = 2 Then Call queen
2403     If dc3 = 3 Then Call bishop
2404     If dc3 = 4 Then Call knight
2405     If dc3 = 5 Then Call rook
2406     If dc3 = 6 Then Call checker
2407     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
2408     Let cf = 0
2409     If dc6 = 1 Then Call king
2410     If dc6 = 2 Then Call queen
2411     If dc6 = 3 Then Call bishop
2412     If dc6 = 4 Then Call knight
2413     If dc6 = 5 Then Call rook
2414     If dc6 = 6 Then Call checker
2415
2416     Do
2417         Select Case InKey$
2418             Case Is = Chr$(32)
2419                 Exit Do
2420             Case Is = Chr$(13)
2421                 Call makrukfen
2422             Case Is = Chr$(27)
2423                 End
2424         End Select
2425     Loop
2426
2427     Call dices
2428
2429     Rem 4th roll
2430     Let count = 0: Let index = 0
2431     Let dc1 = Int(Rnd * 8 + 1)
2432     Let dc2 = Int(Rnd * 8 + 1)
2433     Let dc3 = Int(Rnd * 5 + 2)
2434     Let dc4 = Int(Rnd * 8 + 1)
2435     Let dc5 = Int(Rnd * 8 + 1)
2436     Let dc6 = Int(Rnd * 5 + 2)
2437     Let w4 = board(dc2, dc1): Let b4 = board(dc5, dc4)
2438     If indexw3 > 2 Or indexw4 > 2 Or indexw5 > 2 Then Let dc3 = 6
2439     If indexb3 > 2 Or indexb4 > 2 Or indexb5 > 2 Then Let dc6 = 6
2440
2441     Select Case dc3
2442         Case Is = 1
2443             Rem
2444         Case Is = 2
2445             Do
2446                 Let count = count + 1
2447                 Let dc1 = Int(Rnd * 8 + 1)
2448                 Let dc2 = Int(Rnd * 8 + 1)
2449                 Let w4 = board(dc2, dc1)
2450                 If count > 8000 Then Exit Do
2451             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2452         Case Is = 3
2453             Do
2454                 Let count = count + 1
2455                 Let dc1 = Int(Rnd * 8 + 1)
2456                 Let dc2 = Int(Rnd * 8 + 1)
2457                 Let w4 = board(dc2, dc1)
2458                 If count > 8000 Then Exit Do
2459             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2460         Case Is = 4
2461             Do
2462                 Let count = count + 1
2463                 Let dc1 = Int(Rnd * 8 + 1)
2464                 Let dc2 = Int(Rnd * 8 + 1)
2465                 Let w4 = board(dc2, dc1)
2466                 If count > 8000 Then Exit Do
2467             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2468         Case Is = 5
2469             Do
2470                 Let count = count + 1
2471                 Let dc1 = Int(Rnd * 8 + 1)
2472                 Let dc2 = Int(Rnd * 8 + 1)
2473                 Let fw4x = dc1: Let fw4y = dc2
2474                 Let w4 = board(dc2, dc1)
2475                 If count > 8000 Then Exit Do
2476             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2477         Case Is = 6
2478             Do
2479                 Let count = count + 1
2480                 Let dc1 = Int(Rnd * 8 + 1)
2481                 Let dc2 = Int(Rnd * 8 + 1)
2482                 Let w4 = board(dc2, dc1)
2483                 If count > 8000 Then Exit Do
2484             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc2 < 3 Or dc2 > 5
2485     End Select
2486     Select Case dc6
2487         Case Is = 1
2488             Rem
2489         Case Is = 2
2490             Do
2491                 Let count = count + 1
2492                 Let dc4 = Int(Rnd * 8 + 1)
2493                 Let dc5 = Int(Rnd * 8 + 1)
2494                 Let b4 = board(dc5, dc4)
2495                 If count > 8000 Then Exit Do
2496             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2497         Case Is = 3
2498             Do
2499                 Let count = count + 1
2500                 Let dc4 = Int(Rnd * 8 + 1)
2501                 Let dc5 = Int(Rnd * 8 + 1)
2502                 Let b4 = board(dc5, dc4)
2503                 If count > 8000 Then Exit Do
2504             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2505         Case Is = 4
2506             Do
2507                 Let count = count + 1
2508                 Let dc4 = Int(Rnd * 8 + 1)
2509                 Let dc5 = Int(Rnd * 8 + 1)
2510                 Let b4 = board(dc5, dc4)
2511                 If count > 8000 Then Exit Do
2512             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2513         Case Is = 5
2514             Do
2515                 Let count = count + 1
2516                 Let dc4 = Int(Rnd * 8 + 1)
2517                 Let dc5 = Int(Rnd * 8 + 1)
2518                 Let fb4x = dc4: Let fb4y = dc5
2519                 Let b4 = board(dc5, dc4)
2520                 If count > 8000 Then Exit Do
2521             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
2522         Case Is = 6
2523             Do
2524                 Let count = count + 1
2525                 Let dc4 = Int(Rnd * 8 + 1)
2526                 Let dc5 = Int(Rnd * 8 + 1)
2527                 Let b4 = board(dc5, dc4)
2528                 If count > 8000 Then Exit Do
2529             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc5 <= 4 Or dc5 >= 6
2530     End Select
2531
2532     Let w4 = board(dc2, dc1): Let b4 = board(dc5, dc4)
2533     Let fw4x = dc1: Let fw4y = dc2: Let fb4x = dc4: Let fb4y = dc5
2534     Let fw4 = dc3: Let fb4 = dc6
2535
2536     Let x = 20: Let y = 160: Let cf = 15
2537     If dc3 = 1 Then Call king
2538     If dc3 = 2 Then Call queen
2539     If dc3 = 3 Then Call bishop
2540     If dc3 = 4 Then Call knight
2541     If dc3 = 5 Then Call rook
2542     If dc3 = 6 Then Call checker
2543     Let x = 580: Let y = 160: Let cf = 0
2544     If dc6 = 1 Then Call king
2545     If dc6 = 2 Then Call queen
2546     If dc6 = 3 Then Call bishop
2547     If dc6 = 4 Then Call knight
2548     If dc6 = 5 Then Call rook
2549     If dc6 = 6 Then Call checker
2550     Let x = 20: Let y = 220
2551     If dc1 = 1 Then Call letterA
2552     If dc1 = 2 Then Call letterB
2553     If dc1 = 3 Then Call letterC
2554     If dc1 = 4 Then Call letterD
2555     If dc1 = 5 Then Call letterE
2556     If dc1 = 6 Then Call letterF
2557     If dc1 = 7 Then Call letterG
2558     If dc1 = 8 Then Call letterH
2559     Let x = 20: Let y = 280
2560     If dc2 = 1 Then Call letter1
2561     If dc2 = 2 Then Call letter2
2562     If dc2 = 3 Then Call letter3
2563     If dc2 = 4 Then Call letter4
2564     If dc2 = 5 Then Call letter5
2565     If dc2 = 6 Then Call letter6
2566     If dc2 = 7 Then Call letter7
2567     If dc2 = 8 Then Call letter8
2568     Let x = 580: Let y = 220
2569     If dc4 = 1 Then Call letterA
2570     If dc4 = 2 Then Call letterB
2571     If dc4 = 3 Then Call letterC
2572     If dc4 = 4 Then Call letterD
2573     If dc4 = 5 Then Call letterE
2574     If dc4 = 6 Then Call letterF
2575     If dc4 = 7 Then Call letterG
2576     If dc4 = 8 Then Call letterH
2577     Let x = 580: Let y = 280
2578     If dc5 = 1 Then Call letter1
2579     If dc5 = 2 Then Call letter2
2580     If dc5 = 3 Then Call letter3
2581     If dc5 = 4 Then Call letter4
2582     If dc5 = 5 Then Call letter5
2583     If dc5 = 6 Then Call letter6
2584     If dc5 = 7 Then Call letter7
2585     If dc5 = 8 Then Call letter8
2586     Let x = (dc1 * 40) + 120: Let y = Abs((dc2 * 40) - 480) - 80
2587     Let cf = 15
2588     If dc3 = 1 Then Call king
2589     If dc3 = 2 Then Call queen
2590     If dc3 = 3 Then Call bishop
2591     If dc3 = 4 Then Call knight
2592     If dc3 = 5 Then Call rook
2593     If dc3 = 6 Then Call checker
2594     Let x = (dc4 * 40) + 120: Let y = Abs((dc5 * 40) - 480) - 80
2595     Let cf = 0
2596     If dc6 = 1 Then Call king
2597     If dc6 = 2 Then Call queen
2598     If dc6 = 3 Then Call bishop
2599     If dc6 = 4 Then Call knight
2600     If dc6 = 5 Then Call rook
2601     If dc6 = 6 Then Call checker
2602
2603     Do
2604         Select Case InKey$
2605             Case Is = Chr$(32)
2606                 Rem
2607             Case Is = Chr$(13)
2608                 Call makrukfen
2609             Case Is = Chr$(27)
2610                 End
2611         End Select
2612     Loop
2613
2614 End Sub
2615
2616 Sub xiangqi
2617
2618     Rem 1st roll
2619     Let count = 0: Let index = 0
2620     Let dc1 = Int(Rnd * 3 + 4)
2621     Let dc2 = Int(Rnd * 3 + 1)
2622     Let dc3 = 1
2623     Let dc4 = Int(Rnd * 3 + 4)
2624     Let dc5 = Int(Rnd * 3 + 8)
2625     Let dc6 = 1
2626     Let w1 = xiabo(dc2, dc1): Let b1 = xiabo(dc5, dc4)
2627
2628     Do
2629         Let count = count + 1
2630         Let dc1 = Int(Rnd * 3 + 4)
2631         Let dc2 = Int(Rnd * 3 + 1)
2632         Let dc4 = Int(Rnd * 3 + 4)
2633         Let dc5 = Int(Rnd * 3 + 8)
2634         Let w1 = xiabo(dc2, dc1): Let b1 = xiabo(dc5, dc4)
2635         If count > 8000 Then Exit Do
2636     Loop While w1 = b1
2637
2638     Let w1 = xiabo(dc2, dc1): Let b1 = xiabo(dc5, dc4)
2639     Let fw1x = dc1: Let fw1y = dc2: Let fb1x = dc4: Let fb1y = dc5
2640     Let fw1 = dc3: Let fb1 = dc6
2641
2642     Let x = 20: Let y = 160: Let cf = 15
2643     If dc3 = 1 Then Call king
2644     If dc3 = 2 Then Call queen
2645     If dc3 = 3 Then Call bishop
2646     If dc3 = 4 Then Call knight
2647     If dc3 = 5 Then Call rook
2648     If dc3 = 6 Then Call cannon
2649     If dc3 = 7 Then Call pawn
2650     Let x = 580: Let y = 160: Let cf = 0
2651     If dc6 = 1 Then Call king
2652     If dc6 = 2 Then Call queen
2653     If dc6 = 3 Then Call bishop
2654     If dc6 = 4 Then Call knight
2655     If dc6 = 5 Then Call rook
2656     If dc6 = 6 Then Call cannon
2657     If dc6 = 7 Then Call pawn
2658     Let x = 20: Let y = 220
2659     If dc1 = 1 Then Call letterA
2660     If dc1 = 2 Then Call letterB
2661     If dc1 = 3 Then Call letterC
2662     If dc1 = 4 Then Call letterD
2663     If dc1 = 5 Then Call letterE
2664     If dc1 = 6 Then Call letterF
2665     If dc1 = 7 Then Call letterG
2666     If dc1 = 8 Then Call letterH
2667     If dc1 = 9 Then Call letterI
2668     Let x = 20: Let y = 280
2669     If dc2 = 1 Then Call letter1
2670     If dc2 = 2 Then Call letter2
2671     If dc2 = 3 Then Call letter3
2672     If dc2 = 4 Then Call letter4
2673     If dc2 = 5 Then Call letter5
2674     If dc2 = 6 Then Call letter6
2675     If dc2 = 7 Then Call letter7
2676     If dc2 = 8 Then Call letter8
2677     If dc2 = 9 Then Call letter9
2678     If dc2 = 10 Then Call letter0
2679     Let x = 580: Let y = 220
2680     If dc4 = 1 Then Call letterA
2681     If dc4 = 2 Then Call letterB
2682     If dc4 = 3 Then Call letterC
2683     If dc4 = 4 Then Call letterD
2684     If dc4 = 5 Then Call letterE
2685     If dc4 = 6 Then Call letterF
2686     If dc4 = 7 Then Call letterG
2687     If dc4 = 8 Then Call letterH
2688     If dc4 = 9 Then Call letterI
2689     Let x = 580: Let y = 280
2690     If dc5 = 1 Then Call letter1
2691     If dc5 = 2 Then Call letter2
2692     If dc5 = 3 Then Call letter3
2693     If dc5 = 4 Then Call letter4
2694     If dc5 = 5 Then Call letter5
2695     If dc5 = 6 Then Call letter6
2696     If dc5 = 7 Then Call letter7
2697     If dc5 = 8 Then Call letter8
2698     If dc5 = 9 Then Call letter9
2699     If dc5 = 10 Then Call letter0
2700     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 40
2701     Let cf = 15: Call king
2702     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 40
2703     Let cf = 0: Call king
2704
2705     Do
2706         Select Case InKey$
2707             Case Is = Chr$(32)
2708                 Exit Do
2709             Case Is = Chr$(13)
2710                 Call xiangqifen
2711             Case Is = Chr$(27)
2712                 End
2713         End Select
2714     Loop
2715
2716     Call dices
2717
2718     Rem 2nd roll
2719     Let count = 0: Let index = 0
2720     Let dc1 = Int(Rnd * 9 + 1)
2721     Let dc2 = Int(Rnd * 10 + 1)
2722     Let dc3 = Int(Rnd * 6 + 2)
2723     Let dc4 = Int(Rnd * 9 + 1)
2724     Let dc5 = Int(Rnd * 10 + 1)
2725     Let dc6 = Int(Rnd * 6 + 2)
2726     Let w2 = xiabo(dc2, dc1): Let b2 = xiabo(dc5, dc4)
2727
2728     Select Case dc3
2729         Case Is = 1
2730             Rem
2731         Case Is = 2
2732             Let indexw2 = 1
2733             Let dc1 = Int(Rnd * 3 + 4)
2734             Let dc2 = Int(Rnd * 3 + 1)
2735             Do
2736                 Let count = count + 1
2737                 Let index = Int(Rnd * 5 + 1)
2738                 If index = 1 Then
2739                     Let dc1 = 4
2740                     Let dc2 = 1
2741                 End If
2742                 If index = 2 Then
2743                     Let dc1 = 6
2744                     Let dc2 = 1
2745                 End If
2746                 If index = 3 Then
2747                     Let dc1 = 5
2748                     Let dc2 = 2
2749                 End If
2750                 If index = 4 Then
2751                     Let dc1 = 4
2752                     Let dc2 = 3
2753                 End If
2754                 If index = 5 Then
2755                     Let dc1 = 6
2756                     Let dc2 = 3
2757                 End If
2758                 Let w2 = xiabo(dc2, dc1)
2759                 If count > 8000 Then Exit Do
2760             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or w2 Mod 2 <> 0
2761         Case Is = 3
2762             Let indexw3 = 1
2763             Let dc1 = Int(Rnd * 9 + 1)
2764             Let dc2 = Int(Rnd * 5 + 1)
2765             Do
2766                 Let count = count + 1
2767                 Let index = Int(Rnd * 7 + 1)
2768                 If index = 1 Then
2769                     Let dc1 = 3
2770                     Let dc2 = 1
2771                 End If
2772                 If index = 2 Then
2773                     Let dc1 = 7
2774                     Let dc2 = 1
2775                 End If
2776                 If index = 3 Then
2777                     Let dc1 = 1
2778                     Let dc2 = 3
2779                 End If
2780                 If index = 4 Then
2781                     Let dc1 = 5
2782                     Let dc2 = 3
2783                 End If
2784                 If index = 5 Then
2785                     Let dc1 = 9
2786                     Let dc2 = 3
2787                 End If
2788                 If index = 6 Then
2789                     Let dc1 = 3
2790                     Let dc2 = 5
2791                 End If
2792                 If index = 7 Then
2793                     Let dc1 = 7
2794                     Let dc2 = 5
2795                 End If
2796                 Let w2 = xiabo(dc2, dc1)
2797                 If count > 8000 Then Exit Do
2798             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2799         Case Is = 4
2800             Let indexw4 = 1
2801             Do
2802                 Let count = count + 1
2803                 Let dc1 = Int(Rnd * 9 + 1)
2804                 Let dc2 = Int(Rnd * 10 + 1)
2805                 Let w2 = xiabo(dc2, dc1)
2806                 If count > 8000 Then Exit Do
2807             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2808         Case Is = 5
2809             Let indexw5 = 1
2810             Do
2811                 Let count = count + 1
2812                 Let dc1 = Int(Rnd * 9 + 1)
2813                 Let dc2 = Int(Rnd * 10 + 1)
2814                 Let fw2x = dc1: Let fw2y = dc2
2815                 Let w2 = xiabo(dc2, dc1)
2816                 If count > 8000 Then Exit Do
2817             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2818         Case Is = 6
2819             Let indexw6 = 1
2820             Do
2821                 Let count = count + 1
2822                 Let dc1 = Int(Rnd * 9 + 1)
2823                 Let dc2 = Int(Rnd * 10 + 1)
2824                 Let fw2x = dc1: Let fw2y = dc2
2825                 Let w2 = xiabo(dc2, dc1)
2826                 If count > 8000 Then Exit Do
2827             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2828         Case Is = 7
2829             Do
2830                 Let count = count + 1
2831                 Let dc1 = Int(Rnd * 9 + 1)
2832                 Let dc2 = Int(Rnd * 10 + 1)
2833                 Let w2 = xiabo(dc2, dc1)
2834                 If count > 8000 Then Exit Do
2835             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc2 < 4 Or dc2 > 7
2836     End Select
2837     Select Case dc6
2838         Case Is = 1
2839             Rem
2840         Case Is = 2
2841             Let indexb2 = 1
2842             Let dc4 = Int(Rnd * 3 + 4)
2843             Let dc5 = Int(Rnd * 3 + 8)
2844             Do
2845                 Let count = count + 1
2846                 Let index = Int(Rnd * 5 + 1)
2847                 If index = 1 Then
2848                     Let dc4 = 4
2849                     Let dc5 = 10
2850                 End If
2851                 If index = 2 Then
2852                     Let dc4 = 6
2853                     Let dc5 = 10
2854                 End If
2855                 If index = 3 Then
2856                     Let dc4 = 5
2857                     Let dc5 = 9
2858                 End If
2859                 If index = 4 Then
2860                     Let dc4 = 4
2861                     Let dc5 = 8
2862                 End If
2863                 If index = 5 Then
2864                     Let dc4 = 6
2865                     Let dc5 = 8
2866                 End If
2867                 Let b2 = xiabo(dc5, dc4)
2868                 If count > 8000 Then Exit Do
2869             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or b2 Mod 2 = 0
2870         Case Is = 3
2871             Let indexb3 = 1
2872             Let dc4 = Int(Rnd * 9 + 1)
2873             Let dc5 = Int(Rnd * 5 + 6)
2874             Do
2875                 Let count = count + 1
2876                 Let index = Int(Rnd * 7 + 1)
2877                 If index = 1 Then
2878                     Let dc4 = 3
2879                     Let dc5 = 10
2880                 End If
2881                 If index = 2 Then
2882                     Let dc4 = 7
2883                     Let dc5 = 10
2884                 End If
2885                 If index = 3 Then
2886                     Let dc4 = 1
2887                     Let dc5 = 8
2888                 End If
2889                 If index = 4 Then
2890                     Let dc4 = 5
2891                     Let dc5 = 8
2892                 End If
2893                 If index = 5 Then
2894                     Let dc4 = 9
2895                     Let dc5 = 8
2896                 End If
2897                 If index = 6 Then
2898                     Let dc4 = 3
2899                     Let dc5 = 6
2900                 End If
2901                 If index = 7 Then
2902                     Let dc4 = 7
2903                     Let dc5 = 6
2904                 End If
2905                 Let b2 = xiabo(dc5, dc4)
2906                 If count > 8000 Then Exit Do
2907             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or b2
2908         Case Is = 4
2909             Let indexb4 = 1
2910             Do
2911                 Let count = count + 1
2912                 Let dc4 = Int(Rnd * 9 + 1)
2913                 Let dc5 = Int(Rnd * 10 + 1)
2914                 Let b2 = xiabo(dc5, dc4)
2915                 If count > 8000 Then Exit Do
2916             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2917         Case Is = 5
2918             Let indexb5 = 1
2919             Do
2920                 Let count = count + 1
2921                 Let dc4 = Int(Rnd * 9 + 1)
2922                 Let dc5 = Int(Rnd * 10 + 1)
2923                 Let fb2x = dc4: Let fb2y = dc5
2924                 Let b2 = xiabo(dc5, dc4)
2925                 If count > 8000 Then Exit Do
2926             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2927         Case Is = 6
2928             Let indexb6 = 1
2929             Do
2930                 Let count = count + 1
2931                 Let dc4 = Int(Rnd * 9 + 1)
2932                 Let dc5 = Int(Rnd * 10 + 1)
2933                 Let fb2x = dc4: Let fb2y = dc5
2934                 Let b2 = xiabo(dc5, dc4)
2935                 If count > 8000 Then Exit Do
2936             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
2937         Case Is = 7
2938             Do
2939                 Let count = count + 1
2940                 Let dc4 = Int(Rnd * 9 + 1)
2941                 Let dc5 = Int(Rnd * 10 + 1)
2942                 Let b2 = xiabo(dc5, dc4)
2943                 If count > 8000 Then Exit Do
2944             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc5 < 3 Or dc5 > 8
2945     End Select
2946
2947     Let w2 = xiabo(dc2, dc1): Let b2 = xiabo(dc5, dc4)
2948     Let fw2x = dc1: Let fw2y = dc2: Let fb2x = dc4: Let fb2y = dc5
2949     Let fw2 = dc3: Let fb2 = dc6
2950
2951     Let x = 20: Let y = 160: Let cf = 15
2952     If dc3 = 1 Then Call king
2953     If dc3 = 2 Then Call queen
2954     If dc3 = 3 Then Call bishop
2955     If dc3 = 4 Then Call knight
2956     If dc3 = 5 Then Call rook
2957     If dc3 = 6 Then Call cannon
2958     If dc3 = 7 Then Call pawn
2959     Let x = 580: Let y = 160: Let cf = 0
2960     If dc6 = 1 Then Call king
2961     If dc6 = 2 Then Call queen
2962     If dc6 = 3 Then Call bishop
2963     If dc6 = 4 Then Call knight
2964     If dc6 = 5 Then Call rook
2965     If dc6 = 6 Then Call cannon
2966     If dc6 = 7 Then Call pawn
2967     Let x = 20: Let y = 220
2968     If dc1 = 1 Then Call letterA
2969     If dc1 = 2 Then Call letterB
2970     If dc1 = 3 Then Call letterC
2971     If dc1 = 4 Then Call letterD
2972     If dc1 = 5 Then Call letterE
2973     If dc1 = 6 Then Call letterF
2974     If dc1 = 7 Then Call letterG
2975     If dc1 = 8 Then Call letterH
2976     If dc1 = 9 Then Call letterI
2977     Let x = 20: Let y = 280
2978     If dc2 = 1 Then Call letter1
2979     If dc2 = 2 Then Call letter2
2980     If dc2 = 3 Then Call letter3
2981     If dc2 = 4 Then Call letter4
2982     If dc2 = 5 Then Call letter5
2983     If dc2 = 6 Then Call letter6
2984     If dc2 = 7 Then Call letter7
2985     If dc2 = 8 Then Call letter8
2986     If dc2 = 9 Then Call letter9
2987     If dc2 = 10 Then Call letter0
2988     Let x = 580: Let y = 220
2989     If dc4 = 1 Then Call letterA
2990     If dc4 = 2 Then Call letterB
2991     If dc4 = 3 Then Call letterC
2992     If dc4 = 4 Then Call letterD
2993     If dc4 = 5 Then Call letterE
2994     If dc4 = 6 Then Call letterF
2995     If dc4 = 7 Then Call letterG
2996     If dc4 = 8 Then Call letterH
2997     If dc4 = 9 Then Call letterI
2998     Let x = 580: Let y = 280
2999     If dc5 = 1 Then Call letter1
3000     If dc5 = 2 Then Call letter2
3001     If dc5 = 3 Then Call letter3
3002     If dc5 = 4 Then Call letter4
3003     If dc5 = 5 Then Call letter5
3004     If dc5 = 6 Then Call letter6
3005     If dc5 = 7 Then Call letter7
3006     If dc5 = 8 Then Call letter8
3007     If dc5 = 9 Then Call letter9
3008     If dc5 = 10 Then Call letter0
3009     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 40
3010     Let cf = 15
3011     If dc3 = 1 Then Call king
3012     If dc3 = 2 Then Call queen
3013     If dc3 = 3 Then Call bishop
3014     If dc3 = 4 Then Call knight
3015     If dc3 = 5 Then Call rook
3016     If dc3 = 6 Then Call cannon
3017     If dc3 = 7 Then Call pawn
3018     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 40
3019     Let cf = 0
3020     If dc6 = 1 Then Call king
3021     If dc6 = 2 Then Call queen
3022     If dc6 = 3 Then Call bishop
3023     If dc6 = 4 Then Call knight
3024     If dc6 = 5 Then Call rook
3025     If dc6 = 6 Then Call cannon
3026     If dc6 = 7 Then Call pawn
3027
3028     Do
3029         Select Case InKey$
3030             Case Is = Chr$(32)
3031                 Exit Do
3032             Case Is = Chr$(13)
3033                 Call xiangqifen
3034             Case Is = Chr$(27)
3035                 End
3036         End Select
3037     Loop
3038
3039     Call dices
3040
3041     Rem 3rd roll
3042     Let count = 0: Let index = 0
3043     Let dc1 = Int(Rnd * 9 + 1)
3044     Let dc2 = Int(Rnd * 10 + 1)
3045     Let dc3 = Int(Rnd * 6 + 2)
3046     Let dc4 = Int(Rnd * 9 + 1)
3047     Let dc5 = Int(Rnd * 10 + 1)
3048     Let dc6 = Int(Rnd * 6 + 2)
3049     Let w3 = xiabo(dc2, dc1): Let b3 = xiabo(dc5, dc4)
3050
3051     Select Case dc3
3052         Case Is = 1
3053             Rem
3054         Case Is = 2
3055             Let indexw2 = indexw2 + 1
3056             Let dc1 = Int(Rnd * 3 + 4)
3057             Let dc2 = Int(Rnd * 3 + 1)
3058             Do
3059                 Let count = count + 1
3060                 Let index = Int(Rnd * 5 + 1)
3061                 If index = 1 Then
3062                     Let dc1 = 4
3063                     Let dc2 = 1
3064                 End If
3065                 If index = 2 Then
3066                     Let dc1 = 6
3067                     Let dc2 = 1
3068                 End If
3069                 If index = 3 Then
3070                     Let dc1 = 5
3071                     Let dc2 = 2
3072                 End If
3073                 If index = 4 Then
3074                     Let dc1 = 4
3075                     Let dc2 = 3
3076                 End If
3077                 If index = 5 Then
3078                     Let dc1 = 6
3079                     Let dc2 = 3
3080                 End If
3081                 Let w3 = xiabo(dc2, dc1)
3082                 If count > 8000 Then Exit Do
3083             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or w3 Mod 2 <> 0
3084         Case Is = 3
3085             Let indexw3 = indexw3 + 1
3086             Let dc1 = Int(Rnd * 9 + 1)
3087             Let dc2 = Int(Rnd * 5 + 1)
3088             Do
3089                 Let count = count + 1
3090                 Let index = Int(Rnd * 7 + 1)
3091                 If index = 1 Then
3092                     Let dc1 = 3
3093                     Let dc2 = 1
3094                 End If
3095                 If index = 2 Then
3096                     Let dc1 = 7
3097                     Let dc2 = 1
3098                 End If
3099                 If index = 3 Then
3100                     Let dc1 = 1
3101                     Let dc2 = 3
3102                 End If
3103                 If index = 4 Then
3104                     Let dc1 = 5
3105                     Let dc2 = 3
3106                 End If
3107                 If index = 5 Then
3108                     Let dc1 = 9
3109                     Let dc2 = 3
3110                 End If
3111                 If index = 6 Then
3112                     Let dc1 = 3
3113                     Let dc2 = 5
3114                 End If
3115                 If index = 7 Then
3116                     Let dc1 = 7
3117                     Let dc2 = 5
3118                 End If
3119                 Let w3 = xiabo(dc2, dc1)
3120                 If count > 8000 Then Exit Do
3121             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3122         Case Is = 4
3123             Let indexw4 = indexw4 + 1
3124             Do
3125                 Let count = count + 1
3126                 Let dc1 = Int(Rnd * 9 + 1)
3127                 Let dc2 = Int(Rnd * 10 + 1)
3128                 Let w3 = xiabo(dc2, dc1)
3129                 If count > 8000 Then Exit Do
3130             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3131         Case Is = 5
3132             Let indexw5 = indexw5 + 1
3133             Do
3134                 Let count = count + 1
3135                 Let dc1 = Int(Rnd * 9 + 1)
3136                 Let dc2 = Int(Rnd * 10 + 1)
3137                 Let fw3x = dc1: Let fw3y = dc2
3138                 Let w3 = xiabo(dc2, dc1)
3139                 If count > 8000 Then Exit Do
3140             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3141         Case Is = 6
3142             Let indexw6 = indexw6 + 1
3143             Do
3144                 Let count = count + 1
3145                 Let dc1 = Int(Rnd * 9 + 1)
3146                 Let dc2 = Int(Rnd * 10 + 1)
3147                 Let fw3x = dc1: Let fw3y = dc2
3148                 Let w3 = xiabo(dc2, dc1)
3149                 If count > 8000 Then Exit Do
3150             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3151         Case Is = 7
3152             Do
3153                 Let count = count + 1
3154                 Let dc1 = Int(Rnd * 9 + 1)
3155                 Let dc2 = Int(Rnd * 10 + 1)
3156                 Let w3 = xiabo(dc2, dc1)
3157                 If count > 8000 Then Exit Do
3158             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc2 < 4 Or dc2 > 7
3159     End Select
3160     Select Case dc6
3161         Case Is = 1
3162             Rem
3163         Case Is = 2
3164             Let indexb2 = indexb2 + 1
3165             Let dc4 = Int(Rnd * 3 + 4)
3166             Let dc5 = Int(Rnd * 3 + 8)
3167             Do
3168                 Let count = count + 1
3169                 Let index = Int(Rnd * 5 + 1)
3170                 If index = 1 Then
3171                     Let dc4 = 4
3172                     Let dc5 = 10
3173                 End If
3174                 If index = 2 Then
3175                     Let dc4 = 6
3176                     Let dc5 = 10
3177                 End If
3178                 If index = 3 Then
3179                     Let dc4 = 5
3180                     Let dc5 = 9
3181                 End If
3182                 If index = 4 Then
3183                     Let dc4 = 4
3184                     Let dc5 = 8
3185                 End If
3186                 If index = 5 Then
3187                     Let dc4 = 6
3188                     Let dc5 = 8
3189                 End If
3190                 Let b3 = xiabo(dc5, dc4)
3191                 If count > 8000 Then Exit Do
3192             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or b3 Mod 2 = 0
3193         Case Is = 3
3194             Let indexb3 = indexb3 + 1
3195             Let dc4 = Int(Rnd * 9 + 1)
3196             Let dc5 = Int(Rnd * 5 + 6)
3197             Do
3198                 Let count = count + 1
3199                 Let index = Int(Rnd * 7 + 1)
3200                 If index = 1 Then
3201                     Let dc4 = 3
3202                     Let dc5 = 10
3203                 End If
3204                 If index = 2 Then
3205                     Let dc4 = 7
3206                     Let dc5 = 10
3207                 End If
3208                 If index = 3 Then
3209                     Let dc4 = 1
3210                     Let dc5 = 8
3211                 End If
3212                 If index = 4 Then
3213                     Let dc4 = 5
3214                     Let dc5 = 8
3215                 End If
3216                 If index = 5 Then
3217                     Let dc4 = 9
3218                     Let dc5 = 8
3219                 End If
3220                 If index = 6 Then
3221                     Let dc4 = 3
3222                     Let dc5 = 6
3223                 End If
3224                 If index = 7 Then
3225                     Let dc4 = 7
3226                     Let dc5 = 6
3227                 End If
3228                 Let b3 = xiabo(dc5, dc4)
3229                 If count > 8000 Then Exit Do
3230             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3231         Case Is = 4
3232             Let indexb4 = indexb4 + 1
3233             Do
3234                 Let count = count + 1
3235                 Let dc4 = Int(Rnd * 9 + 1)
3236                 Let dc5 = Int(Rnd * 10 + 1)
3237                 Let b3 = xiabo(dc5, dc4)
3238                 If count > 8000 Then Exit Do
3239             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3240         Case Is = 5
3241             Let indexb5 = indexb5 + 1
3242             Do
3243                 Let count = count + 1
3244                 Let dc4 = Int(Rnd * 9 + 1)
3245                 Let dc5 = Int(Rnd * 10 + 1)
3246                 Let fb3x = dc4: Let fb3y = dc5
3247                 Let b3 = xiabo(dc5, dc4)
3248                 If count > 8000 Then Exit Do
3249             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3250         Case Is = 6
3251             Let indexb6 = indexb6 + 1
3252             Do
3253                 Let count = count + 1
3254                 Let dc4 = Int(Rnd * 9 + 1)
3255                 Let dc5 = Int(Rnd * 10 + 1)
3256                 Let fb3x = dc4: Let fb3y = dc5
3257                 Let b3 = xiabo(dc5, dc4)
3258                 If count > 8000 Then Exit Do
3259             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
3260         Case Is = 7
3261             Do
3262                 Let count = count + 1
3263                 Let dc4 = Int(Rnd * 9 + 1)
3264                 Let dc5 = Int(Rnd * 10 + 1)
3265                 Let b3 = xiabo(dc5, dc4)
3266                 If count > 8000 Then Exit Do
3267             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc5 < 3 Or dc5 > 8
3268     End Select
3269
3270     Let w3 = xiabo(dc2, dc1): Let b3 = xiabo(dc5, dc4)
3271     Let fw3x = dc1: Let fw3y = dc2: Let fb3x = dc4: Let fb3y = dc5
3272     Let fw3 = dc3: Let fb3 = dc6
3273
3274     Let x = 20: Let y = 160: Let cf = 15
3275     If dc3 = 1 Then Call king
3276     If dc3 = 2 Then Call queen
3277     If dc3 = 3 Then Call bishop
3278     If dc3 = 4 Then Call knight
3279     If dc3 = 5 Then Call rook
3280     If dc3 = 6 Then Call cannon
3281     If dc3 = 7 Then Call pawn
3282     Let x = 580: Let y = 160: Let cf = 0
3283     If dc6 = 1 Then Call king
3284     If dc6 = 2 Then Call queen
3285     If dc6 = 3 Then Call bishop
3286     If dc6 = 4 Then Call knight
3287     If dc6 = 5 Then Call rook
3288     If dc6 = 6 Then Call cannon
3289     If dc6 = 7 Then Call pawn
3290     Let x = 20: Let y = 220
3291     If dc1 = 1 Then Call letterA
3292     If dc1 = 2 Then Call letterB
3293     If dc1 = 3 Then Call letterC
3294     If dc1 = 4 Then Call letterD
3295     If dc1 = 5 Then Call letterE
3296     If dc1 = 6 Then Call letterF
3297     If dc1 = 7 Then Call letterG
3298     If dc1 = 8 Then Call letterH
3299     If dc1 = 9 Then Call letterI
3300     Let x = 20: Let y = 280
3301     If dc2 = 1 Then Call letter1
3302     If dc2 = 2 Then Call letter2
3303     If dc2 = 3 Then Call letter3
3304     If dc2 = 4 Then Call letter4
3305     If dc2 = 5 Then Call letter5
3306     If dc2 = 6 Then Call letter6
3307     If dc2 = 7 Then Call letter7
3308     If dc2 = 8 Then Call letter8
3309     If dc2 = 9 Then Call letter9
3310     If dc2 = 10 Then Call letter0
3311     Let x = 580: Let y = 220
3312     If dc4 = 1 Then Call letterA
3313     If dc4 = 2 Then Call letterB
3314     If dc4 = 3 Then Call letterC
3315     If dc4 = 4 Then Call letterD
3316     If dc4 = 5 Then Call letterE
3317     If dc4 = 6 Then Call letterF
3318     If dc4 = 7 Then Call letterG
3319     If dc4 = 8 Then Call letterH
3320     If dc4 = 9 Then Call letterI
3321     Let x = 580: Let y = 280
3322     If dc5 = 1 Then Call letter1
3323     If dc5 = 2 Then Call letter2
3324     If dc5 = 3 Then Call letter3
3325     If dc5 = 4 Then Call letter4
3326     If dc5 = 5 Then Call letter5
3327     If dc5 = 6 Then Call letter6
3328     If dc5 = 7 Then Call letter7
3329     If dc5 = 8 Then Call letter8
3330     If dc5 = 9 Then Call letter9
3331     If dc5 = 10 Then Call letter0
3332     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 40
3333     Let cf = 15
3334     If dc3 = 1 Then Call king
3335     If dc3 = 2 Then Call queen
3336     If dc3 = 3 Then Call bishop
3337     If dc3 = 4 Then Call knight
3338     If dc3 = 5 Then Call rook
3339     If dc3 = 6 Then Call cannon
3340     If dc3 = 7 Then Call pawn
3341     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 40
3342     Let cf = 0
3343     If dc6 = 1 Then Call king
3344     If dc6 = 2 Then Call queen
3345     If dc6 = 3 Then Call bishop
3346     If dc6 = 4 Then Call knight
3347     If dc6 = 5 Then Call rook
3348     If dc6 = 6 Then Call cannon
3349     If dc6 = 7 Then Call pawn
3350
3351     Do
3352         Select Case InKey$
3353             Case Is = Chr$(32)
3354                 Exit Do
3355             Case Is = Chr$(13)
3356                 Call xiangqifen
3357             Case Is = Chr$(27)
3358                 End
3359         End Select
3360     Loop
3361
3362     Call dices
3363
3364     Rem 4th roll
3365     Let count = 0: Let index = 0
3366     Let dc1 = Int(Rnd * 9 + 1)
3367     Let dc2 = Int(Rnd * 10 + 1)
3368     Let dc3 = Int(Rnd * 6 + 2)
3369     Let dc4 = Int(Rnd * 9 + 1)
3370     Let dc5 = Int(Rnd * 10 + 1)
3371     Let dc6 = Int(Rnd * 6 + 2)
3372     Let w4 = xiabo(dc2, dc1): Let b2 = xiabo(dc5, dc4)
3373     If indexw2 > 2 Or indexw3 > 2 Or indexw4 > 2 Or indexw5 > 2 Or indexw6 > 2 Then dc3 = 7
3374     If indexb2 > 2 Or indexb3 > 2 Or indexb4 > 2 Or indexb5 > 2 Or indexb6 > 2 Then dc6 = 7
3375
3376     Select Case dc3
3377         Case Is = 1
3378             Rem
3379         Case Is = 2
3380             Let dc1 = Int(Rnd * 3 + 4)
3381             Let dc2 = Int(Rnd * 3 + 1)
3382             Do
3383                 Let count = count + 1
3384                 Let index = Int(Rnd * 5 + 1)
3385                 If index = 1 Then
3386                     Let dc1 = 4
3387                     Let dc2 = 1
3388                 End If
3389                 If index = 2 Then
3390                     Let dc1 = 6
3391                     Let dc2 = 1
3392                 End If
3393                 If index = 3 Then
3394                     Let dc1 = 5
3395                     Let dc2 = 2
3396                 End If
3397                 If index = 4 Then
3398                     Let dc1 = 4
3399                     Let dc2 = 3
3400                 End If
3401                 If index = 5 Then
3402                     Let dc1 = 6
3403                     Let dc2 = 3
3404                 End If
3405                 Let w4 = xiabo(dc2, dc1)
3406                 If count > 8000 Then Exit Do
3407             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or w4 Mod 2 <> 0
3408         Case Is = 3
3409             Let dc1 = Int(Rnd * 9 + 1)
3410             Let dc2 = Int(Rnd * 5 + 1)
3411             Do
3412                 Let count = count + 1
3413                 Let index = Int(Rnd * 7 + 1)
3414                 If index = 1 Then
3415                     Let dc1 = 3
3416                     Let dc2 = 1
3417                 End If
3418                 If index = 2 Then
3419                     Let dc1 = 7
3420                     Let dc2 = 1
3421                 End If
3422                 If index = 3 Then
3423                     Let dc1 = 1
3424                     Let dc2 = 3
3425                 End If
3426                 If index = 4 Then
3427                     Let dc1 = 5
3428                     Let dc2 = 3
3429                 End If
3430                 If index = 5 Then
3431                     Let dc1 = 9
3432                     Let dc2 = 3
3433                 End If
3434                 If index = 6 Then
3435                     Let dc1 = 3
3436                     Let dc2 = 5
3437                 End If
3438                 If index = 7 Then
3439                     Let dc1 = 7
3440                     Let dc2 = 5
3441                 End If
3442                 Let w4 = xiabo(dc2, dc1)
3443                 If count > 8000 Then Exit Do
3444             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3445         Case Is = 4
3446             Do
3447                 Let count = count + 1
3448                 Let dc1 = Int(Rnd * 9 + 1)
3449                 Let dc2 = Int(Rnd * 10 + 1)
3450                 Let w4 = xiabo(dc2, dc1)
3451                 If count > 8000 Then Exit Do
3452             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3453         Case Is = 5
3454             Do
3455                 Let count = count + 1
3456                 Let dc1 = Int(Rnd * 9 + 1)
3457                 Let dc2 = Int(Rnd * 10 + 1)
3458                 Let fw4x = dc1: Let fw4y = dc2
3459                 Let w4 = xiabo(dc2, dc1)
3460                 If count > 8000 Then Exit Do
3461             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3462         Case Is = 6
3463             Do
3464                 Let count = count + 1
3465                 Let dc1 = Int(Rnd * 9 + 1)
3466                 Let dc2 = Int(Rnd * 10 + 1)
3467                 Let fw4x = dc1: Let fw4y = dc2
3468                 Let w4 = xiabo(dc2, dc1)
3469                 If count > 8000 Then Exit Do
3470             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3471         Case Is = 7
3472             Do
3473                 Let count = count + 1
3474                 Let dc1 = Int(Rnd * 9 + 1)
3475                 Let dc2 = Int(Rnd * 10 + 1)
3476                 Let w4 = xiabo(dc2, dc1)
3477                 If count > 8000 Then Exit Do
3478             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 < 3 Or dc2 > 8
3479     End Select
3480     Select Case dc6
3481         Case Is = 1
3482             Rem
3483         Case Is = 2
3484             Let dc4 = Int(Rnd * 3 + 4)
3485             Let dc5 = Int(Rnd * 3 + 8)
3486             Do
3487                 Let count = count + 1
3488                 Let index = Int(Rnd * 5 + 1)
3489                 If index = 1 Then
3490                     Let dc4 = 4
3491                     Let dc5 = 10
3492                 End If
3493                 If index = 2 Then
3494                     Let dc4 = 6
3495                     Let dc5 = 10
3496                 End If
3497                 If index = 3 Then
3498                     Let dc4 = 5
3499                     Let dc5 = 9
3500                 End If
3501                 If index = 4 Then
3502                     Let dc4 = 4
3503                     Let dc5 = 8
3504                 End If
3505                 If index = 5 Then
3506                     Let dc4 = 6
3507                     Let dc5 = 8
3508                 End If
3509                 Let b4 = xiabo(dc5, dc4)
3510                 If count > 8000 Then Exit Do
3511             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or b4 Mod 2 = 0
3512         Case Is = 3
3513             Let dc4 = Int(Rnd * 9 + 1)
3514             Let dc5 = Int(Rnd * 5 + 6)
3515             Do
3516                 Let count = count + 1
3517                 Let index = Int(Rnd * 7 + 1)
3518                 If index = 1 Then
3519                     Let dc4 = 3
3520                     Let dc5 = 10
3521                 End If
3522                 If index = 2 Then
3523                     Let dc4 = 7
3524                     Let dc5 = 10
3525                 End If
3526                 If index = 3 Then
3527                     Let dc4 = 1
3528                     Let dc5 = 8
3529                 End If
3530                 If index = 4 Then
3531                     Let dc4 = 5
3532                     Let dc5 = 8
3533                 End If
3534                 If index = 5 Then
3535                     Let dc4 = 9
3536                     Let dc5 = 8
3537                 End If
3538                 If index = 6 Then
3539                     Let dc4 = 3
3540                     Let dc5 = 6
3541                 End If
3542                 If index = 7 Then
3543                     Let dc4 = 7
3544                     Let dc5 = 6
3545                 End If
3546                 Let b4 = xiabo(dc5, dc4)
3547                 If count > 8000 Then Exit Do
3548             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3549         Case Is = 4
3550             Do
3551                 Let count = count + 1
3552                 Let dc4 = Int(Rnd * 9 + 1)
3553                 Let dc5 = Int(Rnd * 10 + 1)
3554                 Let b4 = xiabo(dc5, dc4)
3555                 If count > 8000 Then Exit Do
3556             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3557         Case Is = 5
3558             Do
3559                 Let count = count + 1
3560                 Let dc4 = Int(Rnd * 9 + 1)
3561                 Let dc5 = Int(Rnd * 10 + 1)
3562                 Let fb4x = dc4: Let fb4y = dc5
3563                 Let b4 = xiabo(dc5, dc4)
3564                 If count > 8000 Then Exit Do
3565             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3566         Case Is = 6
3567             Do
3568                 Let count = count + 1
3569                 Let dc4 = Int(Rnd * 9 + 1)
3570                 Let dc5 = Int(Rnd * 10 + 1)
3571                 Let fb4x = dc4: Let fb4y = dc5
3572                 Let b4 = xiabo(dc5, dc4)
3573                 If count > 8000 Then Exit Do
3574             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
3575         Case Is = 7
3576             Do
3577                 Let count = count + 1
3578                 Let dc4 = Int(Rnd * 9 + 1)
3579                 Let dc5 = Int(Rnd * 10 + 1)
3580                 Let b4 = xiabo(dc5, dc4)
3581                 If count > 8000 Then Exit Do
3582             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc5 < 3 Or dc5 > 8
3583     End Select
3584
3585     Let w4 = xiabo(dc2, dc1): Let b4 = xiabo(dc5, dc4)
3586     Let fw4x = dc1: Let fw4y = dc2: Let fb4x = dc4: Let fb4y = dc5
3587     Let fw4 = dc3: Let fb4 = dc6
3588
3589     Let x = 20: Let y = 160: Let cf = 15
3590     If dc3 = 1 Then Call king
3591     If dc3 = 2 Then Call queen
3592     If dc3 = 3 Then Call bishop
3593     If dc3 = 4 Then Call knight
3594     If dc3 = 5 Then Call rook
3595     If dc3 = 6 Then Call cannon
3596     If dc3 = 7 Then Call pawn
3597     Let x = 580: Let y = 160: Let cf = 0
3598     If dc6 = 1 Then Call king
3599     If dc6 = 2 Then Call queen
3600     If dc6 = 3 Then Call bishop
3601     If dc6 = 4 Then Call knight
3602     If dc6 = 5 Then Call rook
3603     If dc6 = 6 Then Call cannon
3604     If dc6 = 7 Then Call pawn
3605     Let x = 20: Let y = 220
3606     If dc1 = 1 Then Call letterA
3607     If dc1 = 2 Then Call letterB
3608     If dc1 = 3 Then Call letterC
3609     If dc1 = 4 Then Call letterD
3610     If dc1 = 5 Then Call letterE
3611     If dc1 = 6 Then Call letterF
3612     If dc1 = 7 Then Call letterG
3613     If dc1 = 8 Then Call letterH
3614     If dc1 = 9 Then Call letterI
3615     Let x = 20: Let y = 280
3616     If dc2 = 1 Then Call letter1
3617     If dc2 = 2 Then Call letter2
3618     If dc2 = 3 Then Call letter3
3619     If dc2 = 4 Then Call letter4
3620     If dc2 = 5 Then Call letter5
3621     If dc2 = 6 Then Call letter6
3622     If dc2 = 7 Then Call letter7
3623     If dc2 = 8 Then Call letter8
3624     If dc2 = 9 Then Call letter9
3625     If dc2 = 10 Then Call letter0
3626     Let x = 580: Let y = 220
3627     If dc4 = 1 Then Call letterA
3628     If dc4 = 2 Then Call letterB
3629     If dc4 = 3 Then Call letterC
3630     If dc4 = 4 Then Call letterD
3631     If dc4 = 5 Then Call letterE
3632     If dc4 = 6 Then Call letterF
3633     If dc4 = 7 Then Call letterG
3634     If dc4 = 8 Then Call letterH
3635     If dc4 = 9 Then Call letterI
3636     Let x = 580: Let y = 280
3637     If dc5 = 1 Then Call letter1
3638     If dc5 = 2 Then Call letter2
3639     If dc5 = 3 Then Call letter3
3640     If dc5 = 4 Then Call letter4
3641     If dc5 = 5 Then Call letter5
3642     If dc5 = 6 Then Call letter6
3643     If dc5 = 7 Then Call letter7
3644     If dc5 = 8 Then Call letter8
3645     If dc5 = 9 Then Call letter9
3646     If dc5 = 10 Then Call letter0
3647     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 40
3648     Let cf = 15
3649     If dc3 = 1 Then Call king
3650     If dc3 = 2 Then Call queen
3651     If dc3 = 3 Then Call bishop
3652     If dc3 = 4 Then Call knight
3653     If dc3 = 5 Then Call rook
3654     If dc3 = 6 Then Call cannon
3655     If dc3 = 7 Then Call pawn
3656     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 40
3657     Let cf = 0
3658     If dc6 = 1 Then Call king
3659     If dc6 = 2 Then Call queen
3660     If dc6 = 3 Then Call bishop
3661     If dc6 = 4 Then Call knight
3662     If dc6 = 5 Then Call rook
3663     If dc6 = 6 Then Call cannon
3664     If dc6 = 7 Then Call pawn
3665
3666     Do
3667         Select Case InKey$
3668             Case Is = Chr$(32)
3669                 Rem
3670             Case Is = Chr$(13)
3671                 Call xiangqifen
3672             Case Is = Chr$(27)
3673                 End
3674         End Select
3675     Loop
3676
3677 End Sub
3678
3679 Sub shogi
3680
3681     Rem 1st roll
3682     Let count = 0: Let index = 0
3683     Let dc1 = Int(Rnd * 9 + 1)
3684     Let dc2 = Int(Rnd * 9 + 1)
3685     Let dc3 = 1
3686     Let dc4 = Int(Rnd * 9 + 1)
3687     Let dc5 = Int(Rnd * 9 + 1)
3688     Let dc6 = 1
3689     Let w1 = shobo(dc2, dc1): Let b1 = shobo(dc5, dc4)
3690
3691     Do
3692         Let count = count + 1
3693         Let dc1 = Int(Rnd * 9 + 1)
3694         Let dc2 = Int(Rnd * 9 + 1)
3695         Let dc4 = Int(Rnd * 9 + 1)
3696         Let dc5 = Int(Rnd * 9 + 1)
3697         Let w1 = shobo(dc2, dc1): Let b1 = shobo(dc5, dc4)
3698         If count > 8000 Then Exit Do
3699     Loop While Abs(w1 - b1) < 11
3700
3701     Let w1 = shobo(dc2, dc1): Let b1 = shobo(dc5, dc4)
3702     Let fw1x = dc1: Let fw1y = dc2: Let fb1x = dc4: Let fb1y = dc5
3703     Let fw1 = dc3: Let fb1 = dc6
3704
3705     Let x = 20: Let y = 160: Let cf = 15
3706     If dc3 = 1 Then Call king
3707     If dc3 = 2 Then Call queen
3708     If dc3 = 3 Then Call general
3709     If dc3 = 4 Then Call bishop
3710     If dc3 = 5 Then Call knight
3711     If dc3 = 6 Then Call rook
3712     If dc3 = 7 Then Call lance
3713     If dc3 = 8 Then Call pawn
3714     If dc3 = 9 Then Call tokin
3715     If dc3 = 10 Then Call dragon
3716     If dc3 = 11 Then Call horse
3717     Let x = 580: Let y = 160: Let cf = 0
3718     If dc6 = 1 Then Call king
3719     If dc6 = 2 Then Call queen
3720     If dc6 = 3 Then Call general
3721     If dc6 = 4 Then Call bishop
3722     If dc6 = 5 Then Call knight
3723     If dc6 = 6 Then Call rook
3724     If dc6 = 7 Then Call lance
3725     If dc6 = 8 Then Call pawn
3726     If dc6 = 9 Then Call tokin
3727     If dc6 = 10 Then Call dragon
3728     If dc6 = 11 Then Call horse
3729     Let x = 20: Let y = 220
3730     If dc1 = 1 Then Call letterA
3731     If dc1 = 2 Then Call letterB
3732     If dc1 = 3 Then Call letterC
3733     If dc1 = 4 Then Call letterD
3734     If dc1 = 5 Then Call letterE
3735     If dc1 = 6 Then Call letterF
3736     If dc1 = 7 Then Call letterG
3737     If dc1 = 8 Then Call letterH
3738     If dc1 = 9 Then Call letterI
3739     Let x = 20: Let y = 280
3740     If dc2 = 1 Then Call letter1
3741     If dc2 = 2 Then Call letter2
3742     If dc2 = 3 Then Call letter3
3743     If dc2 = 4 Then Call letter4
3744     If dc2 = 5 Then Call letter5
3745     If dc2 = 6 Then Call letter6
3746     If dc2 = 7 Then Call letter7
3747     If dc2 = 8 Then Call letter8
3748     If dc2 = 9 Then Call letter9
3749     If dc2 = 10 Then Call letter0
3750     Let x = 580: Let y = 220
3751     If dc4 = 1 Then Call letterA
3752     If dc4 = 2 Then Call letterB
3753     If dc4 = 3 Then Call letterC
3754     If dc4 = 4 Then Call letterD
3755     If dc4 = 5 Then Call letterE
3756     If dc4 = 6 Then Call letterF
3757     If dc4 = 7 Then Call letterG
3758     If dc4 = 8 Then Call letterH
3759     If dc4 = 9 Then Call letterI
3760     Let x = 580: Let y = 280
3761     If dc5 = 1 Then Call letter1
3762     If dc5 = 2 Then Call letter2
3763     If dc5 = 3 Then Call letter3
3764     If dc5 = 4 Then Call letter4
3765     If dc5 = 5 Then Call letter5
3766     If dc5 = 6 Then Call letter6
3767     If dc5 = 7 Then Call letter7
3768     If dc5 = 8 Then Call letter8
3769     If dc5 = 9 Then Call letter9
3770     If dc5 = 10 Then Call letter0
3771     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 60
3772     Let cf = 15: Call king
3773     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 60
3774     Let cf = 0: Call king
3775
3776     Do
3777         Select Case InKey$
3778             Case Is = Chr$(32)
3779                 Exit Do
3780             Case Is = Chr$(13)
3781                 Call shogifen
3782             Case Is = Chr$(27)
3783                 End
3784         End Select
3785     Loop
3786
3787     Call dices
3788
3789     Rem 2nd roll
3790     Let count = 0: Let index = 0
3791     Let dc1 = Int(Rnd * 9 + 1)
3792     Let dc2 = Int(Rnd * 9 + 1)
3793     Let dc3 = Int(Rnd * 10 + 2)
3794     Let dc4 = Int(Rnd * 9 + 1)
3795     Let dc5 = Int(Rnd * 9 + 1)
3796     Let dc6 = Int(Rnd * 10 + 2)
3797     Let w2 = shobo(dc2, dc1): Let b2 = shobo(dc5, dc4)
3798
3799     Select Case dc3
3800         Case Is = 1
3801             Rem
3802         Case Is = 2
3803             Do
3804                 Let count = count + 1
3805                 Let dc1 = Int(Rnd * 9 + 1)
3806                 Let dc2 = Int(Rnd * 9 + 1)
3807                 Let w2 = shobo(dc2, dc1)
3808                 If count > 8000 Then Exit Do
3809             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3810         Case Is = 3
3811             Let indexw3 = 1
3812             Do
3813                 Let count = count + 1
3814                 Let dc1 = Int(Rnd * 9 + 1)
3815                 Let dc2 = Int(Rnd * 9 + 1)
3816                 Let w2 = shobo(dc2, dc1)
3817                 If count > 8000 Then Exit Do
3818             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3819         Case Is = 4
3820             Let indexw4 = 1
3821             Do
3822                 Let count = count + 1
3823                 Let dc1 = Int(Rnd * 9 + 1)
3824                 Let dc2 = Int(Rnd * 9 + 1)
3825                 Let w2 = shobo(dc2, dc1)
3826                 If count > 8000 Then Exit Do
3827             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3828         Case Is = 5
3829             Let indexw5 = 1
3830             Do
3831                 Let count = count + 1
3832                 Let dc1 = Int(Rnd * 9 + 1)
3833                 Let dc2 = Int(Rnd * 9 + 1)
3834                 Let fw2x = dc1: Let fw2y = dc2
3835                 Let w2 = shobo(dc2, dc1)
3836                 If count > 8000 Then Exit Do
3837             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3838         Case Is = 6
3839             Do
3840                 Let indexw6 = 1
3841                 Let count = count + 1
3842                 Let dc1 = Int(Rnd * 9 + 1)
3843                 Let dc2 = Int(Rnd * 9 + 1)
3844                 Let fw2x = dc1: Let fw2y = dc2
3845                 Let w2 = shobo(dc2, dc1)
3846                 If count > 8000 Then Exit Do
3847             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3848         Case Is = 7
3849             Let indexw7 = 1
3850             Let index = Int(Rnd * 2 + 1)
3851             If index = 1 Then Let dc1 = 1 Else Let dc1 = 9
3852             If dc1 = 1 Then Let indexw71 = 1 Else Let indexw72 = 1
3853             Do
3854                 Let count = count + 1
3855                 Let dc2 = Int(Rnd * 9 + 1)
3856                 Let w2 = shobo(dc2, dc1)
3857                 If count > 8000 Then Exit Do
3858             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3859         Case Is = 8
3860             Do
3861                 Let count = count + 1
3862                 Let dc1 = Int(Rnd * 9 + 1)
3863                 Let dc2 = Int(Rnd * 9 + 1)
3864                 Let w2 = shobo(dc2, dc1)
3865                 If count > 8000 Then Exit Do
3866             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc2 < 3 Or dc2 > 7
3867         Case Is = 9
3868             Let indexw9 = 1
3869             Do
3870                 Let count = count + 1
3871                 Let dc1 = Int(Rnd * 9 + 1)
3872                 Let dc2 = Int(Rnd * 9 + 1)
3873                 Let w2 = shobo(dc2, dc1)
3874                 If count > 8000 Then Exit Do
3875             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3876         Case Is = 10
3877             Let indexw10 = 1
3878             Do
3879                 Let count = count + 1
3880                 Let dc1 = Int(Rnd * 9 + 1)
3881                 Let dc2 = Int(Rnd * 9 + 1)
3882                 Let w2 = shobo(dc2, dc1)
3883                 If count > 8000 Then Exit Do
3884             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3885         Case Is = 11
3886             Do
3887                 Let count = count + 1
3888                 Let dc1 = Int(Rnd * 9 + 1)
3889                 Let dc2 = Int(Rnd * 9 + 1)
3890                 Let w2 = shobo(dc2, dc1)
3891                 If count > 8000 Then Exit Do
3892             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3893     End Select
3894     Select Case dc6
3895         Case Is = 1
3896             Rem
3897         Case Is = 2
3898             Do
3899                 Let count = count + 1
3900                 Let dc4 = Int(Rnd * 9 + 1)
3901                 Let dc5 = Int(Rnd * 9 + 1)
3902                 Let b2 = shobo(dc5, dc4)
3903                 If count > 8000 Then Exit Do
3904             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3905         Case Is = 3
3906             Let indexb3 = 1
3907             Do
3908                 Let count = count + 1
3909                 Let dc4 = Int(Rnd * 9 + 1)
3910                 Let dc5 = Int(Rnd * 9 + 1)
3911                 Let b2 = shobo(dc5, dc4)
3912                 If count > 8000 Then Exit Do
3913             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3914         Case Is = 4
3915             Let indexb4 = 1
3916             Do
3917                 Let count = count + 1
3918                 Let dc4 = Int(Rnd * 9 + 1)
3919                 Let dc5 = Int(Rnd * 9 + 1)
3920                 Let b2 = shobo(dc5, dc4)
3921                 If count > 8000 Then Exit Do
3922             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3923         Case Is = 5
3924             Let indexb5 = 1
3925             Do
3926                 Let count = count + 1
3927                 Let dc4 = Int(Rnd * 9 + 1)
3928                 Let dc5 = Int(Rnd * 9 + 1)
3929                 Let fb2x = dc4: Let fb2y = dc5
3930                 Let b2 = shobo(dc5, dc4)
3931                 If count > 8000 Then Exit Do
3932             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3933         Case Is = 6
3934             Do
3935                 Let indexb6 = 1
3936                 Let count = count + 1
3937                 Let dc4 = Int(Rnd * 9 + 1)
3938                 Let dc5 = Int(Rnd * 9 + 1)
3939                 Let fb2x = dc4: Let fb2y = dc5
3940                 Let b2 = shobo(dc5, dc4)
3941                 If count > 8000 Then Exit Do
3942             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3943         Case Is = 7
3944             Let indexb7 = 1
3945             Let index = Int(Rnd * 2 + 1)
3946             If index = 1 Then Let dc4 = 1 Else Let dc4 = 9
3947             If dc4 = 1 Then Let indexb71 = 1 Else Let indexb72 = 1
3948             Do
3949                 Let count = count + 1
3950                 Let dc5 = Int(Rnd * 9 + 1)
3951                 Let b2 = shobo(dc5, dc4)
3952                 If count > 8000 Then Exit Do
3953             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3954         Case Is = 8
3955             Do
3956                 Let count = count + 1
3957                 Let dc4 = Int(Rnd * 9 + 1)
3958                 Let dc5 = Int(Rnd * 9 + 1)
3959                 Let b2 = shobo(dc5, dc4)
3960                 If count > 8000 Then Exit Do
3961             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1 Or dc5 < 3 Or dc5 > 7
3962         Case Is = 9
3963             Let indexb9 = 1
3964             Do
3965                 Let count = count + 1
3966                 Let dc4 = Int(Rnd * 9 + 1)
3967                 Let dc5 = Int(Rnd * 9 + 1)
3968                 Let b2 = shobo(dc5, dc4)
3969                 If count > 8000 Then Exit Do
3970             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3971         Case Is = 10
3972             Let indexb10 = 1
3973             Do
3974                 Let count = count + 1
3975                 Let dc4 = Int(Rnd * 9 + 1)
3976                 Let dc5 = Int(Rnd * 9 + 1)
3977                 Let b2 = shobo(dc5, dc4)
3978                 If count > 8000 Then Exit Do
3979             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3980         Case Is = 11
3981             Do
3982                 Let count = count + 1
3983                 Let dc4 = Int(Rnd * 9 + 1)
3984                 Let dc5 = Int(Rnd * 9 + 1)
3985                 Let b2 = shobo(dc5, dc4)
3986                 If count > 8000 Then Exit Do
3987             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
3988     End Select
3989
3990     Let w2 = shobo(dc2, dc1): Let b2 = shobo(dc5, dc4)
3991     Let fw2x = dc1: Let fw2y = dc2: Let fb2x = dc4: Let fb2y = dc5
3992     Let fw2 = dc3: Let fb2 = dc6
3993
3994     Let x = 20: Let y = 160: Let cf = 15
3995     If dc3 = 1 Then Call king
3996     If dc3 = 2 Then Call queen
3997     If dc3 = 3 Then Call general
3998     If dc3 = 4 Then Call bishop
3999     If dc3 = 5 Then Call knight
4000     If dc3 = 6 Then Call rook
4001     If dc3 = 7 Then Call lance
4002     If dc3 = 8 Then Call pawn
4003     If dc3 = 9 Then Call horse
4004     If dc3 = 10 Then Call dragon
4005     If dc3 = 11 Then Call tokin
4006     Let x = 580: Let y = 160: Let cf = 0
4007     If dc6 = 1 Then Call king
4008     If dc6 = 2 Then Call queen
4009     If dc6 = 3 Then Call general
4010     If dc6 = 4 Then Call bishop
4011     If dc6 = 5 Then Call knight
4012     If dc6 = 6 Then Call rook
4013     If dc6 = 7 Then Call lance
4014     If dc6 = 8 Then Call pawn
4015     If dc6 = 9 Then Call horse
4016     If dc6 = 10 Then Call dragon
4017     If dc6 = 11 Then Call tokin
4018     Let x = 20: Let y = 220
4019     If dc1 = 1 Then Call letterA
4020     If dc1 = 2 Then Call letterB
4021     If dc1 = 3 Then Call letterC
4022     If dc1 = 4 Then Call letterD
4023     If dc1 = 5 Then Call letterE
4024     If dc1 = 6 Then Call letterF
4025     If dc1 = 7 Then Call letterG
4026     If dc1 = 8 Then Call letterH
4027     If dc1 = 9 Then Call letterI
4028     Let x = 20: Let y = 280
4029     If dc2 = 1 Then Call letter1
4030     If dc2 = 2 Then Call letter2
4031     If dc2 = 3 Then Call letter3
4032     If dc2 = 4 Then Call letter4
4033     If dc2 = 5 Then Call letter5
4034     If dc2 = 6 Then Call letter6
4035     If dc2 = 7 Then Call letter7
4036     If dc2 = 8 Then Call letter8
4037     If dc2 = 9 Then Call letter9
4038     Let x = 580: Let y = 220
4039     If dc4 = 1 Then Call letterA
4040     If dc4 = 2 Then Call letterB
4041     If dc4 = 3 Then Call letterC
4042     If dc4 = 4 Then Call letterD
4043     If dc4 = 5 Then Call letterE
4044     If dc4 = 6 Then Call letterF
4045     If dc4 = 7 Then Call letterG
4046     If dc4 = 8 Then Call letterH
4047     If dc4 = 9 Then Call letterI
4048     Let x = 580: Let y = 280
4049     If dc5 = 1 Then Call letter1
4050     If dc5 = 2 Then Call letter2
4051     If dc5 = 3 Then Call letter3
4052     If dc5 = 4 Then Call letter4
4053     If dc5 = 5 Then Call letter5
4054     If dc5 = 6 Then Call letter6
4055     If dc5 = 7 Then Call letter7
4056     If dc5 = 8 Then Call letter8
4057     If dc5 = 9 Then Call letter9
4058     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 60
4059     Let cf = 15
4060     If dc3 = 1 Then Call king
4061     If dc3 = 2 Then Call queen
4062     If dc3 = 3 Then Call general
4063     If dc3 = 4 Then Call bishop
4064     If dc3 = 5 Then Call knight
4065     If dc3 = 6 Then Call rook
4066     If dc3 = 7 Then Call lance
4067     If dc3 = 8 Then Call pawn
4068     If dc3 = 9 Then Call horse
4069     If dc3 = 10 Then Call dragon
4070     If dc3 = 11 Then Call tokin
4071     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 60
4072     Let cf = 0
4073     If dc6 = 1 Then Call king
4074     If dc6 = 2 Then Call queen
4075     If dc6 = 3 Then Call general
4076     If dc6 = 4 Then Call bishop
4077     If dc6 = 5 Then Call knight
4078     If dc6 = 6 Then Call rook
4079     If dc6 = 7 Then Call lance
4080     If dc6 = 8 Then Call pawn
4081     If dc6 = 9 Then Call horse
4082     If dc6 = 10 Then Call dragon
4083     If dc6 = 11 Then Call tokin
4084
4085     Do
4086         Select Case InKey$
4087             Case Is = Chr$(32)
4088                 Exit Do
4089             Case Is = Chr$(13)
4090                 Call shogifen
4091             Case Is = Chr$(27)
4092                 End
4093         End Select
4094     Loop
4095
4096     Call dices
4097
4098     Rem 3rd roll
4099     Let count = 0: Let index = 0
4100     Let dc1 = Int(Rnd * 9 + 1)
4101     Let dc2 = Int(Rnd * 9 + 1)
4102     Let dc3 = Int(Rnd * 10 + 2)
4103     Let dc4 = Int(Rnd * 9 + 1)
4104     Let dc5 = Int(Rnd * 9 + 1)
4105     Let dc6 = Int(Rnd * 10 + 2)
4106     Let w3 = shobo(dc2, dc1): Let b3 = shobo(dc5, dc4)
4107     If dc3 = 4 Then Let indexw4 = indexw4 + 1
4108     If dc3 = 6 Then Let indexw6 = indexw6 + 1
4109     If dc3 = 9 Then Let indexw9 = indexw9 + 1
4110     If dc3 = 10 Then Let indexw10 = indexw10 + 1
4111     If indexw4 > 1 Then
4112         Let dc3 = 8
4113         Let indexw4 = indexw4 - 1
4114     End If
4115     If indexw6 > 1 Then
4116         Let dc3 = 8
4117         Let indexw6 = indexw4 - 1
4118     End If
4119     If indexw9 > 1 Then
4120         Let dc3 = 8
4121         Let indexw9 = indexw4 - 1
4122     End If
4123     If indexw10 > 1 Then
4124         Let dc3 = 8
4125         Let indexw10 = indexw4 - 1
4126     End If
4127     If indexb4 > 1 Then
4128         Let dc6 = 8
4129         Let indexb4 = indexb4 - 1
4130     End If
4131     If indexb6 > 1 Then
4132         Let dc6 = 8
4133         Let indexb6 = indexb4 - 1
4134     End If
4135     If indexb9 > 1 Then
4136         Let dc6 = 8
4137         Let indexb9 = indexb4 - 1
4138     End If
4139     If indexb10 > 1 Then
4140         Let dc6 = 8
4141         Let indexb10 = indexb4 - 1
4142     End If
4143
4144     Select Case dc3
4145         Case Is = 1
4146             Rem
4147         Case Is = 2
4148             Do
4149                 Let count = count + 1
4150                 Let dc1 = Int(Rnd * 9 + 1)
4151                 Let dc2 = Int(Rnd * 9 + 1)
4152                 Let w3 = shobo(dc2, dc1)
4153                 If count > 8000 Then Exit Do
4154             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4155         Case Is = 3
4156             Let indexw3 = indexw3 + 1
4157             Do
4158                 Let count = count + 1
4159                 Let dc1 = Int(Rnd * 9 + 1)
4160                 Let dc2 = Int(Rnd * 9 + 1)
4161                 Let w3 = shobo(dc2, dc1)
4162                 If count > 8000 Then Exit Do
4163             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4164         Case Is = 4
4165             Let indexw4 = indexw4 + 1
4166             Do
4167                 Let count = count + 1
4168                 Let dc1 = Int(Rnd * 9 + 1)
4169                 Let dc2 = Int(Rnd * 9 + 1)
4170                 Let w3 = shobo(dc2, dc1)
4171                 If count > 8000 Then Exit Do
4172             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4173         Case Is = 5
4174             Let indexw5 = indexw5 + 1
4175             Do
4176                 Let count = count + 1
4177                 Let dc1 = Int(Rnd * 9 + 1)
4178                 Let dc2 = Int(Rnd * 9 + 1)
4179                 Let fw2x = dc1: Let fw2y = dc2
4180                 Let w3 = shobo(dc2, dc1)
4181                 If count > 8000 Then Exit Do
4182             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4183         Case Is = 6
4184             Let indexw6 = indexw6 + 1
4185             Do
4186                 Let count = count + 1
4187                 Let dc1 = Int(Rnd * 9 + 1)
4188                 Let dc2 = Int(Rnd * 9 + 1)
4189                 Let fw2x = dc1: Let fw2y = dc2
4190                 Let w3 = shobo(dc2, dc1)
4191                 If count > 8000 Then Exit Do
4192             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4193         Case Is = 7
4194             Let indexw7 = indexw7 + 1
4195             Let index = Int(Rnd * 2 + 1)
4196             If index = 1 Then Let dc1 = 1 Else Let dc1 = 9
4197             If indexw71 = 1 Then dc1 = 9
4198             If indexw72 = 1 Then dc1 = 1
4199             Do
4200                 Let count = count + 1
4201                 Let dc2 = Int(Rnd * 9 + 1)
4202                 Let w3 = shobo(dc2, dc1)
4203                 If count > 8000 Then Exit Do
4204             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4205         Case Is = 8
4206             Do
4207                 Let count = count + 1
4208                 Let dc1 = Int(Rnd * 9 + 1)
4209                 Let dc2 = Int(Rnd * 9 + 1)
4210                 Let w3 = shobo(dc2, dc1)
4211                 If count > 8000 Then Exit Do
4212             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc2 < 3 Or dc2 > 7
4213         Case Is = 9
4214             Let indexw9 = indexw9 + 1
4215             Do
4216                 Let count = count + 1
4217                 Let dc1 = Int(Rnd * 9 + 1)
4218                 Let dc2 = Int(Rnd * 9 + 1)
4219                 Let w3 = shobo(dc2, dc1)
4220                 If count > 8000 Then Exit Do
4221             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4222         Case Is = 10
4223             Let indexw10 = indexw10 + 1
4224             Do
4225                 Let count = count + 1
4226                 Let dc1 = Int(Rnd * 9 + 1)
4227                 Let dc2 = Int(Rnd * 9 + 1)
4228                 Let w3 = shobo(dc2, dc1)
4229                 If count > 8000 Then Exit Do
4230             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4231         Case Is = 11
4232             Do
4233                 Let count = count + 1
4234                 Let dc1 = Int(Rnd * 9 + 1)
4235                 Let dc2 = Int(Rnd * 9 + 1)
4236                 Let w3 = shobo(dc2, dc1)
4237                 If count > 8000 Then Exit Do
4238             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4239     End Select
4240     Select Case dc6
4241         Case Is = 1
4242             Rem
4243         Case Is = 2
4244             Do
4245                 Let count = count + 1
4246                 Let dc4 = Int(Rnd * 9 + 1)
4247                 Let dc5 = Int(Rnd * 9 + 1)
4248                 Let b3 = shobo(dc5, dc4)
4249                 If count > 8000 Then Exit Do
4250             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4251         Case Is = 3
4252             Let indexb3 = indexb3 + 1
4253             Do
4254                 Let count = count + 1
4255                 Let dc4 = Int(Rnd * 9 + 1)
4256                 Let dc5 = Int(Rnd * 9 + 1)
4257                 Let b3 = shobo(dc5, dc4)
4258                 If count > 8000 Then Exit Do
4259             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4260         Case Is = 4
4261             Let indexb4 = indexb4 + 1
4262             Do
4263                 Let count = count + 1
4264                 Let dc4 = Int(Rnd * 9 + 1)
4265                 Let dc5 = Int(Rnd * 9 + 1)
4266                 Let b3 = shobo(dc5, dc4)
4267                 If count > 8000 Then Exit Do
4268             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4269         Case Is = 5
4270             Let indexb5 = indexb5 + 1
4271             Do
4272                 Let count = count + 1
4273                 Let dc4 = Int(Rnd * 9 + 1)
4274                 Let dc5 = Int(Rnd * 9 + 1)
4275                 Let fb2x = dc4: Let fb2y = dc5
4276                 Let b3 = shobo(dc5, dc4)
4277                 If count > 8000 Then Exit Do
4278             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4279         Case Is = 6
4280             Let indexb6 = indexb6 + 1
4281             Do
4282                 Let count = count + 1
4283                 Let dc4 = Int(Rnd * 9 + 1)
4284                 Let dc5 = Int(Rnd * 9 + 1)
4285                 Let fb2x = dc4: Let fb2y = dc5
4286                 Let b3 = shobo(dc5, dc4)
4287                 If count > 8000 Then Exit Do
4288             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4289         Case Is = 7
4290             Let indexb7 = indexb7 + 1
4291             Let index = Int(Rnd * 2 + 1)
4292             If index = 1 Then Let dc4 = 1 Else Let dc4 = 9
4293             If indexb71 = 1 Then dc4 = 9
4294             If indexb72 = 1 Then dc4 = 1
4295             Do
4296                 Let count = count + 1
4297                 Let dc5 = Int(Rnd * 9 + 1)
4298                 Let b3 = shobo(dc5, dc4)
4299                 If count > 8000 Then Exit Do
4300             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4301         Case Is = 8
4302             Do
4303                 Let count = count + 1
4304                 Let dc4 = Int(Rnd * 9 + 1)
4305                 Let dc5 = Int(Rnd * 9 + 1)
4306                 Let b3 = shobo(dc5, dc4)
4307                 If count > 8000 Then Exit Do
4308             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2 Or dc5 < 3 Or dc5 > 7
4309         Case Is = 9
4310             Let indexb9 = indexb9 + 1
4311             Do
4312                 Let count = count + 1
4313                 Let dc4 = Int(Rnd * 9 + 1)
4314                 Let dc5 = Int(Rnd * 9 + 1)
4315                 Let b3 = shobo(dc5, dc4)
4316                 If count > 8000 Then Exit Do
4317             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4318         Case Is = 10
4319             Let indexb10 = indexb10 + 1
4320             Do
4321                 Let count = count + 1
4322                 Let dc4 = Int(Rnd * 9 + 1)
4323                 Let dc5 = Int(Rnd * 9 + 1)
4324                 Let b3 = shobo(dc5, dc4)
4325                 If count > 8000 Then Exit Do
4326             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4327         Case Is = 11
4328             Do
4329                 Let count = count + 1
4330                 Let dc4 = Int(Rnd * 9 + 1)
4331                 Let dc5 = Int(Rnd * 9 + 1)
4332                 Let b3 = shobo(dc5, dc4)
4333                 If count > 8000 Then Exit Do
4334             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
4335     End Select
4336
4337     Let w3 = shobo(dc2, dc1): Let b3 = shobo(dc5, dc4)
4338     Let fw3x = dc1: Let fw3y = dc2: Let fb3x = dc4: Let fb3y = dc5
4339     Let fw3 = dc3: Let fb3 = dc6
4340
4341     Let x = 20: Let y = 160: Let cf = 15
4342     If dc3 = 1 Then Call king
4343     If dc3 = 2 Then Call queen
4344     If dc3 = 3 Then Call general
4345     If dc3 = 4 Then Call bishop
4346     If dc3 = 5 Then Call knight
4347     If dc3 = 6 Then Call rook
4348     If dc3 = 7 Then Call lance
4349     If dc3 = 8 Then Call pawn
4350     If dc3 = 9 Then Call horse
4351     If dc3 = 10 Then Call dragon
4352     If dc3 = 11 Then Call tokin
4353     Let x = 580: Let y = 160: Let cf = 0
4354     If dc6 = 1 Then Call king
4355     If dc6 = 2 Then Call queen
4356     If dc6 = 3 Then Call general
4357     If dc6 = 4 Then Call bishop
4358     If dc6 = 5 Then Call knight
4359     If dc6 = 6 Then Call rook
4360     If dc6 = 7 Then Call lance
4361     If dc6 = 8 Then Call pawn
4362     If dc6 = 9 Then Call horse
4363     If dc6 = 10 Then Call dragon
4364     If dc6 = 11 Then Call tokin
4365     Let x = 20: Let y = 220
4366     If dc1 = 1 Then Call letterA
4367     If dc1 = 2 Then Call letterB
4368     If dc1 = 3 Then Call letterC
4369     If dc1 = 4 Then Call letterD
4370     If dc1 = 5 Then Call letterE
4371     If dc1 = 6 Then Call letterF
4372     If dc1 = 7 Then Call letterG
4373     If dc1 = 8 Then Call letterH
4374     If dc1 = 9 Then Call letterI
4375     Let x = 20: Let y = 280
4376     If dc2 = 1 Then Call letter1
4377     If dc2 = 2 Then Call letter2
4378     If dc2 = 3 Then Call letter3
4379     If dc2 = 4 Then Call letter4
4380     If dc2 = 5 Then Call letter5
4381     If dc2 = 6 Then Call letter6
4382     If dc2 = 7 Then Call letter7
4383     If dc2 = 8 Then Call letter8
4384     If dc2 = 9 Then Call letter9
4385     Let x = 580: Let y = 220
4386     If dc4 = 1 Then Call letterA
4387     If dc4 = 2 Then Call letterB
4388     If dc4 = 3 Then Call letterC
4389     If dc4 = 4 Then Call letterD
4390     If dc4 = 5 Then Call letterE
4391     If dc4 = 6 Then Call letterF
4392     If dc4 = 7 Then Call letterG
4393     If dc4 = 8 Then Call letterH
4394     If dc4 = 9 Then Call letterI
4395     Let x = 580: Let y = 280
4396     If dc5 = 1 Then Call letter1
4397     If dc5 = 2 Then Call letter2
4398     If dc5 = 3 Then Call letter3
4399     If dc5 = 4 Then Call letter4
4400     If dc5 = 5 Then Call letter5
4401     If dc5 = 6 Then Call letter6
4402     If dc5 = 7 Then Call letter7
4403     If dc5 = 8 Then Call letter8
4404     If dc5 = 9 Then Call letter9
4405     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 60
4406     Let cf = 15
4407     If dc3 = 1 Then Call king
4408     If dc3 = 2 Then Call queen
4409     If dc3 = 3 Then Call general
4410     If dc3 = 4 Then Call bishop
4411     If dc3 = 5 Then Call knight
4412     If dc3 = 6 Then Call rook
4413     If dc3 = 7 Then Call lance
4414     If dc3 = 8 Then Call pawn
4415     If dc3 = 9 Then Call horse
4416     If dc3 = 10 Then Call dragon
4417     If dc3 = 11 Then Call tokin
4418     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 60
4419     Let cf = 0
4420     If dc6 = 1 Then Call king
4421     If dc6 = 2 Then Call queen
4422     If dc6 = 3 Then Call general
4423     If dc6 = 4 Then Call bishop
4424     If dc6 = 5 Then Call knight
4425     If dc6 = 6 Then Call rook
4426     If dc6 = 7 Then Call lance
4427     If dc6 = 8 Then Call pawn
4428     If dc6 = 9 Then Call horse
4429     If dc6 = 10 Then Call dragon
4430     If dc6 = 11 Then Call tokin
4431
4432     Do
4433         Select Case InKey$
4434             Case Is = Chr$(32)
4435                 Exit Do
4436             Case Is = Chr$(13)
4437                 Call shogifen
4438             Case Is = Chr$(27)
4439                 End
4440         End Select
4441     Loop
4442
4443     Call dices
4444
4445     Rem 4th roll
4446     Let count = 0: Let index = 0
4447     Let dc1 = Int(Rnd * 9 + 1)
4448     Let dc2 = Int(Rnd * 9 + 1)
4449     Let dc3 = Int(Rnd * 10 + 2)
4450     Let dc4 = Int(Rnd * 9 + 1)
4451     Let dc5 = Int(Rnd * 9 + 1)
4452     Let dc6 = Int(Rnd * 10 + 2)
4453     Let w4 = shobo(dc2, dc1): Let b4 = shobo(dc5, dc4)
4454     If dc3 = 4 Then Let indexw4 = indexw4 + 1
4455     If dc3 = 6 Then Let indexw6 = indexw6 + 1
4456     If dc3 = 9 Then Let indexw9 = indexw9 + 1
4457     If dc3 = 10 Then Let indexw10 = indexw10 + 1
4458     If indexw4 > 1 Then
4459         Let dc3 = 8
4460         Let indexw4 = indexw4 - 1
4461     End If
4462     If indexw6 > 1 Then
4463         Let dc3 = 8
4464         Let indexw6 = indexw4 - 1
4465     End If
4466     If indexw9 > 1 Then
4467         Let dc3 = 8
4468         Let indexw9 = indexw4 - 1
4469     End If
4470     If indexw10 > 1 Then
4471         Let dc3 = 8
4472         Let indexw10 = indexw4 - 1
4473     End If
4474     If indexb4 > 1 Then
4475         Let dc6 = 8
4476         Let indexb4 = indexb4 - 1
4477     End If
4478     If indexb6 > 1 Then
4479         Let dc6 = 8
4480         Let indexb6 = indexb4 - 1
4481     End If
4482     If indexb9 > 1 Then
4483         Let dc6 = 8
4484         Let indexb9 = indexb4 - 1
4485     End If
4486     If indexb10 > 1 Then
4487         Let dc6 = 8
4488         Let indexb10 = indexb4 - 1
4489     End If
4490     If indexw3 > 2 Or indexw5 > 2 Or indexw7 > 2 Then Let dc3 = 8
4491     If indexb3 > 2 Or indexb5 > 2 Or indexb7 > 2 Then Let dc6 = 8
4492
4493     Select Case dc3
4494         Case Is = 1
4495             Rem
4496         Case Is = 2
4497             Do
4498                 Let count = count + 1
4499                 Let dc1 = Int(Rnd * 9 + 1)
4500                 Let dc2 = Int(Rnd * 9 + 1)
4501                 Let w4 = shobo(dc2, dc1)
4502                 If count > 8000 Then Exit Do
4503             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4504         Case Is = 3
4505             Do
4506                 Let count = count + 1
4507                 Let dc1 = Int(Rnd * 9 + 1)
4508                 Let dc2 = Int(Rnd * 9 + 1)
4509                 Let w4 = shobo(dc2, dc1)
4510                 If count > 8000 Then Exit Do
4511             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4512         Case Is = 4
4513             Do
4514                 Let count = count + 1
4515                 Let dc1 = Int(Rnd * 9 + 1)
4516                 Let dc2 = Int(Rnd * 9 + 1)
4517                 Let w4 = shobo(dc2, dc1)
4518                 If count > 8000 Then Exit Do
4519             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4520         Case Is = 5
4521             Do
4522                 Let count = count + 1
4523                 Let dc1 = Int(Rnd * 9 + 1)
4524                 Let dc2 = Int(Rnd * 9 + 1)
4525                 Let fw2x = dc1: Let fw2y = dc2
4526                 Let w4 = shobo(dc2, dc1)
4527                 If count > 8000 Then Exit Do
4528             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4529         Case Is = 6
4530             Do
4531                 Let count = count + 1
4532                 Let dc1 = Int(Rnd * 9 + 1)
4533                 Let dc2 = Int(Rnd * 9 + 1)
4534                 Let fw2x = dc1: Let fw2y = dc2
4535                 Let w4 = shobo(dc2, dc1)
4536                 If count > 8000 Then Exit Do
4537             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4538         Case Is = 7
4539             Let index = Int(Rnd * 2 + 1)
4540             If index = 1 Then Let dc1 = 1 Else Let dc1 = 9
4541             If indexw71 = 1 Then dc1 = 9
4542             If indexw72 = 1 Then dc1 = 1
4543             Do
4544                 Let count = count + 1
4545                 Let dc2 = Int(Rnd * 9 + 1)
4546                 Let w4 = shobo(dc2, dc1)
4547                 If count > 8000 Then Exit Do
4548             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4549         Case Is = 8
4550             Do
4551                 Let count = count + 1
4552                 Let dc1 = Int(Rnd * 9 + 1)
4553                 Let dc2 = Int(Rnd * 9 + 1)
4554                 Let w4 = shobo(dc2, dc1)
4555                 If count > 8000 Then Exit Do
4556             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc2 < 3 Or dc2 > 7
4557         Case Is = 9
4558             Do
4559                 Let count = count + 1
4560                 Let dc1 = Int(Rnd * 9 + 1)
4561                 Let dc2 = Int(Rnd * 9 + 1)
4562                 Let w4 = shobo(dc2, dc1)
4563                 If count > 8000 Then Exit Do
4564             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4565         Case Is = 10
4566             Do
4567                 Let count = count + 1
4568                 Let dc1 = Int(Rnd * 9 + 1)
4569                 Let dc2 = Int(Rnd * 9 + 1)
4570                 Let w4 = shobo(dc2, dc1)
4571                 If count > 8000 Then Exit Do
4572             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4573         Case Is = 11
4574             Do
4575                 Let count = count + 1
4576                 Let dc1 = Int(Rnd * 9 + 1)
4577                 Let dc2 = Int(Rnd * 9 + 1)
4578                 Let w4 = shobo(dc2, dc1)
4579                 If count > 8000 Then Exit Do
4580             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4581     End Select
4582     Select Case dc6
4583         Case Is = 1
4584             Rem
4585         Case Is = 2
4586             Do
4587                 Let count = count + 1
4588                 Let dc4 = Int(Rnd * 9 + 1)
4589                 Let dc5 = Int(Rnd * 9 + 1)
4590                 Let b4 = shobo(dc5, dc4)
4591                 If count > 8000 Then Exit Do
4592             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4593         Case Is = 3
4594             Do
4595                 Let count = count + 1
4596                 Let dc4 = Int(Rnd * 9 + 1)
4597                 Let dc5 = Int(Rnd * 9 + 1)
4598                 Let b4 = shobo(dc5, dc4)
4599                 If count > 8000 Then Exit Do
4600             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4601         Case Is = 4
4602             Do
4603                 Let count = count + 1
4604                 Let dc4 = Int(Rnd * 9 + 1)
4605                 Let dc5 = Int(Rnd * 9 + 1)
4606                 Let b4 = shobo(dc5, dc4)
4607                 If count > 8000 Then Exit Do
4608             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4609         Case Is = 5
4610             Do
4611                 Let count = count + 1
4612                 Let dc4 = Int(Rnd * 9 + 1)
4613                 Let dc5 = Int(Rnd * 9 + 1)
4614                 Let fb2x = dc4: Let fb2y = dc5
4615                 Let b4 = shobo(dc5, dc4)
4616                 If count > 8000 Then Exit Do
4617             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4618         Case Is = 6
4619             Do
4620                 Let count = count + 1
4621                 Let dc4 = Int(Rnd * 9 + 1)
4622                 Let dc5 = Int(Rnd * 9 + 1)
4623                 Let fb2x = dc4: Let fb2y = dc5
4624                 Let b4 = shobo(dc5, dc4)
4625                 If count > 8000 Then Exit Do
4626             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4627         Case Is = 7
4628             Let index = Int(Rnd * 2 + 1)
4629             If index = 1 Then Let dc4 = 1 Else Let dc4 = 9
4630             If indexb71 = 1 Then dc4 = 9
4631             If indexb72 = 1 Then dc4 = 1
4632             Do
4633                 Let count = count + 1
4634                 Let dc5 = Int(Rnd * 9 + 1)
4635                 Let b4 = shobo(dc5, dc4)
4636                 If count > 8000 Then Exit Do
4637             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4638         Case Is = 8
4639             Do
4640                 Let count = count + 1
4641                 Let dc4 = Int(Rnd * 9 + 1)
4642                 Let dc5 = Int(Rnd * 9 + 1)
4643                 Let b4 = shobo(dc5, dc4)
4644                 If count > 8000 Then Exit Do
4645             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3 Or dc5 < 3 Or dc5 > 7
4646         Case Is = 9
4647             Do
4648                 Let count = count + 1
4649                 Let dc4 = Int(Rnd * 9 + 1)
4650                 Let dc5 = Int(Rnd * 9 + 1)
4651                 Let b4 = shobo(dc5, dc4)
4652                 If count > 8000 Then Exit Do
4653             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4654         Case Is = 10
4655             Do
4656                 Let count = count + 1
4657                 Let dc4 = Int(Rnd * 9 + 1)
4658                 Let dc5 = Int(Rnd * 9 + 1)
4659                 Let b4 = shobo(dc5, dc4)
4660                 If count > 8000 Then Exit Do
4661             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4662         Case Is = 11
4663             Do
4664                 Let count = count + 1
4665                 Let dc4 = Int(Rnd * 9 + 1)
4666                 Let dc5 = Int(Rnd * 9 + 1)
4667                 Let b4 = shobo(dc5, dc4)
4668                 If count > 8000 Then Exit Do
4669             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
4670     End Select
4671
4672     Let w4 = shobo(dc2, dc1): Let b4 = shobo(dc5, dc4)
4673     Let fw4x = dc1: Let fw4y = dc2: Let fb4x = dc4: Let fb4y = dc5
4674     Let fw4 = dc3: Let fb4 = dc6
4675
4676     Let x = 20: Let y = 160: Let cf = 15
4677     If dc3 = 1 Then Call king
4678     If dc3 = 2 Then Call queen
4679     If dc3 = 3 Then Call general
4680     If dc3 = 4 Then Call bishop
4681     If dc3 = 5 Then Call knight
4682     If dc3 = 6 Then Call rook
4683     If dc3 = 7 Then Call lance
4684     If dc3 = 8 Then Call pawn
4685     If dc3 = 9 Then Call horse
4686     If dc3 = 10 Then Call dragon
4687     If dc3 = 11 Then Call tokin
4688     Let x = 580: Let y = 160: Let cf = 0
4689     If dc6 = 1 Then Call king
4690     If dc6 = 2 Then Call queen
4691     If dc6 = 3 Then Call general
4692     If dc6 = 4 Then Call bishop
4693     If dc6 = 5 Then Call knight
4694     If dc6 = 6 Then Call rook
4695     If dc6 = 7 Then Call lance
4696     If dc6 = 8 Then Call pawn
4697     If dc6 = 9 Then Call horse
4698     If dc6 = 10 Then Call dragon
4699     If dc6 = 11 Then Call tokin
4700     Let x = 20: Let y = 220
4701     If dc1 = 1 Then Call letterA
4702     If dc1 = 2 Then Call letterB
4703     If dc1 = 3 Then Call letterC
4704     If dc1 = 4 Then Call letterD
4705     If dc1 = 5 Then Call letterE
4706     If dc1 = 6 Then Call letterF
4707     If dc1 = 7 Then Call letterG
4708     If dc1 = 8 Then Call letterH
4709     If dc1 = 9 Then Call letterI
4710     Let x = 20: Let y = 280
4711     If dc2 = 1 Then Call letter1
4712     If dc2 = 2 Then Call letter2
4713     If dc2 = 3 Then Call letter3
4714     If dc2 = 4 Then Call letter4
4715     If dc2 = 5 Then Call letter5
4716     If dc2 = 6 Then Call letter6
4717     If dc2 = 7 Then Call letter7
4718     If dc2 = 8 Then Call letter8
4719     If dc2 = 9 Then Call letter9
4720     Let x = 580: Let y = 220
4721     If dc4 = 1 Then Call letterA
4722     If dc4 = 2 Then Call letterB
4723     If dc4 = 3 Then Call letterC
4724     If dc4 = 4 Then Call letterD
4725     If dc4 = 5 Then Call letterE
4726     If dc4 = 6 Then Call letterF
4727     If dc4 = 7 Then Call letterG
4728     If dc4 = 8 Then Call letterH
4729     If dc4 = 9 Then Call letterI
4730     Let x = 580: Let y = 280
4731     If dc5 = 1 Then Call letter1
4732     If dc5 = 2 Then Call letter2
4733     If dc5 = 3 Then Call letter3
4734     If dc5 = 4 Then Call letter4
4735     If dc5 = 5 Then Call letter5
4736     If dc5 = 6 Then Call letter6
4737     If dc5 = 7 Then Call letter7
4738     If dc5 = 8 Then Call letter8
4739     If dc5 = 9 Then Call letter9
4740     Let x = (dc1 * 40) + 100: Let y = Abs((dc2 * 40) - 480) - 60
4741     Let cf = 15
4742     If dc3 = 1 Then Call king
4743     If dc3 = 2 Then Call queen
4744     If dc3 = 3 Then Call general
4745     If dc3 = 4 Then Call bishop
4746     If dc3 = 5 Then Call knight
4747     If dc3 = 6 Then Call rook
4748     If dc3 = 7 Then Call lance
4749     If dc3 = 8 Then Call pawn
4750     If dc3 = 9 Then Call horse
4751     If dc3 = 10 Then Call dragon
4752     If dc3 = 11 Then Call tokin
4753     Let x = (dc4 * 40) + 100: Let y = Abs((dc5 * 40) - 480) - 60
4754     Let cf = 0
4755     If dc6 = 1 Then Call king
4756     If dc6 = 2 Then Call queen
4757     If dc6 = 3 Then Call general
4758     If dc6 = 4 Then Call bishop
4759     If dc6 = 5 Then Call knight
4760     If dc6 = 6 Then Call rook
4761     If dc6 = 7 Then Call lance
4762     If dc6 = 8 Then Call pawn
4763     If dc6 = 9 Then Call horse
4764     If dc6 = 10 Then Call dragon
4765     If dc6 = 11 Then Call tokin
4766
4767     Do
4768         Select Case InKey$
4769             Case Is = Chr$(32)
4770                 Rem
4771             Case Is = Chr$(13)
4772                 Call shogifen
4773             Case Is = Chr$(27)
4774                 End
4775         End Select
4776     Loop
4777
4778 End Sub
4779
4780 Sub draughts
4781
4782     Rem 1st roll
4783     Let count = 0: Let index = 0
4784     Let dc1 = Int(Rnd * 10 + 1)
4785     Let dc2 = Int(Rnd * 10 + 1)
4786     Let dc3 = Int(Rnd * 2 + 1)
4787     Let dc4 = Int(Rnd * 10 + 1)
4788     Let dc5 = Int(Rnd * 10 + 1)
4789     Let dc6 = Int(Rnd * 2 + 1)
4790     Let w1 = drabo(dc2, dc1): Let b1 = drabo(dc5, dc4)
4791
4792     Do
4793         Do
4794             Let count = count + 1
4795             Let dc1 = Int(Rnd * 8 + 1)
4796             Let dc2 = Int(Rnd * 8 + 1)
4797             Let dc4 = Int(Rnd * 8 + 1)
4798             Let dc5 = Int(Rnd * 8 + 1)
4799             Let w1 = drabo(dc2, dc1): Let b1 = drabo(dc5, dc4)
4800             If count > 8000 Then Exit Do
4801         Loop Until w1 Mod 2 <> 0 And b1 Mod 2 <> 0
4802         Let count = count + 1
4803         If count > 8000 Then Exit Do
4804     Loop While w1 = b1
4805
4806     Let w1 = drabo(dc2, dc1): Let b1 = drabo(dc5, dc4)
4807     Let fw1x = dc1: Let fw1y = dc2: Let fb1x = dc4: Let fb1y = dc5
4808     Let fw1 = dc3: Let fb1 = dc6
4809     Let x = 20: Let y = 160: Let cf = 15
4810     If dc3 = 1 Then Call dame
4811     If dc3 = 2 Then Call checker
4812     Let x = 580: Let y = 160: Let cf = 0
4813     If dc6 = 1 Then Call dame
4814     If dc6 = 2 Then Call checker
4815     Let x = 20: Let y = 220
4816     If dc1 = 1 Then Call letterA
4817     If dc1 = 2 Then Call letterB
4818     If dc1 = 3 Then Call letterC
4819     If dc1 = 4 Then Call letterD
4820     If dc1 = 5 Then Call letterE
4821     If dc1 = 6 Then Call letterF
4822     If dc1 = 7 Then Call letterG
4823     If dc1 = 8 Then Call letterH
4824     If dc1 = 9 Then Call letterI
4825     If dc1 = 10 Then Call letterJ
4826     Let x = 20: Let y = 280
4827     If dc2 = 1 Then Call letter1
4828     If dc2 = 2 Then Call letter2
4829     If dc2 = 3 Then Call letter3
4830     If dc2 = 4 Then Call letter4
4831     If dc2 = 5 Then Call letter5
4832     If dc2 = 6 Then Call letter6
4833     If dc2 = 7 Then Call letter7
4834     If dc2 = 8 Then Call letter8
4835     If dc2 = 9 Then Call letter9
4836     If dc2 = 10 Then Call letter0
4837     Let x = 580: Let y = 220
4838     If dc4 = 1 Then Call letterA
4839     If dc4 = 2 Then Call letterB
4840     If dc4 = 3 Then Call letterC
4841     If dc4 = 4 Then Call letterD
4842     If dc4 = 5 Then Call letterE
4843     If dc4 = 6 Then Call letterF
4844     If dc4 = 7 Then Call letterG
4845     If dc4 = 8 Then Call letterH
4846     If dc4 = 9 Then Call letterI
4847     If dc4 = 10 Then Call letterJ
4848     Let x = 580: Let y = 280
4849     If dc5 = 1 Then Call letter1
4850     If dc5 = 2 Then Call letter2
4851     If dc5 = 3 Then Call letter3
4852     If dc5 = 4 Then Call letter4
4853     If dc5 = 5 Then Call letter5
4854     If dc5 = 6 Then Call letter6
4855     If dc5 = 7 Then Call letter7
4856     If dc5 = 8 Then Call letter8
4857     If dc5 = 9 Then Call letter9
4858     If dc5 = 10 Then Call letter0
4859     Let x = (dc1 * 40) + 80: Let y = Abs((dc2 * 40) - 480) - 40
4860     Let cf = 15
4861     If dc3 = 1 Then Call dame
4862     If dc3 = 2 Then Call checker
4863     Let x = (dc4 * 40) + 80: Let y = Abs((dc5 * 40) - 480) - 40
4864     Let cf = 0
4865     If dc6 = 1 Then Call dame
4866     If dc6 = 2 Then Call checker
4867
4868     Do
4869         Select Case InKey$
4870             Case Is = Chr$(32)
4871                 Exit Do
4872             Case Is = Chr$(13)
4873                 Call draughtsfen
4874             Case Is = Chr$(27)
4875                 End
4876         End Select
4877     Loop
4878
4879     Call dices
4880
4881     Rem 2nd roll
4882     Let count = 0: Let index = 0
4883     Let dc1 = Int(Rnd * 10 + 1)
4884     Let dc2 = Int(Rnd * 10 + 1)
4885     Let dc3 = Int(Rnd * 2 + 1)
4886     Let dc4 = Int(Rnd * 10 + 1)
4887     Let dc5 = Int(Rnd * 10 + 1)
4888     Let dc6 = Int(Rnd * 2 + 1)
4889     Let w2 = drabo(dc2, dc1): Let b2 = drabo(dc5, dc4)
4890
4891     Select Case dc3
4892         Case Is = 1
4893             Do
4894                 Do
4895                     Let count = count + 1
4896                     Let dc1 = Int(Rnd * 10 + 1)
4897                     Let dc2 = Int(Rnd * 10 + 1)
4898                     Let w2 = drabo(dc2, dc1)
4899                     If count > 8000 Then Exit Do
4900                 Loop Until w2 Mod 2 <> 0
4901                 Let count = count + 1
4902                 If count > 8000 Then Exit Do
4903             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
4904         Case Is = 2
4905             Do
4906                 Do
4907                     Let count = count + 1
4908                     Let dc1 = Int(Rnd * 10 + 1)
4909                     Let dc2 = Int(Rnd * 10 + 1)
4910                     Let w2 = drabo(dc2, dc1)
4911                     If count > 8000 Then Exit Do
4912                 Loop Until w2 Mod 2 <> 0
4913                 Let count = count + 1
4914                 If count > 8000 Then Exit Do
4915             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
4916     End Select
4917     Select Case dc6
4918         Case Is = 1
4919             Do
4920                 Do
4921                     Let count = count + 1
4922                     Let dc4 = Int(Rnd * 10 + 1)
4923                     Let dc5 = Int(Rnd * 10 + 1)
4924                     Let b2 = drabo(dc5, dc4)
4925                     If count > 8000 Then Exit Do
4926                 Loop Until b2 Mod 2 <> 0
4927                 Let count = count + 1
4928                 If count > 8000 Then Exit Do
4929             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
4930         Case Is = 2
4931             Do
4932                 Do
4933                     Let count = count + 1
4934                     Let dc4 = Int(Rnd * 10 + 1)
4935                     Let dc5 = Int(Rnd * 10 + 1)
4936                     Let b2 = drabo(dc5, dc4)
4937                     If count > 8000 Then Exit Do
4938                 Loop Until b2 Mod 2 <> 0
4939                 Let count = count + 1
4940                 If count > 8000 Then Exit Do
4941             Loop While w2 = w1 Or w2 = b1 Or w2 = b2 Or b2 = w1 Or b2 = b1
4942     End Select
4943
4944     Let w2 = drabo(dc2, dc1): Let b2 = drabo(dc5, dc4)
4945     Let fw2x = dc1: Let fw2y = dc2: Let fb2x = dc4: Let fb2y = dc5
4946     Let fw2 = dc3: Let fb2 = dc6
4947
4948     Let x = 20: Let y = 160: Let cf = 15
4949     If dc3 = 1 Then Call dame
4950     If dc3 = 2 Then Call checker
4951     Let x = 580: Let y = 160: Let cf = 0
4952     If dc6 = 1 Then Call dame
4953     If dc6 = 2 Then Call checker
4954     Let x = 20: Let y = 220
4955     If dc1 = 1 Then Call letterA
4956     If dc1 = 2 Then Call letterB
4957     If dc1 = 3 Then Call letterC
4958     If dc1 = 4 Then Call letterD
4959     If dc1 = 5 Then Call letterE
4960     If dc1 = 6 Then Call letterF
4961     If dc1 = 7 Then Call letterG
4962     If dc1 = 8 Then Call letterH
4963     If dc1 = 9 Then Call letterI
4964     If dc1 = 10 Then Call letterJ
4965     Let x = 20: Let y = 280
4966     If dc2 = 1 Then Call letter1
4967     If dc2 = 2 Then Call letter2
4968     If dc2 = 3 Then Call letter3
4969     If dc2 = 4 Then Call letter4
4970     If dc2 = 5 Then Call letter5
4971     If dc2 = 6 Then Call letter6
4972     If dc2 = 7 Then Call letter7
4973     If dc2 = 8 Then Call letter8
4974     If dc2 = 9 Then Call letter9
4975     If dc2 = 10 Then Call letter0
4976     Let x = 580: Let y = 220
4977     If dc4 = 1 Then Call letterA
4978     If dc4 = 2 Then Call letterB
4979     If dc4 = 3 Then Call letterC
4980     If dc4 = 4 Then Call letterD
4981     If dc4 = 5 Then Call letterE
4982     If dc4 = 6 Then Call letterF
4983     If dc4 = 7 Then Call letterG
4984     If dc4 = 8 Then Call letterH
4985     If dc4 = 9 Then Call letterI
4986     If dc4 = 10 Then Call letterJ
4987     Let x = 580: Let y = 280
4988     If dc5 = 1 Then Call letter1
4989     If dc5 = 2 Then Call letter2
4990     If dc5 = 3 Then Call letter3
4991     If dc5 = 4 Then Call letter4
4992     If dc5 = 5 Then Call letter5
4993     If dc5 = 6 Then Call letter6
4994     If dc5 = 7 Then Call letter7
4995     If dc5 = 8 Then Call letter8
4996     If dc5 = 9 Then Call letter9
4997     If dc5 = 10 Then Call letter0
4998     Let x = (dc1 * 40) + 80: Let y = Abs((dc2 * 40) - 480) - 40
4999     Let cf = 15
5000     If dc3 = 1 Then Call dame
5001     If dc3 = 2 Then Call checker
5002     Let x = (dc4 * 40) + 80: Let y = Abs((dc5 * 40) - 480) - 40
5003     Let cf = 0
5004     If dc6 = 1 Then Call dame
5005     If dc6 = 2 Then Call checker
5006
5007     Do
5008         Select Case InKey$
5009             Case Is = Chr$(32)
5010                 Exit Do
5011             Case Is = Chr$(13)
5012                 Call draughtsfen
5013             Case Is = Chr$(27)
5014                 End
5015         End Select
5016     Loop
5017
5018     Call dices
5019
5020     Rem 3rd roll
5021     Let count = 0: Let index = 0
5022     Let dc1 = Int(Rnd * 10 + 1)
5023     Let dc2 = Int(Rnd * 10 + 1)
5024     Let dc3 = Int(Rnd * 2 + 1)
5025     Let dc4 = Int(Rnd * 10 + 1)
5026     Let dc5 = Int(Rnd * 10 + 1)
5027     Let dc6 = Int(Rnd * 2 + 1)
5028     Let w3 = drabo(dc2, dc1): Let b3 = drabo(dc5, dc4)
5029
5030     Select Case dc3
5031         Case Is = 1
5032             Do
5033                 Do
5034                     Let count = count + 1
5035                     Let dc1 = Int(Rnd * 10 + 1)
5036                     Let dc2 = Int(Rnd * 10 + 1)
5037                     Let w3 = drabo(dc2, dc1)
5038                     If count > 8000 Then Exit Do
5039                 Loop Until w3 Mod 2 <> 0
5040                 Let count = count + 1
5041                 If count > 8000 Then Exit Do
5042             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
5043         Case Is = 2
5044             Do
5045                 Do
5046                     Let count = count + 1
5047                     Let dc1 = Int(Rnd * 10 + 1)
5048                     Let dc2 = Int(Rnd * 10 + 1)
5049                     Let w3 = drabo(dc2, dc1)
5050                     If count > 8000 Then Exit Do
5051                 Loop Until w3 Mod 2 <> 0
5052                 Let count = count + 1
5053                 If count > 8000 Then Exit Do
5054             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
5055     End Select
5056     Select Case dc6
5057         Case Is = 1
5058             Do
5059                 Do
5060                     Let count = count + 1
5061                     Let dc4 = Int(Rnd * 10 + 1)
5062                     Let dc5 = Int(Rnd * 10 + 1)
5063                     Let b3 = drabo(dc5, dc4)
5064                     If count > 8000 Then Exit Do
5065                 Loop Until b3 Mod 2 <> 0
5066                 Let count = count + 1
5067                 If count > 8000 Then Exit Do
5068             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
5069         Case Is = 2
5070             Do
5071                 Do
5072                     Let count = count + 1
5073                     Let dc4 = Int(Rnd * 10 + 1)
5074                     Let dc5 = Int(Rnd * 10 + 1)
5075                     Let b3 = drabo(dc5, dc4)
5076                     If count > 8000 Then Exit Do
5077                 Loop Until b3 Mod 2 <> 0
5078                 Let count = count + 1
5079                 If count > 8000 Then Exit Do
5080             Loop While w3 = w1 Or w3 = w2 Or w3 = b1 Or w3 = b2 Or w3 = b3 Or b3 = w1 Or b3 = w2 Or b3 = b1 Or b3 = b2
5081     End Select
5082
5083     Let w3 = drabo(dc2, dc1): Let b3 = drabo(dc5, dc4)
5084     Let fw3x = dc1: Let fw3y = dc2: Let fb3x = dc4: Let fb3y = dc5
5085     Let fw3 = dc3: Let fb3 = dc6
5086
5087     Let x = 20: Let y = 160: Let cf = 15
5088     If dc3 = 1 Then Call dame
5089     If dc3 = 2 Then Call checker
5090     Let x = 580: Let y = 160: Let cf = 0
5091     If dc6 = 1 Then Call dame
5092     If dc6 = 2 Then Call checker
5093     Let x = 20: Let y = 220
5094     If dc1 = 1 Then Call letterA
5095     If dc1 = 2 Then Call letterB
5096     If dc1 = 3 Then Call letterC
5097     If dc1 = 4 Then Call letterD
5098     If dc1 = 5 Then Call letterE
5099     If dc1 = 6 Then Call letterF
5100     If dc1 = 7 Then Call letterG
5101     If dc1 = 8 Then Call letterH
5102     If dc1 = 9 Then Call letterI
5103     If dc1 = 10 Then Call letterJ
5104     Let x = 20: Let y = 280
5105     If dc2 = 1 Then Call letter1
5106     If dc2 = 2 Then Call letter2
5107     If dc2 = 3 Then Call letter3
5108     If dc2 = 4 Then Call letter4
5109     If dc2 = 5 Then Call letter5
5110     If dc2 = 6 Then Call letter6
5111     If dc2 = 7 Then Call letter7
5112     If dc2 = 8 Then Call letter8
5113     If dc2 = 9 Then Call letter9
5114     If dc2 = 10 Then Call letter0
5115     Let x = 580: Let y = 220
5116     If dc4 = 1 Then Call letterA
5117     If dc4 = 2 Then Call letterB
5118     If dc4 = 3 Then Call letterC
5119     If dc4 = 4 Then Call letterD
5120     If dc4 = 5 Then Call letterE
5121     If dc4 = 6 Then Call letterF
5122     If dc4 = 7 Then Call letterG
5123     If dc4 = 8 Then Call letterH
5124     If dc4 = 9 Then Call letterI
5125     If dc4 = 10 Then Call letterJ
5126     Let x = 580: Let y = 280
5127     If dc5 = 1 Then Call letter1
5128     If dc5 = 2 Then Call letter2
5129     If dc5 = 3 Then Call letter3
5130     If dc5 = 4 Then Call letter4
5131     If dc5 = 5 Then Call letter5
5132     If dc5 = 6 Then Call letter6
5133     If dc5 = 7 Then Call letter7
5134     If dc5 = 8 Then Call letter8
5135     If dc5 = 9 Then Call letter9
5136     If dc5 = 10 Then Call letter0
5137     Let x = (dc1 * 40) + 80: Let y = Abs((dc2 * 40) - 480) - 40
5138     Let cf = 15
5139     If dc3 = 1 Then Call dame
5140     If dc3 = 2 Then Call checker
5141     Let x = (dc4 * 40) + 80: Let y = Abs((dc5 * 40) - 480) - 40
5142     Let cf = 0
5143     If dc6 = 1 Then Call dame
5144     If dc6 = 2 Then Call checker
5145
5146     Do
5147         Select Case InKey$
5148             Case Is = Chr$(32)
5149                 Exit Do
5150             Case Is = Chr$(13)
5151                 Call draughtsfen
5152             Case Is = Chr$(27)
5153                 End
5154         End Select
5155     Loop
5156
5157     Call dices
5158
5159     Rem 4th roll
5160     Let count = 0: Let index = 0
5161     Let dc1 = Int(Rnd * 10 + 1)
5162     Let dc2 = Int(Rnd * 10 + 1)
5163     Let dc3 = Int(Rnd * 2 + 1)
5164     Let dc4 = Int(Rnd * 10 + 1)
5165     Let dc5 = Int(Rnd * 10 + 1)
5166     Let dc6 = Int(Rnd * 2 + 1)
5167     Let w4 = drabo(dc2, dc1): Let b4 = drabo(dc5, dc4)
5168
5169     Select Case dc3
5170         Case Is = 1
5171             Do
5172                 Do
5173                     Let count = count + 1
5174                     Let dc1 = Int(Rnd * 10 + 1)
5175                     Let dc2 = Int(Rnd * 10 + 1)
5176                     Let w4 = drabo(dc2, dc1)
5177                     If count > 8000 Then Exit Do
5178                 Loop Until w4 Mod 2 <> 0
5179                 Let count = count + 1
5180                 If count > 8000 Then Exit Do
5181             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
5182         Case Is = 2
5183             Do
5184                 Do
5185                     Let count = count + 1
5186                     Let dc1 = Int(Rnd * 10 + 1)
5187                     Let dc2 = Int(Rnd * 10 + 1)
5188                     Let w4 = drabo(dc2, dc1)
5189                     If count > 8000 Then Exit Do
5190                 Loop Until w4 Mod 2 <> 0
5191                 Let count = count + 1
5192                 If count > 8000 Then Exit Do
5193             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
5194     End Select
5195     Select Case dc6
5196         Case Is = 1
5197             Do
5198                 Do
5199                     Let count = count + 1
5200                     Let dc4 = Int(Rnd * 10 + 1)
5201                     Let dc5 = Int(Rnd * 10 + 1)
5202                     Let b4 = drabo(dc5, dc4)
5203                     If count > 8000 Then Exit Do
5204                 Loop Until b4 Mod 2 <> 0
5205                 Let count = count + 1
5206                 If count > 8000 Then Exit Do
5207             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
5208         Case Is = 2
5209             Do
5210                 Do
5211                     Let count = count + 1
5212                     Let dc4 = Int(Rnd * 10 + 1)
5213                     Let dc5 = Int(Rnd * 10 + 1)
5214                     Let b4 = drabo(dc5, dc4)
5215                     If count > 8000 Then Exit Do
5216                 Loop Until b4 Mod 2 <> 0
5217                 Let count = count + 1
5218                 If count > 8000 Then Exit Do
5219             Loop While w4 = w1 Or w4 = w2 Or w4 = w3 Or w4 = b1 Or w4 = b2 Or w4 = b3 Or w4 = b4 Or b4 = w1 Or b4 = w2 Or b4 = w3 Or b4 = b1 Or b4 = b2 Or b4 = b3
5220     End Select
5221
5222     Let w4 = drabo(dc2, dc1): Let b4 = drabo(dc5, dc4)
5223     Let fw4x = dc1: Let fw4y = dc2: Let fb4x = dc4: Let fb4y = dc5
5224     Let fw4 = dc3: Let fb4 = dc6
5225
5226     Let x = 20: Let y = 160: Let cf = 15
5227     If dc3 = 1 Then Call dame
5228     If dc3 = 2 Then Call checker
5229     Let x = 580: Let y = 160: Let cf = 0
5230     If dc6 = 1 Then Call dame
5231     If dc6 = 2 Then Call checker
5232     Let x = 20: Let y = 220
5233     If dc1 = 1 Then Call letterA
5234     If dc1 = 2 Then Call letterB
5235     If dc1 = 3 Then Call letterC
5236     If dc1 = 4 Then Call letterD
5237     If dc1 = 5 Then Call letterE
5238     If dc1 = 6 Then Call letterF
5239     If dc1 = 7 Then Call letterG
5240     If dc1 = 8 Then Call letterH
5241     If dc1 = 9 Then Call letterI
5242     If dc1 = 10 Then Call letterJ
5243     Let x = 20: Let y = 280
5244     If dc2 = 1 Then Call letter1
5245     If dc2 = 2 Then Call letter2
5246     If dc2 = 3 Then Call letter3
5247     If dc2 = 4 Then Call letter4
5248     If dc2 = 5 Then Call letter5
5249     If dc2 = 6 Then Call letter6
5250     If dc2 = 7 Then Call letter7
5251     If dc2 = 8 Then Call letter8
5252     If dc2 = 9 Then Call letter9
5253     If dc2 = 10 Then Call letter0
5254     Let x = 580: Let y = 220
5255     If dc4 = 1 Then Call letterA
5256     If dc4 = 2 Then Call letterB
5257     If dc4 = 3 Then Call letterC
5258     If dc4 = 4 Then Call letterD
5259     If dc4 = 5 Then Call letterE
5260     If dc4 = 6 Then Call letterF
5261     If dc4 = 7 Then Call letterG
5262     If dc4 = 8 Then Call letterH
5263     If dc4 = 9 Then Call letterI
5264     If dc4 = 10 Then Call letterJ
5265     Let x = 580: Let y = 280
5266     If dc5 = 1 Then Call letter1
5267     If dc5 = 2 Then Call letter2
5268     If dc5 = 3 Then Call letter3
5269     If dc5 = 4 Then Call letter4
5270     If dc5 = 5 Then Call letter5
5271     If dc5 = 6 Then Call letter6
5272     If dc5 = 7 Then Call letter7
5273     If dc5 = 8 Then Call letter8
5274     If dc5 = 9 Then Call letter9
5275     If dc5 = 10 Then Call letter0
5276     Let x = (dc1 * 40) + 80: Let y = Abs((dc2 * 40) - 480) - 40
5277     Let cf = 15
5278     If dc3 = 1 Then Call dame
5279     If dc3 = 2 Then Call checker
5280     Let x = (dc4 * 40) + 80: Let y = Abs((dc5 * 40) - 480) - 40
5281     Let cf = 0
5282     If dc6 = 1 Then Call dame
5283     If dc6 = 2 Then Call checker
5284
5285     Do
5286         Select Case InKey$
5287             Case Is = Chr$(32)
5288                 Rem
5289             Case Is = Chr$(13)
5290                 Call draughtsfen
5291             Case Is = Chr$(27)
5292                 End
5293         End Select
5294     Loop
5295
5296 End Sub
5297
5298 Sub chessfen
5299
5300     Rem Forsyth-Edwards notation
5301
5302     If fw1 = 1 Then Let fig1w$ = "K"
5303     If fw1 = 2 Then Let fig1w$ = "Q"
5304     If fw1 = 3 Then Let fig1w$ = "B"
5305     If fw1 = 4 Then Let fig1w$ = "N"
5306     If fw1 = 5 Then Let fig1w$ = "R"
5307     If fw1 = 6 Then Let fig1w$ = "P"
5308
5309     If fb1 = 1 Then Let fig1b$ = "k"
5310     If fb1 = 2 Then Let fig1b$ = "q"
5311     If fb1 = 3 Then Let fig1b$ = "b"
5312     If fb1 = 4 Then Let fig1b$ = "n"
5313     If fb1 = 5 Then Let fig1b$ = "r"
5314     If fb1 = 6 Then Let fig1b$ = "p"
5315
5316     If fw2 = 1 Then Let fig2w$ = "K"
5317     If fw2 = 2 Then Let fig2w$ = "Q"
5318     If fw2 = 3 Then Let fig2w$ = "B"
5319     If fw2 = 4 Then Let fig2w$ = "N"
5320     If fw2 = 5 Then Let fig2w$ = "R"
5321     If fw2 = 6 Then Let fig2w$ = "P"
5322
5323     If fb2 = 1 Then Let fig2b$ = "k"
5324     If fb2 = 2 Then Let fig2b$ = "q"
5325     If fb2 = 3 Then Let fig2b$ = "b"
5326     If fb2 = 4 Then Let fig2b$ = "n"
5327     If fb2 = 5 Then Let fig2b$ = "r"
5328     If fb2 = 6 Then Let fig2b$ = "p"
5329
5330     If fw3 = 1 Then Let fig3w$ = "K"
5331     If fw3 = 2 Then Let fig3w$ = "Q"
5332     If fw3 = 3 Then Let fig3w$ = "B"
5333     If fw3 = 4 Then Let fig3w$ = "N"
5334     If fw3 = 5 Then Let fig3w$ = "R"
5335     If fw3 = 6 Then Let fig3w$ = "P"
5336
5337     If fb3 = 1 Then Let fig3b$ = "k"
5338     If fb3 = 2 Then Let fig3b$ = "q"
5339     If fb3 = 3 Then Let fig3b$ = "b"
5340     If fb3 = 4 Then Let fig3b$ = "n"
5341     If fb3 = 5 Then Let fig3b$ = "r"
5342     If fb3 = 6 Then Let fig3b$ = "p"
5343
5344     If fw4 = 1 Then Let fig4w$ = "K"
5345     If fw4 = 2 Then Let fig4w$ = "Q"
5346     If fw4 = 3 Then Let fig4w$ = "B"
5347     If fw4 = 4 Then Let fig4w$ = "N"
5348     If fw4 = 5 Then Let fig4w$ = "R"
5349     If fw4 = 6 Then Let fig4w$ = "P"
5350
5351     If fb4 = 1 Then Let fig4b$ = "k"
5352     If fb4 = 2 Then Let fig4b$ = "q"
5353     If fb4 = 3 Then Let fig4b$ = "b"
5354     If fb4 = 4 Then Let fig4b$ = "n"
5355     If fb4 = 5 Then Let fig4b$ = "r"
5356     If fb4 = 6 Then Let fig4b$ = "p"
5357
5358     Dim table(8, 8) As String
5359     Let table(fw1y, fw1x) = fig1w$
5360     Let table(fb1y, fb1x) = fig1b$
5361     Let table(fw2y, fw2x) = fig2w$
5362     Let table(fb2y, fb2x) = fig2b$
5363     Let table(fw3y, fw3x) = fig3w$
5364     Let table(fb3y, fb3x) = fig3b$
5365     Let table(fw4y, fw4x) = fig4w$
5366     Let table(fb4y, fb4x) = fig4b$
5367     For row = 1 To 8: For col = 1 To 8
5368         If table(row, col) = "" Then Let table(row, col) = "+"
5369     Next col: Next row
5370
5371     Let mas1$ = table(1, 1) + table(1, 2) + table(1, 3) + table(1, 4) + table(1, 5) + table(1, 6) + table(1, 7) + table(1, 8)
5372     Let lin1$ = ""
5373     Let count = 0
5374     For index = 1 To 8
5375         If index = 8 And Mid$(mas1$, index, 1) = "+" Then
5376             count = count + 1
5377             lin1$ = lin1$ + LTrim$(Str$(count))
5378         End If
5379         If index < 8 And Mid$(mas1$, index, 1) = "+" Then
5380             count = count + 1
5381         End If
5382         If Mid$(mas1$, index, 1) <> "+" And count = 0 Then
5383             lin1$ = lin1$ + Mid$(mas1$, index, 1)
5384         End If
5385         If Mid$(mas1$, index, 1) <> "+" And count > 0 Then
5386             lin1$ = lin1$ + LTrim$(Str$(count))
5387             lin1$ = lin1$ + Mid$(mas1$, index, 1)
5388             Let count = 0
5389         End If
5390     Next index
5391
5392     Let mas2$ = table(2, 1) + table(2, 2) + table(2, 3) + table(2, 4) + table(2, 5) + table(2, 6) + table(2, 7) + table(2, 8)
5393     Let lin2$ = ""
5394     Let count = 0
5395     For index = 1 To 8
5396         If index = 8 And Mid$(mas2$, index, 1) = "+" Then
5397             count = count + 1
5398             lin2$ = lin2$ + LTrim$(Str$(count))
5399         End If
5400         If index < 8 And Mid$(mas2$, index, 1) = "+" Then
5401             count = count + 1
5402         End If
5403         If Mid$(mas2$, index, 1) <> "+" And count = 0 Then
5404             lin2$ = lin2$ + Mid$(mas2$, index, 1)
5405         End If
5406         If Mid$(mas2$, index, 1) <> "+" And count > 0 Then
5407             lin2$ = lin2$ + LTrim$(Str$(count))
5408             lin2$ = lin2$ + Mid$(mas2$, index, 1)
5409             Let count = 0
5410         End If
5411     Next index
5412
5413     Let mas3$ = table(3, 1) + table(3, 2) + table(3, 3) + table(3, 4) + table(3, 5) + table(3, 6) + table(3, 7) + table(3, 8)
5414     Let lin3$ = ""
5415     Let count = 0
5416     For index = 1 To 8
5417         If index = 8 And Mid$(mas3$, index, 1) = "+" Then
5418             count = count + 1
5419             lin3$ = lin3$ + LTrim$(Str$(count))
5420         End If
5421         If index < 8 And Mid$(mas3$, index, 1) = "+" Then
5422             count = count + 1
5423         End If
5424         If Mid$(mas3$, index, 1) <> "+" And count = 0 Then
5425             lin3$ = lin3$ + Mid$(mas3$, index, 1)
5426         End If
5427         If Mid$(mas3$, index, 1) <> "+" And count > 0 Then
5428             lin3$ = lin3$ + LTrim$(Str$(count))
5429             lin3$ = lin3$ + Mid$(mas3$, index, 1)
5430             Let count = 0
5431         End If
5432     Next index
5433
5434     Let mas4$ = table(4, 1) + table(4, 2) + table(4, 3) + table(4, 4) + table(4, 5) + table(4, 6) + table(4, 7) + table(4, 8)
5435     Let lin4$ = ""
5436     Let count = 0
5437     For index = 1 To 8
5438         If index = 8 And Mid$(mas4$, index, 1) = "+" Then
5439             count = count + 1
5440             lin4$ = lin4$ + LTrim$(Str$(count))
5441         End If
5442         If index < 8 And Mid$(mas4$, index, 1) = "+" Then
5443             count = count + 1
5444         End If
5445         If Mid$(mas4$, index, 1) <> "+" And count = 0 Then
5446             lin4$ = lin4$ + Mid$(mas4$, index, 1)
5447         End If
5448         If Mid$(mas4$, index, 1) <> "+" And count > 0 Then
5449             lin4$ = lin4$ + LTrim$(Str$(count))
5450             lin4$ = lin4$ + Mid$(mas4$, index, 1)
5451             Let count = 0
5452         End If
5453     Next index
5454
5455     Let mas5$ = table(5, 1) + table(5, 2) + table(5, 3) + table(5, 4) + table(5, 5) + table(5, 6) + table(5, 7) + table(5, 8)
5456     Let lin5$ = ""
5457     Let count = 0
5458     For index = 1 To 8
5459         If index = 8 And Mid$(mas5$, index, 1) = "+" Then
5460             count = count + 1
5461             lin5$ = lin5$ + LTrim$(Str$(count))
5462         End If
5463         If index < 8 And Mid$(mas5$, index, 1) = "+" Then
5464             count = count + 1
5465         End If
5466         If Mid$(mas5$, index, 1) <> "+" And count = 0 Then
5467             lin5$ = lin5$ + Mid$(mas5$, index, 1)
5468         End If
5469         If Mid$(mas5$, index, 1) <> "+" And count > 0 Then
5470             lin5$ = lin5$ + LTrim$(Str$(count))
5471             lin5$ = lin5$ + Mid$(mas5$, index, 1)
5472             Let count = 0
5473         End If
5474     Next index
5475
5476     Let mas6$ = table(6, 1) + table(6, 2) + table(6, 3) + table(6, 4) + table(6, 5) + table(6, 6) + table(6, 7) + table(6, 8)
5477     Let lin6$ = ""
5478     Let count = 0
5479     For index = 1 To 8
5480         If index = 8 And Mid$(mas6$, index, 1) = "+" Then
5481             count = count + 1
5482             lin6$ = lin6$ + LTrim$(Str$(count))
5483         End If
5484         If index < 8 And Mid$(mas6$, index, 1) = "+" Then
5485             count = count + 1
5486         End If
5487         If Mid$(mas6$, index, 1) <> "+" And count = 0 Then
5488             lin6$ = lin6$ + Mid$(mas6$, index, 1)
5489         End If
5490         If Mid$(mas6$, index, 1) <> "+" And count > 0 Then
5491             lin6$ = lin6$ + LTrim$(Str$(count))
5492             lin6$ = lin6$ + Mid$(mas6$, index, 1)
5493             Let count = 0
5494         End If
5495     Next index
5496
5497     Let mas7$ = table(7, 1) + table(7, 2) + table(7, 3) + table(7, 4) + table(7, 5) + table(7, 6) + table(7, 7) + table(7, 8)
5498     Let lin7$ = ""
5499     Let count = 0
5500     For index = 1 To 8
5501         If index = 8 And Mid$(mas7$, index, 1) = "+" Then
5502             count = count + 1
5503             lin7$ = lin7$ + LTrim$(Str$(count))
5504         End If
5505         If index < 8 And Mid$(mas7$, index, 1) = "+" Then
5506             count = count + 1
5507         End If
5508         If Mid$(mas7$, index, 1) <> "+" And count = 0 Then
5509             lin7$ = lin7$ + Mid$(mas7$, index, 1)
5510         End If
5511         If Mid$(mas7$, index, 1) <> "+" And count > 0 Then
5512             lin7$ = lin7$ + LTrim$(Str$(count))
5513             lin7$ = lin7$ + Mid$(mas7$, index, 1)
5514             Let count = 0
5515         End If
5516     Next index
5517
5518     Let mas8$ = table(8, 1) + table(8, 2) + table(8, 3) + table(8, 4) + table(8, 5) + table(8, 6) + table(8, 7) + table(8, 8)
5519     Let lin8$ = ""
5520     Let count = 0
5521     For index = 1 To 8
5522         If index = 8 And Mid$(mas8$, index, 1) = "+" Then
5523             count = count + 1
5524             lin8$ = lin8$ + LTrim$(Str$(count))
5525         End If
5526         If index < 8 And Mid$(mas8$, index, 1) = "+" Then
5527             count = count + 1
5528         End If
5529         If Mid$(mas8$, index, 1) <> "+" And count = 0 Then
5530             lin8$ = lin8$ + Mid$(mas8$, index, 1)
5531         End If
5532         If Mid$(mas8$, index, 1) <> "+" And count > 0 Then
5533             lin8$ = lin8$ + LTrim$(Str$(count))
5534             lin8$ = lin8$ + Mid$(mas8$, index, 1)
5535             Let count = 0
5536         End If
5537     Next index
5538
5539     Let fen$ = lin8$ + "/" + lin7$ + "/" + lin6$ + "/" + lin5$ + "/" + lin4$ + "/" + lin3$ + "/" + lin2$ + "/" + lin1$
5540
5541     Color 10
5542     Locate 2, 1: Print "              Press any key to display the Forsyth-Edwards notation                    "
5543     Do
5544     Loop Until InKey$ <> ""
5545     Locate 2, 1: Print "                                                                                       "
5546     Color 12
5547     Locate 2, 28: Print fen$
5548
5549     Do
5550     Loop Until InKey$ <> ""
5551
5552     System
5553
5554 End Sub
5555
5556 Sub makrukfen
5557
5558     Rem Forsyth-Edwards notation
5559
5560     If fw1 = 1 Then Let fig1w$ = "L"
5561     If fw1 = 2 Then Let fig1w$ = "S"
5562     If fw1 = 3 Then Let fig1w$ = "N"
5563     If fw1 = 4 Then Let fig1w$ = "H"
5564     If fw1 = 5 Then Let fig1w$ = "B"
5565     If fw1 = 6 Then Let fig1w$ = "C"
5566
5567     If fb1 = 1 Then Let fig1b$ = "l"
5568     If fb1 = 2 Then Let fig1b$ = "s"
5569     If fb1 = 3 Then Let fig1b$ = "n"
5570     If fb1 = 4 Then Let fig1b$ = "h"
5571     If fb1 = 5 Then Let fig1b$ = "b"
5572     If fb1 = 6 Then Let fig1b$ = "c"
5573
5574     If fw2 = 1 Then Let fig2w$ = "L"
5575     If fw2 = 2 Then Let fig2w$ = "S"
5576     If fw2 = 3 Then Let fig2w$ = "N"
5577     If fw2 = 4 Then Let fig2w$ = "H"
5578     If fw2 = 5 Then Let fig2w$ = "B"
5579     If fw2 = 6 Then Let fig2w$ = "C"
5580
5581     If fb2 = 1 Then Let fig2b$ = "l"
5582     If fb2 = 2 Then Let fig2b$ = "s"
5583     If fb2 = 3 Then Let fig2b$ = "n"
5584     If fb2 = 4 Then Let fig2b$ = "h"
5585     If fb2 = 5 Then Let fig2b$ = "b"
5586     If fb2 = 6 Then Let fig2b$ = "c"
5587
5588     If fw3 = 1 Then Let fig3w$ = "L"
5589     If fw3 = 2 Then Let fig3w$ = "S"
5590     If fw3 = 3 Then Let fig3w$ = "N"
5591     If fw3 = 4 Then Let fig3w$ = "H"
5592     If fw3 = 5 Then Let fig3w$ = "B"
5593     If fw3 = 6 Then Let fig3w$ = "C"
5594
5595     If fb3 = 1 Then Let fig3b$ = "l"
5596     If fb3 = 2 Then Let fig3b$ = "s"
5597     If fb3 = 3 Then Let fig3b$ = "n"
5598     If fb3 = 4 Then Let fig3b$ = "h"
5599     If fb3 = 5 Then Let fig3b$ = "b"
5600     If fb3 = 6 Then Let fig3b$ = "c"
5601
5602     If fw4 = 1 Then Let fig4w$ = "L"
5603     If fw4 = 2 Then Let fig4w$ = "S"
5604     If fw4 = 3 Then Let fig4w$ = "N"
5605     If fw4 = 4 Then Let fig4w$ = "H"
5606     If fw4 = 5 Then Let fig4w$ = "B"
5607     If fw4 = 6 Then Let fig4w$ = "C"
5608
5609     If fb4 = 1 Then Let fig4b$ = "l"
5610     If fb4 = 2 Then Let fig4b$ = "s"
5611     If fb4 = 3 Then Let fig4b$ = "n"
5612     If fb4 = 4 Then Let fig4b$ = "h"
5613     If fb4 = 5 Then Let fig4b$ = "b"
5614     If fb4 = 6 Then Let fig4b$ = "c"
5615
5616     Dim table(8, 8) As String
5617     Let table(fw1y, fw1x) = fig1w$
5618     Let table(fb1y, fb1x) = fig1b$
5619     Let table(fw2y, fw2x) = fig2w$
5620     Let table(fb2y, fb2x) = fig2b$
5621     Let table(fw3y, fw3x) = fig3w$
5622     Let table(fb3y, fb3x) = fig3b$
5623     Let table(fw4y, fw4x) = fig4w$
5624     Let table(fb4y, fb4x) = fig4b$
5625     For row = 1 To 8: For col = 1 To 8
5626         If table(row, col) = "" Then Let table(row, col) = "+"
5627     Next col: Next row
5628
5629     Let mas1$ = table(1, 1) + table(1, 2) + table(1, 3) + table(1, 4) + table(1, 5) + table(1, 6) + table(1, 7) + table(1, 8)
5630     Let lin1$ = ""
5631     Let count = 0
5632     For index = 1 To 8
5633         If index = 8 And Mid$(mas1$, index, 1) = "+" Then
5634             count = count + 1
5635             lin1$ = lin1$ + LTrim$(Str$(count))
5636         End If
5637         If index < 8 And Mid$(mas1$, index, 1) = "+" Then
5638             count = count + 1
5639         End If
5640         If Mid$(mas1$, index, 1) <> "+" And count = 0 Then
5641             lin1$ = lin1$ + Mid$(mas1$, index, 1)
5642         End If
5643         If Mid$(mas1$, index, 1) <> "+" And count > 0 Then
5644             lin1$ = lin1$ + LTrim$(Str$(count))
5645             lin1$ = lin1$ + Mid$(mas1$, index, 1)
5646             Let count = 0
5647         End If
5648     Next index
5649
5650     Let mas2$ = table(2, 1) + table(2, 2) + table(2, 3) + table(2, 4) + table(2, 5) + table(2, 6) + table(2, 7) + table(2, 8)
5651     Let lin2$ = ""
5652     Let count = 0
5653     For index = 1 To 8
5654         If index = 8 And Mid$(mas2$, index, 1) = "+" Then
5655             count = count + 1
5656             lin2$ = lin2$ + LTrim$(Str$(count))
5657         End If
5658         If index < 8 And Mid$(mas2$, index, 1) = "+" Then
5659             count = count + 1
5660         End If
5661         If Mid$(mas2$, index, 1) <> "+" And count = 0 Then
5662             lin2$ = lin2$ + Mid$(mas2$, index, 1)
5663         End If
5664         If Mid$(mas2$, index, 1) <> "+" And count > 0 Then
5665             lin2$ = lin2$ + LTrim$(Str$(count))
5666             lin2$ = lin2$ + Mid$(mas2$, index, 1)
5667             Let count = 0
5668         End If
5669     Next index
5670
5671     Let mas3$ = table(3, 1) + table(3, 2) + table(3, 3) + table(3, 4) + table(3, 5) + table(3, 6) + table(3, 7) + table(3, 8)
5672     Let lin3$ = ""
5673     Let count = 0
5674     For index = 1 To 8
5675         If index = 8 And Mid$(mas3$, index, 1) = "+" Then
5676             count = count + 1
5677             lin3$ = lin3$ + LTrim$(Str$(count))
5678         End If
5679         If index < 8 And Mid$(mas3$, index, 1) = "+" Then
5680             count = count + 1
5681         End If
5682         If Mid$(mas3$, index, 1) <> "+" And count = 0 Then
5683             lin3$ = lin3$ + Mid$(mas3$, index, 1)
5684         End If
5685         If Mid$(mas3$, index, 1) <> "+" And count > 0 Then
5686             lin3$ = lin3$ + LTrim$(Str$(count))
5687             lin3$ = lin3$ + Mid$(mas3$, index, 1)
5688             Let count = 0
5689         End If
5690     Next index
5691
5692     Let mas4$ = table(4, 1) + table(4, 2) + table(4, 3) + table(4, 4) + table(4, 5) + table(4, 6) + table(4, 7) + table(4, 8)
5693     Let lin4$ = ""
5694     Let count = 0
5695     For index = 1 To 8
5696         If index = 8 And Mid$(mas4$, index, 1) = "+" Then
5697             count = count + 1
5698             lin4$ = lin4$ + LTrim$(Str$(count))
5699         End If
5700         If index < 8 And Mid$(mas4$, index, 1) = "+" Then
5701             count = count + 1
5702         End If
5703         If Mid$(mas4$, index, 1) <> "+" And count = 0 Then
5704             lin4$ = lin4$ + Mid$(mas4$, index, 1)
5705         End If
5706         If Mid$(mas4$, index, 1) <> "+" And count > 0 Then
5707             lin4$ = lin4$ + LTrim$(Str$(count))
5708             lin4$ = lin4$ + Mid$(mas4$, index, 1)
5709             Let count = 0
5710         End If
5711     Next index
5712
5713     Let mas5$ = table(5, 1) + table(5, 2) + table(5, 3) + table(5, 4) + table(5, 5) + table(5, 6) + table(5, 7) + table(5, 8)
5714     Let lin5$ = ""
5715     Let count = 0
5716     For index = 1 To 8
5717         If index = 8 And Mid$(mas5$, index, 1) = "+" Then
5718             count = count + 1
5719             lin5$ = lin5$ + LTrim$(Str$(count))
5720         End If
5721         If index < 8 And Mid$(mas5$, index, 1) = "+" Then
5722             count = count + 1
5723         End If
5724         If Mid$(mas5$, index, 1) <> "+" And count = 0 Then
5725             lin5$ = lin5$ + Mid$(mas5$, index, 1)
5726         End If
5727         If Mid$(mas5$, index, 1) <> "+" And count > 0 Then
5728             lin5$ = lin5$ + LTrim$(Str$(count))
5729             lin5$ = lin5$ + Mid$(mas5$, index, 1)
5730             Let count = 0
5731         End If
5732     Next index
5733
5734     Let mas6$ = table(6, 1) + table(6, 2) + table(6, 3) + table(6, 4) + table(6, 5) + table(6, 6) + table(6, 7) + table(6, 8)
5735     Let lin6$ = ""
5736     Let count = 0
5737     For index = 1 To 8
5738         If index = 8 And Mid$(mas6$, index, 1) = "+" Then
5739             count = count + 1
5740             lin6$ = lin6$ + LTrim$(Str$(count))
5741         End If
5742         If index < 8 And Mid$(mas6$, index, 1) = "+" Then
5743             count = count + 1
5744         End If
5745         If Mid$(mas6$, index, 1) <> "+" And count = 0 Then
5746             lin6$ = lin6$ + Mid$(mas6$, index, 1)
5747         End If
5748         If Mid$(mas6$, index, 1) <> "+" And count > 0 Then
5749             lin6$ = lin6$ + LTrim$(Str$(count))
5750             lin6$ = lin6$ + Mid$(mas6$, index, 1)
5751             Let count = 0
5752         End If
5753     Next index
5754
5755     Let mas7$ = table(7, 1) + table(7, 2) + table(7, 3) + table(7, 4) + table(7, 5) + table(7, 6) + table(7, 7) + table(7, 8)
5756     Let lin7$ = ""
5757     Let count = 0
5758     For index = 1 To 8
5759         If index = 8 And Mid$(mas7$, index, 1) = "+" Then
5760             count = count + 1
5761             lin7$ = lin7$ + LTrim$(Str$(count))
5762         End If
5763         If index < 8 And Mid$(mas7$, index, 1) = "+" Then
5764             count = count + 1
5765         End If
5766         If Mid$(mas7$, index, 1) <> "+" And count = 0 Then
5767             lin7$ = lin7$ + Mid$(mas7$, index, 1)
5768         End If
5769         If Mid$(mas7$, index, 1) <> "+" And count > 0 Then
5770             lin7$ = lin7$ + LTrim$(Str$(count))
5771             lin7$ = lin7$ + Mid$(mas7$, index, 1)
5772             Let count = 0
5773         End If
5774     Next index
5775
5776     Let mas8$ = table(8, 1) + table(8, 2) + table(8, 3) + table(8, 4) + table(8, 5) + table(8, 6) + table(8, 7) + table(8, 8)
5777     Let lin8$ = ""
5778     Let count = 0
5779     For index = 1 To 8
5780         If index = 8 And Mid$(mas8$, index, 1) = "+" Then
5781             count = count + 1
5782             lin8$ = lin8$ + LTrim$(Str$(count))
5783         End If
5784         If index < 8 And Mid$(mas8$, index, 1) = "+" Then
5785             count = count + 1
5786         End If
5787         If Mid$(mas8$, index, 1) <> "+" And count = 0 Then
5788             lin8$ = lin8$ + Mid$(mas8$, index, 1)
5789         End If
5790         If Mid$(mas8$, index, 1) <> "+" And count > 0 Then
5791             lin8$ = lin8$ + LTrim$(Str$(count))
5792             lin8$ = lin8$ + Mid$(mas8$, index, 1)
5793             Let count = 0
5794         End If
5795     Next index
5796
5797     Let fen$ = lin8$ + "/" + lin7$ + "/" + lin6$ + "/" + lin5$ + "/" + lin4$ + "/" + lin3$ + "/" + lin2$ + "/" + lin1$
5798
5799     Color 10
5800     Locate 2, 1: Print "              Press any key to display the Forsyth-Edwards notation                    "
5801     Do
5802     Loop Until InKey$ <> ""
5803     Locate 2, 1: Print "                                                                                       "
5804     Color 12
5805     Locate 2, 28: Print fen$
5806
5807     Do
5808     Loop Until InKey$ <> ""
5809
5810     System
5811
5812 End Sub
5813
5814 Sub xiangqifen
5815
5816     Rem Forsyth-Edwards notation
5817
5818     If fw1 = 1 Then Let fig1w$ = "K"
5819     If fw1 = 2 Then Let fig1w$ = "A"
5820     If fw1 = 3 Then Let fig1w$ = "E"
5821     If fw1 = 4 Then Let fig1w$ = "H"
5822     If fw1 = 5 Then Let fig1w$ = "R"
5823     If fw1 = 6 Then Let fig1w$ = "C"
5824     If fw1 = 7 Then Let fig1w$ = "P"
5825
5826     If fb1 = 1 Then Let fig1b$ = "k"
5827     If fb1 = 2 Then Let fig1b$ = "a"
5828     If fb1 = 3 Then Let fig1b$ = "e"
5829     If fb1 = 4 Then Let fig1b$ = "h"
5830     If fb1 = 5 Then Let fig1b$ = "r"
5831     If fb1 = 6 Then Let fig1b$ = "c"
5832     If fb1 = 7 Then Let fig1w$ = "p"
5833
5834     If fw2 = 1 Then Let fig2w$ = "K"
5835     If fw2 = 2 Then Let fig2w$ = "A"
5836     If fw2 = 3 Then Let fig2w$ = "E"
5837     If fw2 = 4 Then Let fig2w$ = "H"
5838     If fw2 = 5 Then Let fig2w$ = "R"
5839     If fw2 = 6 Then Let fig2w$ = "C"
5840     If fw2 = 7 Then Let fig2w$ = "P"
5841
5842     If fb2 = 1 Then Let fig2b$ = "k"
5843     If fb2 = 2 Then Let fig2b$ = "a"
5844     If fb2 = 3 Then Let fig2b$ = "e"
5845     If fb2 = 4 Then Let fig2b$ = "h"
5846     If fb2 = 5 Then Let fig2b$ = "r"
5847     If fb2 = 6 Then Let fig2b$ = "c"
5848     If fb2 = 7 Then Let fig2w$ = "p"
5849
5850     If fw3 = 1 Then Let fig3w$ = "K"
5851     If fw3 = 2 Then Let fig3w$ = "A"
5852     If fw3 = 3 Then Let fig3w$ = "E"
5853     If fw3 = 4 Then Let fig3w$ = "H"
5854     If fw3 = 5 Then Let fig3w$ = "R"
5855     If fw3 = 6 Then Let fig3w$ = "C"
5856     If fw3 = 7 Then Let fig3w$ = "P"
5857
5858     If fb3 = 1 Then Let fig3b$ = "k"
5859     If fb3 = 2 Then Let fig3b$ = "a"
5860     If fb3 = 3 Then Let fig3b$ = "e"
5861     If fb3 = 4 Then Let fig3b$ = "h"
5862     If fb3 = 5 Then Let fig3b$ = "r"
5863     If fb3 = 6 Then Let fig3b$ = "c"
5864     If fb3 = 7 Then Let fig3w$ = "p"
5865
5866     If fw4 = 1 Then Let fig4w$ = "K"
5867     If fw4 = 2 Then Let fig4w$ = "A"
5868     If fw4 = 3 Then Let fig4w$ = "E"
5869     If fw4 = 4 Then Let fig4w$ = "H"
5870     If fw4 = 5 Then Let fig4w$ = "R"
5871     If fw4 = 6 Then Let fig4w$ = "C"
5872     If fw4 = 7 Then Let fig4w$ = "P"
5873
5874     If fb4 = 1 Then Let fig4b$ = "k"
5875     If fb4 = 2 Then Let fig4b$ = "a"
5876     If fb4 = 3 Then Let fig4b$ = "e"
5877     If fb4 = 4 Then Let fig4b$ = "h"
5878     If fb4 = 5 Then Let fig4b$ = "r"
5879     If fb4 = 6 Then Let fig4b$ = "c"
5880     If fb4 = 7 Then Let fig4w$ = "p"
5881
5882     Dim table(10, 9) As String
5883     Let table(fw1y, fw1x) = fig1w$
5884     Let table(fb1y, fb1x) = fig1b$
5885     Let table(fw2y, fw2x) = fig2w$
5886     Let table(fb2y, fb2x) = fig2b$
5887     Let table(fw3y, fw3x) = fig3w$
5888     Let table(fb3y, fb3x) = fig3b$
5889     Let table(fw4y, fw4x) = fig4w$
5890     Let table(fb4y, fb4x) = fig4b$
5891     For row = 1 To 10: For col = 1 To 9
5892         If table(row, col) = "" Then Let table(row, col) = "+"
5893     Next col: Next row
5894
5895     Let mas1$ = table(1, 1) + table(1, 2) + table(1, 3) + table(1, 4) + table(1, 5) + table(1, 6) + table(1, 7) + table(1, 8) + table(1, 9)
5896     Let lin1$ = ""
5897     Let count = 0
5898     For index = 1 To 9
5899         If index = 9 And Mid$(mas1$, index, 1) = "+" Then
5900             count = count + 1
5901             lin1$ = lin1$ + LTrim$(Str$(count))
5902         End If
5903         If index < 9 And Mid$(mas1$, index, 1) = "+" Then
5904             count = count + 1
5905         End If
5906         If Mid$(mas1$, index, 1) <> "+" And count = 0 Then
5907             lin1$ = lin1$ + Mid$(mas1$, index, 1)
5908         End If
5909         If Mid$(mas1$, index, 1) <> "+" And count > 0 Then
5910             lin1$ = lin1$ + LTrim$(Str$(count))
5911             lin1$ = lin1$ + Mid$(mas1$, index, 1)
5912             Let count = 0
5913         End If
5914     Next index
5915
5916     Let mas2$ = table(2, 1) + table(2, 2) + table(2, 3) + table(2, 4) + table(2, 5) + table(2, 6) + table(2, 7) + table(2, 8) + table(2, 9)
5917     Let lin2$ = ""
5918     Let count = 0
5919     For index = 1 To 9
5920         If index = 9 And Mid$(mas2$, index, 1) = "+" Then
5921             count = count + 1
5922             lin2$ = lin2$ + LTrim$(Str$(count))
5923         End If
5924         If index < 9 And Mid$(mas2$, index, 1) = "+" Then
5925             count = count + 1
5926         End If
5927         If Mid$(mas2$, index, 1) <> "+" And count = 0 Then
5928             lin2$ = lin2$ + Mid$(mas2$, index, 1)
5929         End If
5930         If Mid$(mas2$, index, 1) <> "+" And count > 0 Then
5931             lin2$ = lin2$ + LTrim$(Str$(count))
5932             lin2$ = lin2$ + Mid$(mas2$, index, 1)
5933             Let count = 0
5934         End If
5935     Next index
5936
5937     Let mas3$ = table(3, 1) + table(3, 2) + table(3, 3) + table(3, 4) + table(3, 5) + table(3, 6) + table(3, 7) + table(3, 8) + table(3, 9)
5938     Let lin3$ = ""
5939     Let count = 0
5940     For index = 1 To 9
5941         If index = 9 And Mid$(mas3$, index, 1) = "+" Then
5942             count = count + 1
5943             lin3$ = lin3$ + LTrim$(Str$(count))
5944         End If
5945         If index < 9 And Mid$(mas3$, index, 1) = "+" Then
5946             count = count + 1
5947         End If
5948         If Mid$(mas3$, index, 1) <> "+" And count = 0 Then
5949             lin3$ = lin3$ + Mid$(mas3$, index, 1)
5950         End If
5951         If Mid$(mas3$, index, 1) <> "+" And count > 0 Then
5952             lin3$ = lin3$ + LTrim$(Str$(count))
5953             lin3$ = lin3$ + Mid$(mas3$, index, 1)
5954             Let count = 0
5955         End If
5956     Next index
5957
5958     Let mas4$ = table(4, 1) + table(4, 2) + table(4, 3) + table(4, 4) + table(4, 5) + table(4, 6) + table(4, 7) + table(4, 8) + table(4, 9)
5959     Let lin4$ = ""
5960     Let count = 0
5961     For index = 1 To 9
5962         If index = 9 And Mid$(mas4$, index, 1) = "+" Then
5963             count = count + 1
5964             lin4$ = lin4$ + LTrim$(Str$(count))
5965         End If
5966         If index < 9 And Mid$(mas4$, index, 1) = "+" Then
5967             count = count + 1
5968         End If
5969         If Mid$(mas4$, index, 1) <> "+" And count = 0 Then
5970             lin4$ = lin4$ + Mid$(mas4$, index, 1)
5971         End If
5972         If Mid$(mas4$, index, 1) <> "+" And count > 0 Then
5973             lin4$ = lin4$ + LTrim$(Str$(count))
5974             lin4$ = lin4$ + Mid$(mas4$, index, 1)
5975             Let count = 0
5976         End If
5977     Next index
5978
5979     Let mas5$ = table(5, 1) + table(5, 2) + table(5, 3) + table(5, 4) + table(5, 5) + table(5, 6) + table(5, 7) + table(5, 8) + table(5, 9)
5980     Let lin5$ = ""
5981     Let count = 0
5982     For index = 1 To 9
5983         If index = 9 And Mid$(mas5$, index, 1) = "+" Then
5984             count = count + 1
5985             lin5$ = lin5$ + LTrim$(Str$(count))
5986         End If
5987         If index < 9 And Mid$(mas5$, index, 1) = "+" Then
5988             count = count + 1
5989         End If
5990         If Mid$(mas5$, index, 1) <> "+" And count = 0 Then
5991             lin5$ = lin5$ + Mid$(mas5$, index, 1)
5992         End If
5993         If Mid$(mas5$, index, 1) <> "+" And count > 0 Then
5994             lin5$ = lin5$ + LTrim$(Str$(count))
5995             lin5$ = lin5$ + Mid$(mas5$, index, 1)
5996             Let count = 0
5997         End If
5998     Next index
5999
6000     Let mas6$ = table(6, 1) + table(6, 2) + table(6, 3) + table(6, 4) + table(6, 5) + table(6, 6) + table(6, 7) + table(6, 8) + table(6, 9)
6001     Let lin6$ = ""
6002     Let count = 0
6003     For index = 1 To 9
6004         If index = 9 And Mid$(mas6$, index, 1) = "+" Then
6005             count = count + 1
6006             lin6$ = lin6$ + LTrim$(Str$(count))
6007         End If
6008         If index < 9 And Mid$(mas6$, index, 1) = "+" Then
6009             count = count + 1
6010         End If
6011         If Mid$(mas6$, index, 1) <> "+" And count = 0 Then
6012             lin6$ = lin6$ + Mid$(mas6$, index, 1)
6013         End If
6014         If Mid$(mas6$, index, 1) <> "+" And count > 0 Then
6015             lin6$ = lin6$ + LTrim$(Str$(count))
6016             lin6$ = lin6$ + Mid$(mas6$, index, 1)
6017             Let count = 0
6018         End If
6019     Next index
6020
6021     Let mas7$ = table(7, 1) + table(7, 2) + table(7, 3) + table(7, 4) + table(7, 5) + table(7, 6) + table(7, 7) + table(7, 8) + table(7, 9)
6022     Let lin7$ = ""
6023     Let count = 0
6024     For index = 1 To 9
6025         If index = 9 And Mid$(mas7$, index, 1) = "+" Then
6026             count = count + 1
6027             lin7$ = lin7$ + LTrim$(Str$(count))
6028         End If
6029         If index < 9 And Mid$(mas7$, index, 1) = "+" Then
6030             count = count + 1
6031         End If
6032         If Mid$(mas7$, index, 1) <> "+" And count = 0 Then
6033             lin7$ = lin7$ + Mid$(mas7$, index, 1)
6034         End If
6035         If Mid$(mas7$, index, 1) <> "+" And count > 0 Then
6036             lin7$ = lin7$ + LTrim$(Str$(count))
6037             lin7$ = lin7$ + Mid$(mas7$, index, 1)
6038             Let count = 0
6039         End If
6040     Next index
6041
6042     Let mas8$ = table(8, 1) + table(8, 2) + table(8, 3) + table(8, 4) + table(8, 5) + table(8, 6) + table(8, 7) + table(8, 8) + table(8, 9)
6043     Let lin8$ = ""
6044     Let count = 0
6045     For index = 1 To 9
6046         If index = 9 And Mid$(mas8$, index, 1) = "+" Then
6047             count = count + 1
6048             lin8$ = lin8$ + LTrim$(Str$(count))
6049         End If
6050         If index < 9 And Mid$(mas8$, index, 1) = "+" Then
6051             count = count + 1
6052         End If
6053         If Mid$(mas8$, index, 1) <> "+" And count = 0 Then
6054             lin8$ = lin8$ + Mid$(mas8$, index, 1)
6055         End If
6056         If Mid$(mas8$, index, 1) <> "+" And count > 0 Then
6057             lin8$ = lin8$ + LTrim$(Str$(count))
6058             lin8$ = lin8$ + Mid$(mas8$, index, 1)
6059             Let count = 0
6060         End If
6061     Next index
6062
6063     Let mas9$ = table(9, 1) + table(9, 2) + table(9, 3) + table(9, 4) + table(9, 5) + table(9, 6) + table(9, 7) + table(9, 8) + table(9, 9)
6064     Let lin9$ = ""
6065     Let count = 0
6066     For index = 1 To 9
6067         If index = 9 And Mid$(mas9$, index, 1) = "+" Then
6068             count = count + 1
6069             lin9$ = lin9$ + LTrim$(Str$(count))
6070         End If
6071         If index < 9 And Mid$(mas9$, index, 1) = "+" Then
6072             count = count + 1
6073         End If
6074         If Mid$(mas9$, index, 1) <> "+" And count = 0 Then
6075             lin9$ = lin9$ + Mid$(mas9$, index, 1)
6076         End If
6077         If Mid$(mas9$, index, 1) <> "+" And count > 0 Then
6078             lin9$ = lin9$ + LTrim$(Str$(count))
6079             lin9$ = lin9$ + Mid$(mas9$, index, 1)
6080             Let count = 0
6081         End If
6082     Next index
6083
6084     Let mas0$ = table(10, 1) + table(10, 2) + table(10, 3) + table(10, 4) + table(10, 5) + table(10, 6) + table(10, 7) + table(10, 8) + table(10, 9)
6085     Let lin0$ = ""
6086     Let count = 0
6087     For index = 1 To 9
6088         If index = 9 And Mid$(mas0$, index, 1) = "+" Then
6089             count = count + 1
6090             lin0$ = lin0$ + LTrim$(Str$(count))
6091         End If
6092         If index < 9 And Mid$(mas0$, index, 1) = "+" Then
6093             count = count + 1
6094         End If
6095         If Mid$(mas0$, index, 1) <> "+" And count = 0 Then
6096             lin0$ = lin0$ + Mid$(mas0$, index, 1)
6097         End If
6098         If Mid$(mas0$, index, 1) <> "+" And count > 0 Then
6099             lin0$ = lin0$ + LTrim$(Str$(count))
6100             lin0$ = lin0$ + Mid$(mas0$, index, 1)
6101             Let count = 0
6102         End If
6103     Next index
6104
6105     Let fen$ = lin0$ + "/" + lin9$ + "/" + lin8$ + "/" + lin7$ + "/" + lin6$ + "/" + lin5$ + "/" + lin4$ + "/" + lin3$ + "/" + lin2$ + "/" + lin1$
6106
6107     Color 10
6108     Locate 2, 1: Print "              Press any key to display the Forsyth-Edwards notation                    "
6109     Do
6110     Loop Until InKey$ <> ""
6111     Locate 2, 1: Print "                                                                                       "
6112     Color 12
6113     Locate 2, 24: Print fen$
6114
6115     Do
6116     Loop Until InKey$ <> ""
6117
6118     System
6119
6120 End Sub
6121
6122 Sub shogifen
6123
6124     Rem Forsyth-Edwards notation
6125
6126     If fw1 = 1 Then Let fig1w$ = "K"
6127     If fw1 = 2 Then Let fig1w$ = "G"
6128     If fw1 = 3 Then Let fig1w$ = "S"
6129     If fw1 = 4 Then Let fig1w$ = "B"
6130     If fw1 = 5 Then Let fig1w$ = "N"
6131     If fw1 = 6 Then Let fig1w$ = "R"
6132     If fw1 = 7 Then Let fig1w$ = "L"
6133     If fw1 = 8 Then Let fig1w$ = "P"
6134     If fw1 = 9 Then Let fig1w$ = "H"
6135     If fw1 = 10 Then Let fig1w$ = "D"
6136     If fw1 = 11 Then Let fig1w$ = "T"
6137
6138     If fb1 = 1 Then Let fig1b$ = "k"
6139     If fb1 = 2 Then Let fig1b$ = "g"
6140     If fb1 = 3 Then Let fig1b$ = "a"
6141     If fb1 = 4 Then Let fig1b$ = "b"
6142     If fb1 = 5 Then Let fig1b$ = "n"
6143     If fb1 = 6 Then Let fig1b$ = "r"
6144     If fb1 = 7 Then Let fig1b$ = "l"
6145     If fb1 = 8 Then Let fig1b$ = "p"
6146     If fb1 = 9 Then Let fig1b$ = "h"
6147     If fb1 = 10 Then Let fig1b$ = "d"
6148     If fb1 = 11 Then Let fig1b$ = "t"
6149
6150     If fw2 = 1 Then Let fig2w$ = "K"
6151     If fw2 = 2 Then Let fig2w$ = "G"
6152     If fw2 = 3 Then Let fig2w$ = "S"
6153     If fw2 = 4 Then Let fig2w$ = "B"
6154     If fw2 = 5 Then Let fig2w$ = "N"
6155     If fw2 = 6 Then Let fig2w$ = "R"
6156     If fw2 = 7 Then Let fig2w$ = "L"
6157     If fw2 = 8 Then Let fig2w$ = "P"
6158     If fw2 = 9 Then Let fig2w$ = "H"
6159     If fw2 = 20 Then Let fig2w$ = "D"
6160     If fw2 = 22 Then Let fig2w$ = "T"
6161
6162     If fb2 = 1 Then Let fig2b$ = "k"
6163     If fb2 = 2 Then Let fig2b$ = "g"
6164     If fb2 = 3 Then Let fig2b$ = "a"
6165     If fb2 = 4 Then Let fig2b$ = "b"
6166     If fb2 = 5 Then Let fig2b$ = "n"
6167     If fb2 = 6 Then Let fig2b$ = "r"
6168     If fb2 = 7 Then Let fig2b$ = "l"
6169     If fb2 = 8 Then Let fig2b$ = "p"
6170     If fb2 = 9 Then Let fig2b$ = "h"
6171     If fb2 = 20 Then Let fig2b$ = "d"
6172     If fb2 = 22 Then Let fig2b$ = "t"
6173
6174     If fw3 = 1 Then Let fig3w$ = "K"
6175     If fw3 = 2 Then Let fig3w$ = "G"
6176     If fw3 = 3 Then Let fig3w$ = "S"
6177     If fw3 = 4 Then Let fig3w$ = "B"
6178     If fw3 = 5 Then Let fig3w$ = "N"
6179     If fw3 = 6 Then Let fig3w$ = "R"
6180     If fw3 = 7 Then Let fig3w$ = "L"
6181     If fw3 = 8 Then Let fig3w$ = "P"
6182     If fw3 = 9 Then Let fig3w$ = "H"
6183     If fw3 = 30 Then Let fig3w$ = "D"
6184     If fw3 = 33 Then Let fig3w$ = "T"
6185
6186     If fb3 = 1 Then Let fig3b$ = "k"
6187     If fb3 = 2 Then Let fig3b$ = "g"
6188     If fb3 = 3 Then Let fig3b$ = "a"
6189     If fb3 = 4 Then Let fig3b$ = "b"
6190     If fb3 = 5 Then Let fig3b$ = "n"
6191     If fb3 = 6 Then Let fig3b$ = "r"
6192     If fb3 = 7 Then Let fig3b$ = "l"
6193     If fb3 = 8 Then Let fig3b$ = "p"
6194     If fb3 = 9 Then Let fig3b$ = "h"
6195     If fb3 = 30 Then Let fig3b$ = "d"
6196     If fb3 = 33 Then Let fig3b$ = "t"
6197
6198     If fw4 = 1 Then Let fig4w$ = "K"
6199     If fw4 = 2 Then Let fig4w$ = "G"
6200     If fw4 = 3 Then Let fig4w$ = "S"
6201     If fw4 = 4 Then Let fig4w$ = "B"
6202     If fw4 = 5 Then Let fig4w$ = "N"
6203     If fw4 = 6 Then Let fig4w$ = "R"
6204     If fw4 = 7 Then Let fig4w$ = "L"
6205     If fw4 = 8 Then Let fig4w$ = "P"
6206     If fw4 = 9 Then Let fig4w$ = "H"
6207     If fw4 = 40 Then Let fig4w$ = "D"
6208     If fw4 = 44 Then Let fig4w$ = "T"
6209
6210     If fb4 = 1 Then Let fig4b$ = "k"
6211     If fb4 = 2 Then Let fig4b$ = "g"
6212     If fb4 = 3 Then Let fig4b$ = "a"
6213     If fb4 = 4 Then Let fig4b$ = "b"
6214     If fb4 = 5 Then Let fig4b$ = "n"
6215     If fb4 = 6 Then Let fig4b$ = "r"
6216     If fb4 = 7 Then Let fig4b$ = "l"
6217     If fb4 = 8 Then Let fig4b$ = "p"
6218     If fb4 = 9 Then Let fig4b$ = "h"
6219     If fb4 = 40 Then Let fig4b$ = "d"
6220     If fb4 = 44 Then Let fig4b$ = "t"
6221
6222     Dim table(9, 9) As String
6223     Let table(fw1y, fw1x) = fig1w$
6224     Let table(fb1y, fb1x) = fig1b$
6225     Let table(fw2y, fw2x) = fig2w$
6226     Let table(fb2y, fb2x) = fig2b$
6227     Let table(fw3y, fw3x) = fig3w$
6228     Let table(fb3y, fb3x) = fig3b$
6229     Let table(fw4y, fw4x) = fig4w$
6230     Let table(fb4y, fb4x) = fig4b$
6231     For row = 1 To 9: For col = 1 To 9
6232         If table(row, col) = "" Then Let table(row, col) = "+"
6233     Next col: Next row
6234
6235     Let mas1$ = table(1, 1) + table(1, 2) + table(1, 3) + table(1, 4) + table(1, 5) + table(1, 6) + table(1, 7) + table(1, 8) + table(1, 9)
6236     Let lin1$ = ""
6237     Let count = 0
6238     For index = 1 To 9
6239         If index = 9 And Mid$(mas1$, index, 1) = "+" Then
6240             count = count + 1
6241             lin1$ = lin1$ + LTrim$(Str$(count))
6242         End If
6243         If index < 9 And Mid$(mas1$, index, 1) = "+" Then
6244             count = count + 1
6245         End If
6246         If Mid$(mas1$, index, 1) <> "+" And count = 0 Then
6247             lin1$ = lin1$ + Mid$(mas1$, index, 1)
6248         End If
6249         If Mid$(mas1$, index, 1) <> "+" And count > 0 Then
6250             lin1$ = lin1$ + LTrim$(Str$(count))
6251             lin1$ = lin1$ + Mid$(mas1$, index, 1)
6252             Let count = 0
6253         End If
6254     Next index
6255
6256     Let mas2$ = table(2, 1) + table(2, 2) + table(2, 3) + table(2, 4) + table(2, 5) + table(2, 6) + table(2, 7) + table(2, 8) + table(2, 9)
6257     Let lin2$ = ""
6258     Let count = 0
6259     For index = 1 To 9
6260         If index = 9 And Mid$(mas2$, index, 1) = "+" Then
6261             count = count + 1
6262             lin2$ = lin2$ + LTrim$(Str$(count))
6263         End If
6264         If index < 9 And Mid$(mas2$, index, 1) = "+" Then
6265             count = count + 1
6266         End If
6267         If Mid$(mas2$, index, 1) <> "+" And count = 0 Then
6268             lin2$ = lin2$ + Mid$(mas2$, index, 1)
6269         End If
6270         If Mid$(mas2$, index, 1) <> "+" And count > 0 Then
6271             lin2$ = lin2$ + LTrim$(Str$(count))
6272             lin2$ = lin2$ + Mid$(mas2$, index, 1)
6273             Let count = 0
6274         End If
6275     Next index
6276
6277     Let mas3$ = table(3, 1) + table(3, 2) + table(3, 3) + table(3, 4) + table(3, 5) + table(3, 6) + table(3, 7) + table(3, 8) + table(3, 9)
6278     Let lin3$ = ""
6279     Let count = 0
6280     For index = 1 To 9
6281         If index = 9 And Mid$(mas3$, index, 1) = "+" Then
6282             count = count + 1
6283             lin3$ = lin3$ + LTrim$(Str$(count))
6284         End If
6285         If index < 9 And Mid$(mas3$, index, 1) = "+" Then
6286             count = count + 1
6287         End If
6288         If Mid$(mas3$, index, 1) <> "+" And count = 0 Then
6289             lin3$ = lin3$ + Mid$(mas3$, index, 1)
6290         End If
6291         If Mid$(mas3$, index, 1) <> "+" And count > 0 Then
6292             lin3$ = lin3$ + LTrim$(Str$(count))
6293             lin3$ = lin3$ + Mid$(mas3$, index, 1)
6294             Let count = 0
6295         End If
6296     Next index
6297
6298     Let mas4$ = table(4, 1) + table(4, 2) + table(4, 3) + table(4, 4) + table(4, 5) + table(4, 6) + table(4, 7) + table(4, 8) + table(4, 9)
6299     Let lin4$ = ""
6300     Let count = 0
6301     For index = 1 To 9
6302         If index = 9 And Mid$(mas4$, index, 1) = "+" Then
6303             count = count + 1
6304             lin4$ = lin4$ + LTrim$(Str$(count))
6305         End If
6306         If index < 9 And Mid$(mas4$, index, 1) = "+" Then
6307             count = count + 1
6308         End If
6309         If Mid$(mas4$, index, 1) <> "+" And count = 0 Then
6310             lin4$ = lin4$ + Mid$(mas4$, index, 1)
6311         End If
6312         If Mid$(mas4$, index, 1) <> "+" And count > 0 Then
6313             lin4$ = lin4$ + LTrim$(Str$(count))
6314             lin4$ = lin4$ + Mid$(mas4$, index, 1)
6315             Let count = 0
6316         End If
6317     Next index
6318
6319     Let mas5$ = table(5, 1) + table(5, 2) + table(5, 3) + table(5, 4) + table(5, 5) + table(5, 6) + table(5, 7) + table(5, 8) + table(5, 9)
6320     Let lin5$ = ""
6321     Let count = 0
6322     For index = 1 To 9
6323         If index = 9 And Mid$(mas5$, index, 1) = "+" Then
6324             count = count + 1
6325             lin5$ = lin5$ + LTrim$(Str$(count))
6326         End If
6327         If index < 9 And Mid$(mas5$, index, 1) = "+" Then
6328             count = count + 1
6329         End If
6330         If Mid$(mas5$, index, 1) <> "+" And count = 0 Then
6331             lin5$ = lin5$ + Mid$(mas5$, index, 1)
6332         End If
6333         If Mid$(mas5$, index, 1) <> "+" And count > 0 Then
6334             lin5$ = lin5$ + LTrim$(Str$(count))
6335             lin5$ = lin5$ + Mid$(mas5$, index, 1)
6336             Let count = 0
6337         End If
6338     Next index
6339
6340     Let mas6$ = table(6, 1) + table(6, 2) + table(6, 3) + table(6, 4) + table(6, 5) + table(6, 6) + table(6, 7) + table(6, 8) + table(6, 9)
6341     Let lin6$ = ""
6342     Let count = 0
6343     For index = 1 To 9
6344         If index = 9 And Mid$(mas6$, index, 1) = "+" Then
6345             count = count + 1
6346             lin6$ = lin6$ + LTrim$(Str$(count))
6347         End If
6348         If index < 9 And Mid$(mas6$, index, 1) = "+" Then
6349             count = count + 1
6350         End If
6351         If Mid$(mas6$, index, 1) <> "+" And count = 0 Then
6352             lin6$ = lin6$ + Mid$(mas6$, index, 1)
6353         End If
6354         If Mid$(mas6$, index, 1) <> "+" And count > 0 Then
6355             lin6$ = lin6$ + LTrim$(Str$(count))
6356             lin6$ = lin6$ + Mid$(mas6$, index, 1)
6357             Let count = 0
6358         End If
6359     Next index
6360
6361     Let mas7$ = table(7, 1) + table(7, 2) + table(7, 3) + table(7, 4) + table(7, 5) + table(7, 6) + table(7, 7) + table(7, 8) + table(7, 9)
6362     Let lin7$ = ""
6363     Let count = 0
6364     For index = 1 To 9
6365         If index = 9 And Mid$(mas7$, index, 1) = "+" Then
6366             count = count + 1
6367             lin7$ = lin7$ + LTrim$(Str$(count))
6368         End If
6369         If index < 9 And Mid$(mas7$, index, 1) = "+" Then
6370             count = count + 1
6371         End If
6372         If Mid$(mas7$, index, 1) <> "+" And count = 0 Then
6373             lin7$ = lin7$ + Mid$(mas7$, index, 1)
6374         End If
6375         If Mid$(mas7$, index, 1) <> "+" And count > 0 Then
6376             lin7$ = lin7$ + LTrim$(Str$(count))
6377             lin7$ = lin7$ + Mid$(mas7$, index, 1)
6378             Let count = 0
6379         End If
6380     Next index
6381
6382     Let mas8$ = table(8, 1) + table(8, 2) + table(8, 3) + table(8, 4) + table(8, 5) + table(8, 6) + table(8, 7) + table(8, 8) + table(8, 9)
6383     Let lin8$ = ""
6384     Let count = 0
6385     For index = 1 To 9
6386         If index = 9 And Mid$(mas8$, index, 1) = "+" Then
6387             count = count + 1
6388             lin8$ = lin8$ + LTrim$(Str$(count))
6389         End If
6390         If index < 9 And Mid$(mas8$, index, 1) = "+" Then
6391             count = count + 1
6392         End If
6393         If Mid$(mas8$, index, 1) <> "+" And count = 0 Then
6394             lin8$ = lin8$ + Mid$(mas8$, index, 1)
6395         End If
6396         If Mid$(mas8$, index, 1) <> "+" And count > 0 Then
6397             lin8$ = lin8$ + LTrim$(Str$(count))
6398             lin8$ = lin8$ + Mid$(mas8$, index, 1)
6399             Let count = 0
6400         End If
6401     Next index
6402
6403     Let mas9$ = table(9, 1) + table(9, 2) + table(9, 3) + table(9, 4) + table(9, 5) + table(9, 6) + table(9, 7) + table(9, 8) + table(9, 9)
6404     Let lin9$ = ""
6405     Let count = 0
6406     For index = 1 To 9
6407         If index = 9 And Mid$(mas9$, index, 1) = "+" Then
6408             count = count + 1
6409             lin9$ = lin9$ + LTrim$(Str$(count))
6410         End If
6411         If index < 9 And Mid$(mas9$, index, 1) = "+" Then
6412             count = count + 1
6413         End If
6414         If Mid$(mas9$, index, 1) <> "+" And count = 0 Then
6415             lin9$ = lin9$ + Mid$(mas9$, index, 1)
6416         End If
6417         If Mid$(mas9$, index, 1) <> "+" And count > 0 Then
6418             lin9$ = lin9$ + LTrim$(Str$(count))
6419             lin9$ = lin9$ + Mid$(mas9$, index, 1)
6420             Let count = 0
6421         End If
6422     Next index
6423
6424     Let fen$ = lin9$ + "/" + lin8$ + "/" + lin7$ + "/" + lin6$ + "/" + lin5$ + "/" + lin4$ + "/" + lin3$ + "/" + lin2$ + "/" + lin1$
6425
6426     Color 10
6427     Locate 2, 1: Print "              Press any key to display the Forsyth-Edwards notation                    "
6428     Do
6429     Loop Until InKey$ <> ""
6430     Locate 2, 1: Print "                                                                                       "
6431     Color 12
6432     Locate 2, 25: Print fen$
6433
6434     Do
6435     Loop Until InKey$ <> ""
6436
6437     System
6438
6439 End Sub
6440
6441 Sub draughtsfen
6442
6443     Rem Forsyth-Edwards notation
6444
6445     If fw1 = 1 Then Let fig1w$ = "D"
6446     If fw1 = 2 Then Let fig1w$ = "C"
6447
6448     If fb1 = 1 Then Let fig1b$ = "d"
6449     If fb1 = 2 Then Let fig1b$ = "c"
6450
6451     If fw2 = 1 Then Let fig2w$ = "D"
6452     If fw2 = 2 Then Let fig2w$ = "C"
6453
6454     If fb2 = 1 Then Let fig2b$ = "d"
6455     If fb2 = 2 Then Let fig2b$ = "c"
6456
6457     If fw3 = 1 Then Let fig3w$ = "D"
6458     If fw3 = 2 Then Let fig3w$ = "C"
6459
6460     If fb3 = 1 Then Let fig3b$ = "d"
6461     If fb3 = 2 Then Let fig3b$ = "c"
6462
6463     If fw4 = 1 Then Let fig4w$ = "D"
6464     If fw4 = 2 Then Let fig4w$ = "C"
6465
6466     If fb4 = 1 Then Let fig4b$ = "d"
6467     If fb4 = 2 Then Let fig4b$ = "c"
6468
6469     Dim table(10, 10) As String
6470     Let table(fw1y, fw1x) = fig1w$
6471     Let table(fb1y, fb1x) = fig1b$
6472     Let table(fw2y, fw2x) = fig2w$
6473     Let table(fb2y, fb2x) = fig2b$
6474     Let table(fw3y, fw3x) = fig3w$
6475     Let table(fb3y, fb3x) = fig3b$
6476     Let table(fw4y, fw4x) = fig4w$
6477     Let table(fb4y, fb4x) = fig4b$
6478     For row = 1 To 10: For col = 1 To 10
6479         If table(row, col) = "" Then Let table(row, col) = "+"
6480     Next col: Next row
6481
6482     Let mas1$ = table(1, 1) + table(1, 2) + table(1, 3) + table(1, 4) + table(1, 5) + table(1, 6) + table(1, 7) + table(1, 8) + table(1, 9) + table(1, 10)
6483     Let lin1$ = ""
6484     Let count = 0
6485     For index = 1 To 10
6486         If index = 10 And Mid$(mas1$, index, 1) = "+" Then
6487             count = count + 1
6488             lin1$ = lin1$ + LTrim$(Str$(count))
6489         End If
6490         If index < 10 And Mid$(mas1$, index, 1) = "+" Then
6491             count = count + 1
6492         End If
6493         If Mid$(mas1$, index, 1) <> "+" And count = 0 Then
6494             lin1$ = lin1$ + Mid$(mas1$, index, 1)
6495         End If
6496         If Mid$(mas1$, index, 1) <> "+" And count > 0 Then
6497             lin1$ = lin1$ + LTrim$(Str$(count))
6498             lin1$ = lin1$ + Mid$(mas1$, index, 1)
6499             Let count = 0
6500         End If
6501     Next index
6502
6503     Let mas2$ = table(2, 1) + table(2, 2) + table(2, 3) + table(2, 4) + table(2, 5) + table(2, 6) + table(2, 7) + table(2, 8) + table(2, 9) + table(2, 10)
6504     Let lin2$ = ""
6505     Let count = 0
6506     For index = 1 To 10
6507         If index = 10 And Mid$(mas2$, index, 1) = "+" Then
6508             count = count + 1
6509             lin2$ = lin2$ + LTrim$(Str$(count))
6510         End If
6511         If index < 10 And Mid$(mas2$, index, 1) = "+" Then
6512             count = count + 1
6513         End If
6514         If Mid$(mas2$, index, 1) <> "+" And count = 0 Then
6515             lin2$ = lin2$ + Mid$(mas2$, index, 1)
6516         End If
6517         If Mid$(mas2$, index, 1) <> "+" And count > 0 Then
6518             lin2$ = lin2$ + LTrim$(Str$(count))
6519             lin2$ = lin2$ + Mid$(mas2$, index, 1)
6520             Let count = 0
6521         End If
6522     Next index
6523
6524     Let mas3$ = table(3, 1) + table(3, 2) + table(3, 3) + table(3, 4) + table(3, 5) + table(3, 6) + table(3, 7) + table(3, 8) + table(3, 9) + table(3, 10)
6525     Let lin3$ = ""
6526     Let count = 0
6527     For index = 1 To 10
6528         If index = 10 And Mid$(mas3$, index, 1) = "+" Then
6529             count = count + 1
6530             lin3$ = lin3$ + LTrim$(Str$(count))
6531         End If
6532         If index < 10 And Mid$(mas3$, index, 1) = "+" Then
6533             count = count + 1
6534         End If
6535         If Mid$(mas3$, index, 1) <> "+" And count = 0 Then
6536             lin3$ = lin3$ + Mid$(mas3$, index, 1)
6537         End If
6538         If Mid$(mas3$, index, 1) <> "+" And count > 0 Then
6539             lin3$ = lin3$ + LTrim$(Str$(count))
6540             lin3$ = lin3$ + Mid$(mas3$, index, 1)
6541             Let count = 0
6542         End If
6543     Next index
6544
6545     Let mas4$ = table(4, 1) + table(4, 2) + table(4, 3) + table(4, 4) + table(4, 5) + table(4, 6) + table(4, 7) + table(4, 8) + table(4, 9) + table(4, 10)
6546     Let lin4$ = ""
6547     Let count = 0
6548     For index = 1 To 10
6549         If index = 10 And Mid$(mas4$, index, 1) = "+" Then
6550             count = count + 1
6551             lin4$ = lin4$ + LTrim$(Str$(count))
6552         End If
6553         If index < 10 And Mid$(mas4$, index, 1) = "+" Then
6554             count = count + 1
6555         End If
6556         If Mid$(mas4$, index, 1) <> "+" And count = 0 Then
6557             lin4$ = lin4$ + Mid$(mas4$, index, 1)
6558         End If
6559         If Mid$(mas4$, index, 1) <> "+" And count > 0 Then
6560             lin4$ = lin4$ + LTrim$(Str$(count))
6561             lin4$ = lin4$ + Mid$(mas4$, index, 1)
6562             Let count = 0
6563         End If
6564     Next index
6565
6566     Let mas5$ = table(5, 1) + table(5, 2) + table(5, 3) + table(5, 4) + table(5, 5) + table(5, 6) + table(5, 7) + table(5, 8) + table(5, 9) + table(5, 10)
6567     Let lin5$ = ""
6568     Let count = 0
6569     For index = 1 To 10
6570         If index = 10 And Mid$(mas5$, index, 1) = "+" Then
6571             count = count + 1
6572             lin5$ = lin5$ + LTrim$(Str$(count))
6573         End If
6574         If index < 10 And Mid$(mas5$, index, 1) = "+" Then
6575             count = count + 1
6576         End If
6577         If Mid$(mas5$, index, 1) <> "+" And count = 0 Then
6578             lin5$ = lin5$ + Mid$(mas5$, index, 1)
6579         End If
6580         If Mid$(mas5$, index, 1) <> "+" And count > 0 Then
6581             lin5$ = lin5$ + LTrim$(Str$(count))
6582             lin5$ = lin5$ + Mid$(mas5$, index, 1)
6583             Let count = 0
6584         End If
6585     Next index
6586
6587     Let mas6$ = table(6, 1) + table(6, 2) + table(6, 3) + table(6, 4) + table(6, 5) + table(6, 6) + table(6, 7) + table(6, 8) + table(6, 9) + table(6, 10)
6588     Let lin6$ = ""
6589     Let count = 0
6590     For index = 1 To 10
6591         If index = 10 And Mid$(mas6$, index, 1) = "+" Then
6592             count = count + 1
6593             lin6$ = lin6$ + LTrim$(Str$(count))
6594         End If
6595         If index < 10 And Mid$(mas6$, index, 1) = "+" Then
6596             count = count + 1
6597         End If
6598         If Mid$(mas6$, index, 1) <> "+" And count = 0 Then
6599             lin6$ = lin6$ + Mid$(mas6$, index, 1)
6600         End If
6601         If Mid$(mas6$, index, 1) <> "+" And count > 0 Then
6602             lin6$ = lin6$ + LTrim$(Str$(count))
6603             lin6$ = lin6$ + Mid$(mas6$, index, 1)
6604             Let count = 0
6605         End If
6606     Next index
6607
6608     Let mas7$ = table(7, 1) + table(7, 2) + table(7, 3) + table(7, 4) + table(7, 5) + table(7, 6) + table(7, 7) + table(7, 8) + table(7, 9) + table(7, 10)
6609     Let lin7$ = ""
6610     Let count = 0
6611     For index = 1 To 10
6612         If index = 10 And Mid$(mas7$, index, 1) = "+" Then
6613             count = count + 1
6614             lin7$ = lin7$ + LTrim$(Str$(count))
6615         End If
6616         If index < 10 And Mid$(mas7$, index, 1) = "+" Then
6617             count = count + 1
6618         End If
6619         If Mid$(mas7$, index, 1) <> "+" And count = 0 Then
6620             lin7$ = lin7$ + Mid$(mas7$, index, 1)
6621         End If
6622         If Mid$(mas7$, index, 1) <> "+" And count > 0 Then
6623             lin7$ = lin7$ + LTrim$(Str$(count))
6624             lin7$ = lin7$ + Mid$(mas7$, index, 1)
6625             Let count = 0
6626         End If
6627     Next index
6628
6629     Let mas8$ = table(8, 1) + table(8, 2) + table(8, 3) + table(8, 4) + table(8, 5) + table(8, 6) + table(8, 7) + table(8, 8) + table(8, 9) + table(8, 10)
6630     Let lin8$ = ""
6631     Let count = 0
6632     For index = 1 To 10
6633         If index = 10 And Mid$(mas8$, index, 1) = "+" Then
6634             count = count + 1
6635             lin8$ = lin8$ + LTrim$(Str$(count))
6636         End If
6637         If index < 10 And Mid$(mas8$, index, 1) = "+" Then
6638             count = count + 1
6639         End If
6640         If Mid$(mas8$, index, 1) <> "+" And count = 0 Then
6641             lin8$ = lin8$ + Mid$(mas8$, index, 1)
6642         End If
6643         If Mid$(mas8$, index, 1) <> "+" And count > 0 Then
6644             lin8$ = lin8$ + LTrim$(Str$(count))
6645             lin8$ = lin8$ + Mid$(mas8$, index, 1)
6646             Let count = 0
6647         End If
6648     Next index
6649
6650     Let mas9$ = table(9, 1) + table(9, 2) + table(9, 3) + table(9, 4) + table(9, 5) + table(9, 6) + table(9, 7) + table(9, 8) + table(9, 9) + table(9, 10)
6651     Let lin9$ = ""
6652     Let count = 0
6653     For index = 1 To 10
6654         If index = 10 And Mid$(mas9$, index, 1) = "+" Then
6655             count = count + 1
6656             lin9$ = lin9$ + LTrim$(Str$(count))
6657         End If
6658         If index < 10 And Mid$(mas9$, index, 1) = "+" Then
6659             count = count + 1
6660         End If
6661         If Mid$(mas9$, index, 1) <> "+" And count = 0 Then
6662             lin9$ = lin9$ + Mid$(mas9$, index, 1)
6663         End If
6664         If Mid$(mas9$, index, 1) <> "+" And count > 0 Then
6665             lin9$ = lin9$ + LTrim$(Str$(count))
6666             lin9$ = lin9$ + Mid$(mas9$, index, 1)
6667             Let count = 0
6668         End If
6669     Next index
6670
6671     Let mas0$ = table(10, 1) + table(10, 2) + table(10, 3) + table(10, 4) + table(10, 5) + table(10, 6) + table(10, 7) + table(10, 8) + table(10, 9) + table(10, 10)
6672     Let lin0$ = ""
6673     Let count = 0
6674     For index = 1 To 10
6675         If index = 10 And Mid$(mas0$, index, 1) = "+" Then
6676             count = count + 1
6677             lin0$ = lin0$ + LTrim$(Str$(count))
6678         End If
6679         If index < 10 And Mid$(mas0$, index, 1) = "+" Then
6680             count = count + 1
6681         End If
6682         If Mid$(mas0$, index, 1) <> "+" And count = 0 Then
6683             lin0$ = lin0$ + Mid$(mas0$, index, 1)
6684         End If
6685         If Mid$(mas0$, index, 1) <> "+" And count > 0 Then
6686             lin0$ = lin0$ + LTrim$(Str$(count))
6687             lin0$ = lin0$ + Mid$(mas0$, index, 1)
6688             Let count = 0
6689         End If
6690     Next index
6691
6692     Let fen$ = lin0$ + "/" + lin9$ + "/" + lin8$ + "/" + lin7$ + "/" + lin6$ + "/" + lin5$ + "/" + lin4$ + "/" + lin3$ + "/" + lin2$ + "/" + lin1$
6693
6694     Color 10
6695     Locate 2, 1: Print "              Press any key to display the Forsyth-Edwards notation                    "
6696     Do
6697     Loop Until InKey$ <> ""
6698     Locate 2, 1: Print "                                                                                       "
6699     Color 12
6700     Locate 2, 23: Print fen$
6701
6702     Do
6703     Loop Until InKey$ <> ""
6704
6705     System
6706
6707 End Sub
6708
6709 Sub message
6710     Locate 2, 1: Color 9: Print "    SPACEBAR - next pair"; "       ENTER - display notation       "; "ESCAPE - exit    "
6711     Locate 2, 5: Color 5: Print "SPACEBAR": Locate 2, 32: Color 5: Print "ENTER": Locate 2, 63: Color 5: Print "ESCAPE"
6712 End Sub