/** function that renders a final 3x5 matrix consisting of random characters * @param $a random number a that renders to the 3x5 matrix consisting of random characters * @param $b random number b that renders to the 3x5 matrix consisting of random characters * */ function renderExpression($a, $b) { $number = array(array(7, 5, 5, 5, 7), array(2, 6, 2, 2, 7), array(7, 1, 7, 4, 7), array(7, 1, 7, 1, 7), array(4, 5, 7, 1, 1), array(7, 4, 7, 1, 7), array(7, 4, 7, 5, 7), array(7, 1, 1, 1, 1), array(7, 5, 7, 5, 7), array(7, 5, 7, 1, 7)); $plus = array(0, 2, 7, 2, 0); $eq = array(0, 7, 0, 7, 0); for ($line = 0; $line < 5; $line++) { $output .= MathGuard::decToBin($number[$a][$line]) . " " . MathGuard::decToBin($plus[$line]) . " " . MathGuard::decToBin($number[$b][$line]) . " " . MathGuard::decToBin($eq[$line]) . "\n"; $output = str_replace("0", " ", $output); } return $output; }