Skip to content

Instantly share code, notes, and snippets.

@stantoxt
stantoxt / fisher-yates.cs
Created June 25, 2024 09:14 — forked from mikedugan/fisher-yates.cs
a simple C# implementation of the fisher-yates shuffle used to randomize array elements without bias
public static void Shuffle<T>(T[] array)
{
var random = _random;
for (int i = array.Length; i > 1; i--)
{
// Pick random element to swap.
int j = random.Next(i); // 0 <= j <= i-1
// Swap.
T tmp = array[j];
array[j] = array[i - 1];
@stantoxt
stantoxt / ShuffleArray.cs
Created June 25, 2024 09:16 — forked from cosmicmonster/ShuffleArray.cs
Unity / C# code to shuffle an array using the Fisher-Yates Shuffle.
using UnityEngine;
using System.Collections;
public class ShuffleArray : MonoBehaviour {
// Public so you can fill the array in the inspector
public int[] scenarios;
void Start ()
@stantoxt
stantoxt / docker-registry-mirrors.md
Created December 6, 2024 09:09 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@stantoxt
stantoxt / WebGL-WebGPU-frameworks-libraries.md
Created March 4, 2025 09:07 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub