Looping backwards

=> 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;  )

=> #programming

=> gemlog

Proxy Information
Original URL
gemini://freeshell.de/gemlog/2024-03-16_Looping_backwards.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
105.019175 milliseconds
Gemini-to-HTML Time
0.225226 milliseconds

This content has been proxied by September (ba2dc).