In last question , an integer n was given , task was to print the pattern. Example given n=5, 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Sigiloso
$array = array("five1","four1","four2","three1","three2","two1","two2","one1","one2"); $five1 = array(); $four1 = array(); $four2 = array(); $three1 = array(); $three2 = array(); $two1 = array(); $two2 = array(); $one1 = array(); $one2 = array(); $current = 5; $last = 1; for($i=0;$i"; $str = $five1[1].$five1[2].$five1[3].$five1[4].$five1[5]."\r\n"; $str.= $three1[3].$three2[1].$three2[2].$three2[3].$four1[1]."\r\n"; $str.= $three1[2].$one1[1].$one2[1].$two1[1].$four1[2]."\r\n"; $str.= $three1[1].$two2[2].$two2[1].$two1[2].$four1[3]."\r\n"; $str.= $four2[4].$four2[3].$four2[2].$four2[1].$four1[4]; print_r($str);