Created
February 16, 2011 21:03
-
-
Save ryanflorence/830201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = array( | |
'Color' => array('Red', 'Blue'), | |
'Size' => array('Regular', 'Large'), | |
'Material' => array('Metalic', 'Nylon') | |
); | |
function magic_algorithm($arr){ | |
// | |
} | |
$result = magic_algorithm($arr); | |
$expected = array( | |
"Color: Red; Size: Regular; Material: Metalic", | |
"Color: Red; Size: Regular; Material: Nylon", | |
"Color: Red; Size: Large; Material: Metalic", | |
"Color: Red; Size: Large; Material: Nylon", | |
"Color: Blue; Size: Regular; Material: Metalic", | |
"Color: Blue; Size: Regular; Material: Nylon", | |
"Color: Blue; Size: Large; Material: Metalic", | |
"Color: Blue; Size: Large; Material: Nylon" | |
); | |
echo ($expected == $result) ? "Passed" : "Failed"; | |
print_r($result); | |
echo "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks a cartesian product quiz.