Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare sub nLine( byref x1 as integer, byref y1 as integer, byref x2 as integer, byref y2 as integer, byref c as uinteger, byref lthick as integer = 0 )
- screenres 640,480,32
- do
- screenlock
- nLine int(rnd*640),int(rnd*480),int(rnd*640),int(rnd*480), rgb(rnd*256,rnd*256,rnd*256), 1
- screenunlock
- sleep 3,1
- loop until inkey$=chr$(27)
- sleep
- sub nLine( byref x1 as integer, byref y1 as integer, byref x2 as integer, byref y2 as integer, byref c as uinteger, byref lthick as integer = 0 )
- dim as integer Xdif = x2 - x1
- dim as integer Ydif = y2 - y1
- dim as integer xit, yit, tempx, tempy
- if Xdif < 0 then
- Xdif = -Xdif
- end if
- if Ydif < 0 then
- Ydif = -Ydif
- end if
- if Xdif >= Ydif then
- if x2 < x1 then
- swap x2, x1
- swap y2, y1
- end if
- if y2 < y1 then
- Xit = -1
- else
- Xit = 1
- end if
- TempY = y1
- for TempX = x1 to x2
- 'pset(TempX, TempY), c
- 'line(tempx-lthick,tempy-lthick)-(tempx+lthick,tempy+lthick),c,bf
- circle(tempx, tempY), lThick, c,,,,f
- Yit = Yit - Ydif
- if Yit < 0 then
- Yit = Yit + Xdif
- TempY = TempY + Xit
- end if
- next
- else
- if y2 < y1 then
- swap x2, x1
- swap y2, y1
- end if
- if x2 < x1 then
- Xit = -1
- else
- Xit = 1
- end if
- TempX = x1
- for TempY = y1 to y2
- 'pset(TempX, TempY), c
- 'line(tempx-lthick,tempy-lthick)-(tempx+lthick,tempy+lthick),c,bf
- circle(tempx, tempY), lThick, c,,,,f
- Yit = Yit - Xdif
- if Yit < 0 then
- Yit = Yit + Ydif
- TempX = TempX + Xit
- end if
- next
- end if
- end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement