Loops in Rust

Rust has the standard loops one might expect, such as a while (conditional) style loop, and a for (counting) loop. As with most modern languages, it also has a for each style loop. A Bad Type of Loop… One thing that is unique however, is that it also includes a built in infinite loop, which…

Repetition with Ruby

The Ruby method each allows you to iterate over a list of items. This is essentially a for-each style of loop and is like JavaScript’s each method. Notice that the iterative value is placed inside of two pipe (|) characters. You don’t have to put everything on one line. In fact, you can’t if you have multiple…

For Loops in C++

The for loop is the counting loop of C++. It is usually designed to run a specific number of times, and then end. With it, it keeps a counter, to let you know where in the loop you are – useful when looping through an array which will look at soon enough. The general form…