Advertisement
andrewb

ANGLES.BAS

Oct 31st, 2020 (edited)
5,342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 0 REM ANGLE.BAS, KIND OF DOES WHAT HPLOT DOES IN GR MODE.
  2. 10 HOME:GR:SX=0:SY=6:EX=36:EY=0:COLOR=4:ONERR GOTO 400
  3. 20 CX=EX-SX:CY=EY-SY
  4. 30 GOSUB 300
  5. 40 IF ABS(CX) >= ABS(CY) GOTO 100
  6. 50 IF ABS(CY) > ABS(CX) GOTO 200
  7. 60 GOTO 400
  8. 100 TSX=SX:TEX=TSX+INT(ABS(CX)/ABS(CY))*XSTEP
  9. 110 FOR I = SY TO EY STEP YSTEP
  10. 120 FOR J = TSX TO TEX STEP XSTEP
  11. 130 IF J = EX GOTO 400
  12. 140 PLOT J,I
  13. 150 NEXT J
  14. 160 TSX=TEX:TEX=TSX+INT(ABS(CX)/ABS(CY))*XSTEP
  15. 170 NEXT I
  16. 180 GOTO 400
  17. 200 TSY=SY:TEY=TSY+INT(ABS(CY)/ABS(CX))*YSTEP
  18. 210 FOR I = SX TO EX STEP XSTEP
  19. 220 FOR J = TSY TO TEY STEP YSTEP
  20. 230 IF J = EY GOTO 400
  21. 240 PLOT I,J
  22. 250 NEXT J
  23. 260 TSY=TEY:TEY=TSY+INT(ABS(CY)/ABS(CX))*YSTEP
  24. 270 NEXT I
  25. 280 GOTO 400
  26. 300 IF CX > 0 THEN XSTEP=1
  27. 310 IF CX < 0 THEN XSTEP=-1
  28. 320 IF CY > 0 THEN YSTEP=1
  29. 330 IF CY < 0 THEN YSTEP=-1
  30. 340 RETURN
  31. 400 PRINT CX;",";CY:COLOR=3:PLOT SX,SY:PLOT EX,EY:END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement