Added template used in gen.sh
Signed-off-by: erick-alcachofa <erick@artichoke.dev>
This commit is contained in:
parent
7cbc3d90c8
commit
c5c3f23170
2
.gitignore
vendored
2
.gitignore
vendored
@ -13,7 +13,7 @@
|
||||
# Unignore all dirs
|
||||
!*/
|
||||
|
||||
**/.template/**
|
||||
**/.cache/**
|
||||
|
||||
**/build/**
|
||||
|
||||
|
||||
0
.template/data/example
Normal file
0
.template/data/example
Normal file
0
.template/data/input
Normal file
0
.template/data/input
Normal file
23
.template/src/impl.hpp
Normal file
23
.template/src/impl.hpp
Normal 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;
|
||||
}
|
||||
40
.template/src/solution.cpp
Normal file
40
.template/src/solution.cpp
Normal 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
28
.template/src/test.cpp
Normal 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);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user