Added template used in gen.sh

Signed-off-by: erick-alcachofa <erick@artichoke.dev>
This commit is contained in:
erick-alcachofa 2025-09-09 03:36:25 +00:00
parent 7cbc3d90c8
commit c5c3f23170
Signed by: me
GPG Key ID: 6FA5F8643444BAFA
6 changed files with 92 additions and 1 deletions

2
.gitignore vendored
View File

@ -13,7 +13,7 @@
# Unignore all dirs
!*/
**/.template/**
**/.cache/**
**/build/**

0
.template/data/example Normal file
View File

0
.template/data/input Normal file
View File

23
.template/src/impl.hpp Normal file
View File

@ -0,0 +1,23 @@
/*
* Project Euler Solutions - Core Implementation
* ---------------------------------------------
* Problem : {{ problem_name }}
* URL : https://projecteuler.net/problem=1
*
* Author : {{ author_name }}
* Created : {{ date }}
*
* Notes:
* -
*
* License : GNU Affero General Public License v3.0 (AGPLv3)
* https://www.gnu.org/licenses/agpl-3.0.html
*/
#pragma once
#include <cstdint>
#include <sstream>
static int64_t Solve(std::stringstream) {
return 0;
}

View File

@ -0,0 +1,40 @@
/*
* Project Euler Solutions - Main Translation Unit
* ------------------------------------------
* Problem : {{ problem_name }}
* URL : https://projecteuler.net/problem=1
*
* Author : {{ author_name }}
* Created : {{ date }}
*
* Notes:
* -
*
* License : GNU Affero General Public License v3.0 (AGPLv3)
* https://www.gnu.org/licenses/agpl-3.0.html
*/
#include <iostream>
#include <print>
#include <sstream>
#include <string>
#include "timer.hpp"
#include "impl.hpp"
int main(int, char *[]) {
std::ios_base::sync_with_stdio(false),
std::cin.tie(nullptr),
std::cout.tie(nullptr);
std::string input = R"(@input@)";
decltype(Solve({})) ans = {};
{
Timer timer;
ans = Solve(std::stringstream{input});
}
std::println("{}", ans);
}

28
.template/src/test.cpp Normal file
View File

@ -0,0 +1,28 @@
/*
* Project Euler Solutions - Test File
* ------------------------------------
* Problem : {{ problem_name }}
* URL : https://projecteuler.net/problem=1
*
* Author : {{ author_name }}
* Created : {{ date }}
*
* Notes:
* -
*
* License : GNU Affero General Public License v3.0 (AGPLv3)
* https://www.gnu.org/licenses/agpl-3.0.html
*/
#include <gtest/gtest.h>
#include <sstream>
#include "impl.hpp"
const char *input = R"(@example@)";
TEST(Problem1, test) {
const auto ans = Solve(std::stringstream{input});
EXPECT_EQ(ans, 0);
}