💾 Archived View for freeshell.de › gemlog › 2024-03-16_Looping_backwards.gmi captured on 2024-08-25 at 01:28:29. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-03-21)
-=-=-=-=-=-=-
Post by thrig that lists some ways to loop backwards
...loops that start at one minus the input number and decrement a counter down to 0.
If you have C-style for loops, here's a nice variant: "i starts from n and goes to zero."
for ( int i = n; i --> 0; )