This language bar is your friend. Select your favorite languages!
Edit summary for version 2 :
[D] remove null sentinel

Version 1

Version 2

Idiom #143 Iterate altenatively over two lists

Iterate alternatively over the elements of the list items1 and items2. For each iteration, print the element.

Idiom #143 Iterate altenatively over two lists

Iterate alternatively over the elements of the list items1 and items2. For each iteration, print the element.

Imports
import std.range;
import std.algorithm.iteration;
import std.stdio;
Imports
import std.range;
import std.algorithm.iteration;
import std.stdio;
Code
roundRobin(items1, items2).each!writeln;�
Code
roundRobin(items1, items2).each!writeln;
Doc URL
https://dlang.org/phobos/std_range.html#roundRobin
Doc URL
https://dlang.org/phobos/std_range.html#roundRobin
Demo URL
https://dpaste.dzfl.pl/3870ee68f2e7
Demo URL
https://dpaste.dzfl.pl/3870ee68f2e7