Skip to content

Instantly share code, notes, and snippets.

# Rishaan Guptanofishleft

• Sort options
Last active Jul 26, 2019
Multithreaded PerlinNoise & Runtime Mesh Editing Alternative
View PerlinMesh.cs
 //Uses Coroutines & LateUpdate to do processing over a larger percentage of the game loop //Uses WaitForEndOfFrame (called after rending before next frame) instead of Update // and LateUpdate (called before rendering) // see: https://docs.unity3d.com/Manual/ExecutionOrder.html using System.Collections; using System.Threading; using System.Threading.Tasks; using UnityEngine;
Last active Jul 26, 2019
DND dice roll summary
View roll.js
 let input = "1d6 + 2d8 + 5"; //let rollEXP = /[^ ,.+]+/gi; const rollEXP = /(?:[0-9]*d[0-9]+)|(?:[0-9]+)/gi; let segments = input.match(rollEXP); let max = new Array(segments.length); let min = new Array(segments.length); let avg = new Array(segments.length);
Last active Jul 25, 2019
Multithreaded PerlinNoise & Runtime Mesh Editing (No coroutines)
View PerlinMesh.cs
 //Uses Update & LateUpdate to synchronize background threads //Uses Update (Called after physics updates) // and LateUpdate (called before rendering) // see: https://docs.unity3d.com/Manual/ExecutionOrder.html using System.Threading; using System.Threading.Tasks; using UnityEngine;
Created May 13, 2019
Finds the 4th point in a rectangle, given three known points
View Find4thPoint.cs
 using UnityEngine; public class Find4thPoint { public Vector3 Find4th(Vector3 a, Vector3 b, Vector3 c) { Vector3 point, cornerA, cornerB; Vector3[] points = new Vector3[] {a, b, c}; float angleDelta = 180;
Last active Mar 1, 2019
Node module to add minesweeper to any discord bot
View mines.js
 //Example Usage: /* const mines = require('./mines.js'); let msg = mines(14,14,20,'X',true); */ //X - Width //Y - Height
You can’t perform that action at this time.