Advertisement
Guest User

Untitled

a guest
Apr 20th, 2022
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. _Display
  2. Dim arrX, arrY, artLen, iterations As Integer
  3. arrX = 5: arrY = 5: artLen = 5: iterations = 0
  4.  
  5. Dim AsciiArt(arrX, arrY) As Integer 'I think this might be better as a String but it's like 3am and I'm doing weird conversions below let's just chill with it
  6.  
  7. Dim ArtStrings(artLen) As String 'These indicate how each thing will change on the screen, e.g. AsciiArt marked with a 1 iterates thru those 3 characters
  8. ArtStrings(1) = "²³ª"
  9. ArtStrings(2) = "­¯"
  10. ArtStrings(3) = "m¹"
  11. ArtStrings(4) = "T4¼"
  12. ArtStrings(5) = "­G¤L"
  13.  
  14. 'Pretend we want our end array to look like
  15. ' ª¹¼Lª
  16. ' ¹ª¯Lª
  17. ' ¼¹ªLª
  18. ' L¼¹ªª
  19. ' ¯L¼¹ª
  20.  
  21. Dim ArtRows(arrY) As String 'Each number here will get pumped into our AsciiArt 2d array
  22. ArtRows(1) = "13451"
  23. ArtRows(2) = "31251"
  24. ArtRows(3) = "43151"
  25. ArtRows(4) = "54311"
  26. ArtRows(5) = "25431"
  27.  
  28. For i = 1 To arrY
  29. For j = 1 To arrX
  30. AsciiArt(i, j) = Val(Right$(Left$(ArtRows(i), j), 1)) 'actually pumps the asciiart array with the numeric indicator, e.g. asciiart(1,1) becomes 1 here
  31. Next
  32. Next
  33.  
  34.  
  35. 'Check no. of iterations
  36. For i = 1 To artLen
  37. If Len(ArtStrings(i)) > iterations Then iterations = Len(ArtStrings(i))
  38. Next
  39.  
  40. For i = 1 To iterations
  41. _Limit 2
  42. Cls
  43. For x = 1 To arrX
  44. For y = 1 To arrY
  45. s$ = ArtStrings(AsciiArt(x, y)) 'One of the actual Strings which we iterate to know what to display
  46. If i > Len(s$) Then
  47. Print Right$(s$, 1); 'If we've iterated longer than the string we just grab the last value because it's finished iterating
  48. Else
  49. Print Right$(Left$(s$, i), 1); 'Haven't iterated longer than the string so print the latest string
  50. End If
  51. Next
  52. Print "" 'our new line after every y iteration
  53. Next
  54. _Display
  55. Next
  56.  
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement