Changeset 1118 for code/branches/input/src/orxonox/Orxonox.cc
- Timestamp:
- Apr 20, 2008, 4:31:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/input/src/orxonox/Orxonox.cc
r1112 r1118 54 54 //#include "util/Sleep.h" 55 55 #include "util/ArgReader.h" 56 #include "util/ FloatParser.h"56 #include "util/ExprParser.h" 57 57 58 58 // core … … 130 130 static void calculate(std::string calculation) 131 131 { 132 char** useless = 0; 133 double result = 0.0; 134 bool success = parse_float((char* const)calculation.c_str(), useless, &result); 135 if (success) 136 { 137 if (result == 42.0) 132 ExprParser expr(calculation); 133 if (expr.getSuccess()) 134 { 135 if (expr.getResult() == 42.0) 138 136 std::cout << "Greetings from the restaurant at the end of the universe." << std::endl; 139 std::cout << "Result is: " << result << std::endl; 137 // FIXME: insert modifier to display in full precision 138 std::cout << "Result is: " << expr.getResult() << std::endl; 139 if (expr.getRemains() != "") 140 std::cout << "Warning: Expression could not be parsed to the end! Remains: '" 141 << expr.getRemains() << "'" << std::endl; 140 142 } 141 143 else
Note: See TracChangeset
for help on using the changeset viewer.