рна стрільба (мимо) - хід зарахований": Exit Sub S2 (X, Y) = 3 Then ShotResult = "Повторна стрільба (було попадання) - хід зарахований": Exit Sub
Exit Sub
'Тест: поранений або убитий
c = 0CX (16) As Byte, CY (16) As Byte
'Внізi = X To X + 3i> 9 Then GoTo 101Num = 1 ThenS1 (i, Y) = 1 Then GoTo 110S1 (i, Y) = 0 Or S1 (i, Y) = 2 Then GoTo 101S1 (i, Y) = 3 Then CX (c) = i: CY (c) = Y: c = c + 1IfNum = 2 ThenS2 (i, Y) = 1 Then GoTo 110S2 (i, Y) = 0 Or S2 (i, Y) = 2 Then GoTo 101S2 (i, Y) = 3 Then CX (c) = i: CY (c) = Y: c = c + 1Ifi
'Вверхi = X To X - 3 Step-1i <0 Then GoTo 102Num = 1 ThenS1 (i, Y) = 1 Then GoTo 110S1 (i, Y) = 0 Or S1 (i, Y) = 2 Then GoTo 102S1 (i, Y) = 3 Then CX (c) = i: CY (c) = Y: c = c + 1IfNum = 2 ThenS2 (i, Y) = 1 Then GoTo 110S2 (i, Y) = 0 Or S2 (i, Y) = 2 Then GoTo 102S2 (i, Y) = 3 Then CX (c) = i: CY (c) = Y: c = c + 1Ifi
'Влевоi = Y To Y - 3 Step-1i <0 Then GoTo 103Num = 1 ThenS1 (X, i) = 1 Then GoTo 110S1 (X, i) = 0 Or S1 (X, i) = 2 Then GoTo 103S1 (X, i) = 3 Then CX (c) = X: CY (c) = i: c = c + 1IfNum = 2 ThenS2 (X, i) = 1 Then GoTo 110S2 (X, i) = 0 Or S2 (X, i) = 2 Then GoTo 103S2 (X, i) = 3 Then CX (c) = X: CY (c) = i: c = c + 1Ifi
'Вправоi = Y To Y + 3i> 9 Then GoTo 104Num = 1 ThenS1 (X, i) = 1 Then GoTo 110S1 (X, i) = 0 Or S1 (X, i) = 2 Then GoTo 104S1 (X, i) = 3 Then CX (c) = X: CY (c) = i: c = c + 1IfNum = 2 ThenS2 (X, i) = 1 Then GoTo 110S2 (X, i) = 0 Or S2 (X, i) = 2 Then GoTo 104S2 (X, i) = 3 Then CX (c) = X: CY (c) = i: c = c + 1Ifi
'Вбито = 0x0 (10), y0 (10) = "Вбито" i = 0 To c - 1
'підраховуємо, який був убитий
X1 = CX (i) = CY (i) L = 0 To mx0 (L) = X1 Then If y0 (L) = Y1 Then GoTo 106L (m) = X1 (m) = Y1 = m + 1
For j = -1 To 1k = -1 To 1 = CX (i) + kX1 <0 Or X1> 9 Then GoTo 105 = CY (i) + jY1 <0 Or Y1 > 9 Then GoTo 105Num = 1 Then If S1 (X1, Y1) = 0 Then S1 (X1, Y1) = 2: V1 (X1, Y1) = 2Num = 2 Then If S2 (X1, Y1) = 0 Then S2 (X1, Y1) = 2: V2 (X1, Y1) = 2
Next kjii = 0 To mx0 (i) = XPos Then If y0 (i) = YPos Then GoTo 107i = m + 1
ShipL = Str (m)
'Поранений = "Поранений" SubOpenVSea (Num As Byte) Num = 1 Theni = 0 To 9j = 0 To 9 (j, i) = S1 (j, i) jiSubIfi = 0 To 9j = 0 To 9 (j, i) = S2 (j, i) jiSubSub Strike (Num As Byte) '- Вибирає комірку на поле Num для "вогню" по ній.
'На виході видає змінні StrX і StrY, які використовуються
'як X і Y для "пострілу" (Fire (Num, StrX, StrY)), а
'також збільшує змінну Moves на 1 за кожен раз.
500 If Num <1 Or Num> 2 Then GoTo 99
'Робимо віртуал...