Skip to content

Instantly share code, notes, and snippets.

View Raclamusi's full-sized avatar

Raclamusi Raclamusi

View GitHub Profile
# include "LocalStorage.hpp"
# include <emscripten.h>
using namespace s3d;
namespace LocalStorage
{
namespace detail
{
# include <Siv3D.hpp>
# include <list>
// カードサイズ
constexpr double CardWidth = 80;
constexpr Vec2 CardSize{ CardWidth, CardWidth * Math::Phi };
// 山札の領域
constexpr RectF StockRegion{ Arg::center = Vec2{ 100, 100 }, CardSize };
// 捨て札の領域
#ifndef INCLUDED_CONSTEXPR_PAINT
#if __INCLUDE_LEVEL__ == 1
# define STARTED_INCLUDING_CONSTEXPR_PAINT
#elif not defined(STARTED_INCLUDING_CONSTEXPR_PAINT)
# error this file must be included directly from the source file
#endif
#ifdef STARTED_INCLUDING_CONSTEXPR_PAINT
#include "constexpr_print.hpp"
#include <array>
#include <string_view>
#include <algorithm>
#include <concepts>
template <std::unsigned_integral T>
constexpr std::size_t digits(T x) {
std::size_t d = 1;
while (x /= 10) ++d;
@Raclamusi
Raclamusi / range_pattern.cpp
Created December 14, 2022 06:26
C# 11 のリスト パターンを C++ で作ってみました。
#include <functional>
#include <iterator>
#include <tuple>
#include <type_traits>
#include <iostream>
#include <vector>
#include <list>
template <class T, class = void>