Advertisement
CluelessDev

Matematically cyle backwards and fowards a table

Apr 21st, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.22 KB | None | 0 0
  1. local currentIndex = 1
  2.  
  3. local arr = {1,2,3,4,5,6}
  4.  
  5.  
  6. for index = currentIndex, 11 do
  7.     print( #arr+1 - index)
  8. end
  9.  
  10. local  index=1
  11. local maxIndexs=9
  12.  
  13. for i=1,20 do  
  14.     index = index%(maxIndexs)-1 print(index+2)
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement