Skip to content

Instantly share code, notes, and snippets.

View falrnd's full-sized avatar

Hozumi Hiroaki falrnd

  • Xbit, Inc.
  • Japan
  • 23:57 (UTC +09:00)
  • X @fal_rnd
View GitHub Profile
@falrnd
falrnd / RndNum.cpp
Last active February 3, 2019 07:41
// 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;
# include <Siv3D.hpp> // OpenSiv3D v0.3.1
class IFormatable {
public:
virtual operator String() const = 0;
};
class SubA : public IFormatable {
public:
int a;
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());
# include <Siv3D.hpp> // OpenSiv3D v0.3.1
void DrawBiscuit(const Circle& c, bool drawShadow) {
c.drawShadow({0, 2}, 12, 2 + drawShadow * 2)
.draw(Color(250, 180, 100))
.drawFrame(1, 1, Color(240, 140, 80));
Circle(c.center, 1.5).draw(ColorF(0.0, 0.3));
for (auto i : step(6)) {
# pragma once
# include <Siv3D.hpp> //v0.3.3
struct Drag {
using position_type = Vec2;
position_type begin;
void update() {
if (MouseL.down()) {
@falrnd
falrnd / Main_Client.cpp
Created June 15, 2019 08:39
OpenSiv3D v0.4.0b TCPServer & TCPClient Sample
# 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;
//https://gist.github.com/falrnd/abc36f56989dc7750bc66e01aae60525
//v1.0.2(とりあえず完成)
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
#include <random>
using std::cin;
//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);
}
#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;
@falrnd
falrnd / SolveSudokuMain.kt
Created July 4, 2020 08:37
技育祭 Day1 Goライブコーディングから触発されたもの
//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