Lab 15, Part 2 -------------- This was Old Macdonald's Farm. It was marked out of 3. If you thought you deserved 3 out of 3 but didn't get it, here are some of the possible reasons: - is your program free of run-time warnings when the user selects no animals at all? - are you sure you have the lyrics absolutely right? e.g. some of you did not repeat the previous animals; some of you repeated them, but not in reverse - maybe your solution was unusually inefficient/cumbersome, e.g. repeatedly using the built-in array_reverse function Lab 15, Part 3 -------------- This was the chessboard. It was marked out of 7. It was a gift - a simple nested for-loop: in the simplest solutions, the outer loop goes round n times and the inner loop also goes round n times. After getting the user's input and validating it, the main part of the program might look like this (in pseudocode): for ( $i = 0; $i < $n; $i++ ) { for ( $j = 0; $j < $n; $j++ ) { if ( $i and $j both even OR $i and $j both odd ) { draw a rectangle and fill it with red (it's top left is at x = $j * 40, y = $i * 40) } else { draw a rectangle but only its border is red (same x and y as above) } } } Look at the test in the if-statement above. In even rows you want even columns to be red and in odd rows you want odd columns to be red. The shortest way of translating the pseudocode into PHP is: if ( $i % 2 == $j % 2 ) (There are, as usual, billions of other solutions, e.g. without going into details, there are ways to make it work that have $i and $j go up by 2 each time.) You lost marks if - your white rectangles were borderless - your validation was wrong - the size of your image was wrong - your solution works for even n but not for odd n (or vice versa) - your way of alternating red/white squares was a lot more cumbersome than mine - etc.