The official OHC playground for competitive, high-precision arithmetic bot tournaments.
ArithmetOHC is a C++ project that serves as a competitive platform for arithmetic bot implementations. The project provides a framework where multiple developers can create and test their arithmetic calculation bots in a standardized environment.
ArithmetOHC/
βββ .github/ # GitHub workflows and templates
β βββ workflows/
β β βββ integration-test.yml # CI/CD pipeline for multi-platform testing
β βββ pull_request_template.md # Standardized PR template
βββ aritmetic_bot_luis/ # Luis's arithmetic bot implementation
β βββ bot_header.hpp # Header file with function declarations
β βββ bot_functions.cpp # Implementation of calculation functions
βββ aritmetic_bot_marco/ # Marco's arithmetic bot implementation
β βββ bot_header.hpp # Header file with function declarations
β βββ bot_functions.cpp # Implementation of calculation functions
βββ aritmetic_bot_calileus/ # Calileus's arithmetic bot implementation
β βββ bot_header.hpp # Header file with function declarations
β βββ bot_functions.cpp # Implementation of calculation functions
βββ cmakehelpers/ # CMake helper utilities
β βββ detect_generator.cmake # Platform detection for build system
βββ tests/ # Unit test suite
β βββ CMakeLists.txt # Test configuration with Google Test
β βββ build_gtest/ # Google Test framework (generated, git ignored)
βββ build/ # Build output directory (generated, git ignored)
βββ main.cpp # Main entry point demonstrating bot usage
βββ CMakeLists.txt # Main CMake configuration
βββ build_and_run_project.cmake # Cross-platform build automation script
βββ Doxyfile # Doxygen configuration for documentation
βββ .clang-format # Code formatting rules
βββ .gitignore # Git ignore patterns
βββ LICENSE # Apache License 2.0
βββ CODE_OF_CONDUCT.md # Community guidelines
βββ CONTRIBUTING.md # Contribution guidelines
Each arithmetic bot follows a consistent interface:
- Namespace:
luis_aritmetic_bot - Function:
double calculate(std::string expression) - Purpose: Luis's implementation of arithmetic expression evaluation
- Namespace:
marco_aritmetic_bot - Function:
double calculate(std::string expression) - Purpose: Marco's implementation of arithmetic expression evaluation
- Namespace:
calileus_aritmetic_bot - Function:
double calculate(std::string expression) - Purpose: Calileus's implementation of arithmetic expression evaluation
- CMake 3.28 or higher
- C++17 compatible compiler (GCC, Clang, MSVC)
- Git (for cloning)
cmake -P build_and_run_project.cmakeThis script automatically:
- Detects your platform and available compilers
- Configures CMake with optimal settings
- Builds the project using all available CPU cores
- Runs the executable to demonstrate bot functionality
- Executes unit tests (if enabled)
mkdir build
cd build
cmake ..
cmake --build . --config Release
./arithmet_ohc # On Windows: arithmet_ohc.execd build
./tests/test_arithmet_ohc # On Windows: tests/test_arithmet_ohc.exeOr enable tests in the build script:
cmake -DBUILD_TESTS=ON -P build_and_run_project.cmakeThe main function demonstrates how to use each bot:
#include "aritmetic_bot_luis/bot_header.hpp"
#include "aritmetic_bot_marco/bot_header.hpp"
#include "aritmetic_bot_calileus/bot_header.hpp"
int main() {
double result = luis_aritmetic_bot::calculate("2 + 2");
std::cout << "Luis Result: " << result << std::endl;
result = marco_aritmetic_bot::calculate("2 + 2");
std::cout << "Marco Result: " << result << std::endl;
result = calileus_aritmetic_bot::calculate("2 + 2");
std::cout << "Calileus Result: " << result << std::endl;
return 0;
}The project includes comprehensive Doxygen documentation for all components:
doxygen DoxyfileThis will generate HTML documentation in the docs/ directory with:
- API reference for all bot functions
- Build system documentation
- Architecture overview
- Usage examples
- Create Directory:
aritmetic_bot_<name>/ - Create Header:
bot_header.hppwith namespace and function declaration - Create Implementation:
bot_functions.cppwith function implementation - Update CMakeLists.txt: Add new bot library configuration
- Update main.cpp: Include and test the new bot
- Add Tests: Create unit tests in the
tests/directory
All code must follow the project's coding standards:
- Use
.clang-formatfor code formatting - Follow Doxygen documentation style
- Use C++17 features appropriately
- Include comprehensive unit tests
The project uses Google Test for unit testing:
- Test files should be named
test_*.cpp - Place test files in the
tests/directory - Run tests with
cmake -DBUILD_TESTS=ON -P build_and_run_project.cmake
This repository is designed for arithmetic bot competitions where:
- Each bot implements the same interface
- Performance and accuracy can be compared
- Standardized testing ensures fair evaluation
- Multiple implementations can coexist
The project includes GitHub Actions for:
- Multi-platform testing: Ubuntu, Windows, macOS
- Automated builds: Triggered on push and pull requests
- Integration testing: Full build and test execution
- Quality assurance: Consistent environment testing
This project is licensed under the Apache License 2.0. See LICENSE for details.
Please read CONTRIBUTING.md for our contribution guidelines and CODE_OF_CONDUCT.md for our community standards.
Built with passion by the Obsidian Honor Coders community