Skip to content

Instantly share code, notes, and snippets.

@kevinmoran
kevinmoran / SquirrelNoise5.hpp
Created July 22, 2022 22:45
Improvement on Squirrel3 noise-based RNG by Squirrel Eiserloh (https://twitter.com/SquirrelTweets/status/1421251894274625536)
//-----------------------------------------------------------------------------------------------
// SquirrelNoise5.hpp
//
#pragma once
/////////////////////////////////////////////////////////////////////////////////////////////////
// SquirrelNoise5 - Squirrel's Raw Noise utilities (version 5)
//
// This code is made available under the Creative Commons attribution 3.0 license (CC-BY-3.0 US):
@kevinmoran
kevinmoran / BitTwiddling.h
Created February 1, 2023 12:31
Bit Twiddling Tricks From Game Engine Gems 2
// https://twitter.com/EricLengyel/status/1620683606216835073
int clearLowestSetBit(int x)
{
return x & (x-1);
}
int setLowestUnsetBit(int x)
{
return x | (x+1);