Skip to content

Instantly share code, notes, and snippets.

View Ryoga-exe's full-sized avatar
💭

Ryoga Ryoga-exe

💭
View GitHub Profile
inline unsigned int randxor() {
static unsigned int x=123456789,y=362436069,z=521288629,w=88675123;
unsigned int t;
t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}
@Ryoga-exe
Ryoga-exe / fetch.gs
Last active July 12, 2022 15:46
国立国会図書館サーチAPIを用いたISBNからの書籍情報取得
function fetchBookData(isbn) {
const url = `https://iss.ndl.go.jp/api/opensearch?isbn=${isbn}`;
const xml = UrlFetchApp.fetch(url).getContentText();
const document = XmlService.parse(xml);
const items = document.getRootElement().getChildren('channel')[0].getChildren('item');
if (items.length == 0) {
return;
}
else {
const item = items[0];
# include <Siv3D.hpp> // OpenSiv3D v0.6.4
enum class State {
None,
Swapping,
Pivot,
};
class QuickSortVisualizer {
public:
@Ryoga-exe
Ryoga-exe / RangeSet.cpp
Last active October 23, 2022 18:27
WIP
# include <cstdint>
# include <iostream>
# include <vector>
# include <cassert>
# include <set>
namespace Ryoga_exe
{
using int32 = std::int32_t;
using int64 = std::int64_t;
{
"$schema" : "https://aka.ms/winget-packages.schema.2.0.json",
"CreationDate" : "2022-12-29T20:25:53+09:00",
"Sources" :
[
{
"Packages" :
[
{
"PackageIdentifier" : "7zip.7zip"
# pragma once
# include <Siv3D.hpp>
namespace Tween
{
struct transition_t
{
double to;
Duration begin, end;
std::function<double(double)> easingFunction = EaseInLinear;
@Ryoga-exe
Ryoga-exe / Makefile
Created November 27, 2023 11:21
make 名句
.SILENT:
.PHONY: 名句
名句:
echo "古池や\n蛙飛びこむ\n水の音"
@Ryoga-exe
Ryoga-exe / Yobikomi-kun.ino
Created December 8, 2023 13:04
Play Yobikomi-kun with Arduino
byte step=2; //ピン番号は適当に実配線と合わせる
byte dir=5; //ピン番号は適当に実配線と合わせる
#define D 587
#define E 659
#define F 739
#define G 783
#define A 880
#define B 987
#define a 225
#define b 450
#include <Wire.h>
#include "Adafruit_MPR121.h"
Adafruit_MPR121 cap = Adafruit_MPR121();
uint16_t currtouched = 0;
uint16_t state[12] = {};
uint16_t rstate[12] = {};
bool tstate[12] = {};
const char Data[3] = { 1, 0, -1 };
@Ryoga-exe
Ryoga-exe / setup-siv3d-resources.ps1
Last active December 19, 2023 18:55
Siv3D で example, engine, dll を .gitignore に含めたとき用にセットアップする PowerShell スクリプト
$SIV3D_VERSION = "0.6.13"
$resources = (Get-ChildItem -Recurse Resource.rc)
foreach ($resource in $resources) {
$directory = $resource.DirectoryName
Write-Host "Resource.rc Found! (${resource})" -ForegroundColor Green
$content = (Get-Content $resource.FullName -Raw) -replace "/\*[\s\S]*?\*/|//.*", ""
$m = [regex]::Matches($content, "(?<=(^|\s)Resource\()[^\(\)]+(?=\))", "Multiline")