Skip to content

Instantly share code, notes, and snippets.

using System.Buffers;
using System.Runtime.CompilerServices;
public ref struct PooledList<T>
{
T[]? buffer;
int tail;
public PooledList(int sizeHint)
{
@nuskey8
nuskey8 / dentaku.cs
Created May 17, 2025 09:29
dentaku.cppのC#実装
using System;
using System.Collections.Generic;
// 入力
var input = Console.ReadLine();
// 字句解析
var tokens = Tokenize(input);
// 構文解析
@nuskey8
nuskey8 / dentaku.cpp
Last active May 14, 2025 02:23
自然数の四則演算に対応した言語「Dentaku」の実装サンプル
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// トークンの種類を表すenum
enum TokenType
{
Number,
using System;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using R3;
public static class AddressableDisposableExtensions
{
using R3;
// Action<T1, T2> -> Observable<(T1, T2)>
public class Foo
{
event Action<int, string> OnFoo;
public Observable<(int, string)> OnFooAsObservable()
{
@nuskey8
nuskey8 / CompositeMotionBuilder.cs
Last active July 28, 2024 12:25
CompositeMotionBuilder for LitMotion
using System;
using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine;
using LitMotion;
using LitMotion.Adapters;
public sealed class CompositeMotionBuilder<TValue, TOptions, TAdapter> : IDisposable
where TValue : unmanaged