diff options
author | WWDillingham WesleyDillingham <wwdillingham@sugarlabs.org> | 2009-07-01 18:45:38 (GMT) |
---|---|---|
committer | WWDillingham WesleyDillingham <wwdillingham@sugarlabs.org> | 2009-07-01 18:45:38 (GMT) |
commit | e22b74cec4a393fce7945cb31fa3327c0e1a7047 (patch) | |
tree | c61681e875e46ab8f72044457fb1ba5f29d793d9 | |
parent | 40b5bf7a4bd79ebde318f2fd8239c19a732588ec (diff) |
Non_compound[] now being tallied
-rw-r--r-- | order_of_operations_parser.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/order_of_operations_parser.php b/order_of_operations_parser.php index 2a0af29..d2d5e54 100644 --- a/order_of_operations_parser.php +++ b/order_of_operations_parser.php @@ -181,7 +181,11 @@ for (i=0;i<=$numRecords;i++) // can simply not use regexp but replace with a literal reg expression if(preg_match("+", $equation) && (preg_match("-", $equation) || preg_match("/", $equation) || preg_match("*", $equation))) { - + + if ($tok[3] = "1") //is it also correct? put it in a different associative array with the same key + { + $compound_correct[tok[0]]++; + } } elseif( (preg_match("-", $equation)) && (preg_match("+", $equation) || preg_match("\/", $equation) || preg_match("*", $equation))) { @@ -195,6 +199,10 @@ for (i=0;i<=$numRecords;i++) { } + else + { + $non_compound[tok[0]++; + } /* |