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
// OpenSiv3D 0.3.1 | |
# include <Siv3D.hpp> | |
namespace fal::rnd { | |
template<class T = void> | |
struct Rnd { | |
using value_type = T; | |
Rnd(const T& from, const T& to) : f(from), t(to) {} | |
Rnd() = delete; |
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.3.1 | |
class IFormatable { | |
public: | |
virtual operator String() const = 0; | |
}; | |
class SubA : public IFormatable { | |
public: | |
int a; |
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
import java.lang.reflect.*; | |
import java.util.*; | |
class Main{ | |
public static void main(String[] $) throws Exception{ | |
Scanner s=new Scanner(System.in); | |
Field[] fields=Main.class.getDeclaredFields(); | |
for(int i=0;i<fields.length;++i){ | |
Field field=fields[i]; | |
autofill(s,field,field.getType().getSimpleName()); |
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()) { |
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
//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
//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
#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
//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 |
OlderNewer