This Rust-based tool generates, compiles, and tests code using LLMs, resolves dependencies, and provides explanations of existing code through embeddings.
#ifndef SOLUTION_H
#define SOLUTION_H
int solution(int a, int b);
#endif // SOLUTION_H
src/solution.c
#include "solution.h"
int solution(int a, int b) {
return a + b;
}
tests/test_solution.c
#include <assert.h>
#include "solution.h"
int main() {
// Test 1
assert(solution(1, 2) == 3);
// Test 2
assert(solution(-1, -2) == -3);
// Test 3
// Note: C is statically typed, so adding a string and an integer isn't directly applicable.
// This test is omitted or can be adapted as needed.
return 0;
}
Example install dependencies
Ensure you have GCC installed. On most systems, you can install it using:
# For Debian/Ubuntu
sudo apt-get update
sudo apt-get install build-essential
# For macOS using Homebrew
brew install gcc
Launch example
Example query:
Example generation:
Makefile
include/solution.h
src/solution.c
tests/test_solution.c
Example install dependencies
Ensure you have GCC installed. On most systems, you can install it using:
Example launch compilation
Example launch test
Directory Structure: