As @devninja86 suggested you will have to use the range
operator ..
, but unfortunately it does not support the step parameter, which you need (at least I can't find a way to add it). Here is a solution, let's see if someone has better ideas :)
{% set x = 13 %}
{% set step = 3 %}
{% for i in range(0, x, step) %}
<div>
{{ i <= x ? i : '' }}
{{ i <= x - 1 ? i + 1 : '' }}
{{ i <= x - 2 ? i + 2 : '' }}
<hr>
</div>
{% endfor %}
NOTE: For range
PHP function to be available in Volt, you have to add it in your service definition:
$compiler->addFunction('range', 'range');