This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::{Range, RangeInclusive}; | |
use serde::{Deserialize, Serialize}; | |
// シンプルな(de)serialize | |
#[derive(Serialize, Deserialize, Debug)] | |
struct SampleSimple { | |
xx_start: i32, | |
xx_end: i32, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <Siv3D.hpp> // OpenSiv3D v0.6.3 | |
namespace KeyConfig { | |
constexpr auto Misc = KeyShift; | |
constexpr auto NoShow = KeyQ; | |
} | |
class MakerRect { | |
private: | |
inline static const Array<String> GradOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <Siv3D.hpp> | |
// Siv3D v0.6.3 | |
// https://qiita.com/ichi-raven/items/61b3cf607deafdba567e | |
// 画面サイズは(800, 600)とする | |
constexpr Rect SceneRect{ 800, 600 }; | |
// 敵の位置を作成する関数 | |
[[nodiscard]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ExperimentalStdlibApi | |
fun <T> MutableList<T>.MYremoveLast() = this.removeAt(this.lastIndex) | |
fun solveSudoku(field:Array<IntArray>):Array<IntArray> { | |
val row = Array(9) {BooleanArray(10) {false}} | |
val col = Array(9) {BooleanArray(10) {false}} | |
val box = Array(3) {Array(3) {BooleanArray(10) {false}}} | |
fun set(i:Int,j:Int,v:Int,bool:Boolean) { | |
row[i][v] = bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <Siv3D.hpp> | |
// https://siv3d.github.io/ja-jp/sample/visual/#2d | |
class LightBloom2D | |
{ | |
protected: | |
Size sceneSize; | |
RenderTexture gaussianA1, gaussianB1; | |
RenderTexture gaussianA4, gaussianB4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//based on https://siv3d.github.io/ja-jp/reference/2d-particle/ | |
# include <Siv3D.hpp> | |
const String siv3d_kun_path = U"example/siv3d-kun.png"; | |
Polygon CreateSiv3D_kunPolygon() | |
{ | |
return Image(siv3d_kun_path) | |
.alphaToPolygonCentered().simplified(1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/falrnd/abc36f56989dc7750bc66e01aae60525 | |
//v1.0.2(とりあえず完成) | |
#include <iostream> | |
#include <string> | |
#include <thread> | |
#include <chrono> | |
#include <random> | |
using std::cin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# include <Siv3D.hpp> | |
void Main() { | |
Window::SetStyle(WindowStyle::Sizable); | |
Scene::Resize(480, 360); | |
Window::Resize(480, 360); | |
double a = 127; | |
double b = 0; | |
double c = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pragma once | |
# include <Siv3D.hpp> //v0.3.3 | |
struct Drag { | |
using position_type = Vec2; | |
position_type begin; | |
void update() { | |
if (MouseL.down()) { |
NewerOlder