|
dvkv.BAS |
|
{* Движение по квадрату *}REM basic ' Движение по квадратуSCREEN 9 {движение по квадрату
}CLS
SLEEP 2
Dim xx(8) As Integer
Dim yy(8) As Integer
xx(1) = 0
xx(2) = 1
xx(3) = 1
xx(4) = 1
xx(5) = 0
xx(6) = -1
xx(7) = -1
xx(8) = -1
yy(1) = -1
yy(2) = -1
yy(3) = 0
yy(4) = 1
yy(5) = 1
yy(6) = 1
yy(7) = 0
yy(8) = -1
xold = 50
yold = 90
x0 = xold - 4
y0 = yold - 4
LINE (x0, y0)-(x0 + 190, y0 + 190), 2, B
{CIRCLE (x0 + 95, y0), 95 + j, 1
}{PAINT (x0 + 95, y0), 1, 1
}RANDOMIZE TIMER
11 n = 1
12 If i = 9 And n < 9 Then i = 1
x = x0 + xx(i)
y = y0 + yy(i)
If x xold Or y yold Then
If POINT(x, y) 0 Then
col = POINT(x, y)
PSET (x0, y0), col
PSET (x, y), 14
xold = x0
yold = y0
x0 = x
y0 = y
LOCATE 23, 2
PRINT i, xold, yold
For j = 1 To 2000
Next j
GoTo 11
End If
End If
13 i = i + 1
n = n + 1
If n < 9 Then GoTo 12
End
|