Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1.  
  2. Level2Move: REM-------------------------------------------------------
  3. GOSUB Corner
  4. IF ncorner > 0 THEN RETURN
  5. GOSUB Level1Move
  6. RETURN
  7.  
  8. Corner:
  9. ncorner = 0
  10. FOR i = 1 TO 8 STEP 7
  11. FOR j = 1 TO 8 STEP 7
  12. IF d(i, j) > 0 THEN ncorner = ncorner + 1: e(ncorner, 1) = i: e(ncorner, 2) = j
  13. NEXT j
  14. NEXT i
  15. max = 0
  16. FOR i = 1 TO 8 STEP 7
  17. FOR j = 1 TO 8 STEP 7
  18. IF d(i, j) > max THEN max = d(i, j)
  19. NEXT j
  20. NEXT i
  21. nmax = 0
  22. FOR i = 1 TO 8 STEP 7
  23. FOR j = 1 TO 8 STEP 7
  24. IF d(i, j) = max THEN nmax = nmax + 1: f(nmax, 1) = i: f(nmax, 2) = j
  25. NEXT j
  26. NEXT i
  27. tr = INT(RND * nmax) + 1
  28. x = f(tr, 1)
  29. y = f(tr, 2)
  30. REM---------------------------------------------------------------------------
  31. RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement