Skip to content

Instantly share code, notes, and snippets.

View GuyInGrey's full-sized avatar
👌
Enjoying Life

GuyInGrey GuyInGrey

👌
Enjoying Life
  • United States
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Processing;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace MorganSS
{
public class DialogueBox : MonoBehaviour
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Processing;
namespace EDStatistics
{
public class GalaxyDisplay : ProcessingCanvas
{
using System;
using System.IO;
using Processing;
namespace EDStatistics
{
public static class GalaxyRenderer
{
public static PColor[] DefaultColorMapping = new[]
{
var random = new Random(1); // Set seed for consistent results
var numbers = new int[50000000]; // Large dataset
Console.WriteLine("Generating numbers...");
for (var i = 0; i < numbers.Length; i++)
{
numbers[i] = random.Next();
}
Console.WriteLine("Creating copies...");
using System.Drawing;
using Processing;
namespace Processing_Test
{
public class Recursion : ProcessingCanvas
{
int maxDepth = 0;
public Recursion() => CreateCanvas(1000, 1000, 30);
[Command("fib")]
[Alias("fibonnaci")]
[Syntax("fib <n>")]
[RequireRole("staff")]
public async Task Fib(int n)
{
if (n <= 0) { await ReplyAsync("No."); return; }
if (n == 1) { await ReplyAsync("0"); return; }
if (n == 2) { await ReplyAsync("1"); return; }
Client.ChannelCreated += async (a) => DiscordEvent("ChannelCreated", a);
Client.ChannelDestroyed += async (a) => DiscordEvent("ChannelDestroyed", a);
Client.ChannelUpdated += async (a, b) => DiscordEvent("ChannelUpdated", a, b);
Client.Connected += async () => DiscordEvent("Connected");
Client.CurrentUserUpdated += async (a, b) => DiscordEvent("CurrentUserUpdated", a, b);
Client.Disconnected += async (a) => DiscordEvent("Disconnected", a);
Client.GuildAvailable += async (a) => DiscordEvent("GuildAvailable", a);
Client.GuildMembersDownloaded += async (a) => DiscordEvent("GuildMembersDownloaded", a);
Client.GuildMemberUpdated += async (a, b) => DiscordEvent("GuildMembersUpdated", a, b);
Client.GuildUnavailable += async (a) => DiscordEvent("GuildUnavailable", a);
[Command("mandelbrot")]
public async Task Mandelbrot()
{
var maxToRun = 40;
var frames = 3600;
var path = @"C:\RenderingTemp\";
var colors = Enumerable.Range(0, maxToRun + 1).Select(i => Paint.Lerp(Paint.White, Paint.Black, i / (float)maxToRun)).ToArray();
if (Directory.Exists(path)) { try { Directory.Delete(path, true); } catch { } }
Directory.CreateDirectory(path);
using System.Drawing;
using ComputeSharp;
using Windows.Devices.SmartCards;
namespace EDStatistics_Core
{
public readonly struct HeatmapImageGenerationShader : IComputeShader
{
public readonly ReadWriteBuffer<int> density;
public readonly ReadWriteBuffer<int> image;