Skip to content

Instantly share code, notes, and snippets.

Dictionary<int, bool[,]> EvolveWithLevels(Dictionary<int,bool[,]> levels)
{
Dictionary<int, bool[,]> newLevels = new Dictionary<int, bool[,]>();
foreach(var kvp in levels)
{
int curLevel = kvp.Key;
bool[,] map = kvp.Value;
bool[,] newMap = new bool[mapHeight, mapWidth];
for(var y = 0; y < map.GetLength(0); y++)
@tslater2006
tslater2006 / ESP32NVS.cs
Created April 25, 2020 13:28
ESP32 NVS Parser
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace esp32_flash_to_elf
{
public class ESP32NVSKeyPair
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.Unicode;
namespace esp32_flash_to_elf
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DMSLib
{
public class EndianBinaryReader : BinaryReader
@tslater2006
tslater2006 / RotateFlipBug.cs
Last active June 10, 2020 12:57
Demonstrates a RotateFlip bug in the Bitmap class when dealing with a 52x128 1bpp bitmap
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
namespace TraegerImage
{
class RotateFlipBug
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using System.Security.Policy;
using System.Text;
//Locate and fixup functions
//@author Tim Slater
//@category ESP32
//@keybinding
//@menupath
//@toolbar
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
@tslater2006
tslater2006 / gist:8962321e628e176d0705a2dec1fae662
Created December 15, 2020 05:41
Day 15 2020 First 10k turns
7 -> 6 -> 1
8 -> 1 -> 7
10 -> 7 -> 3
12 -> 10 -> 2
13 -> 2 -> 11
15 -> 12 -> 3
16 -> 11 -> 5
18 -> 15 -> 3
19 -> 16 -> 3
20 -> 19 -> 1
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using Emgu.CV.Util;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
@tslater2006
tslater2006 / Voxelizer.cs
Created October 25, 2021 19:26
Voxelizer for UVTools
using Emgu.CV;
using Emgu.CV.CvEnum;
using KdTree;
using KdTree.Math;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Numerics;
using System.Threading.Tasks;