Archive for February, 2016

Variable Number of Nested For Loops

An old problem that came to my head a couple of days ago. I solved it as an excersive in Fortran class about 25 years ago, my current solution is: $lbound = 1; $ubound = 4; $loops = 3; $numbers = array(); for($i=1; $i=1; $l–) { $numbers[$l]++; if( $numbers[$l]>$ubound ) { $numbers[$l] = $lbound; } […]