Skip to content

Instantly share code, notes, and snippets.

View tommyettinger's full-sized avatar
⚙️
Keeping the commit streak alive

Tommy Ettinger tommyettinger

⚙️
Keeping the commit streak alive
View GitHub Profile
@tommyettinger
tommyettinger / Serpent_Dungeon_Map.txt
Created July 24, 2020 02:09
SerpentMapGenerator output
┌─────────────────────────────────────┐ ┌───────┐ ┌───────────────┐
│ . . . . . . . . . . . . . . . . . . └─┐ │ . . . │ │ . . . . . . . │
┌───┐ │ . . . . . . . . . . . . . . . . . . . ├───┐ │ . . . │ └─┐ . . . . . ┌─┘
┌─┘ . └─┐ └───┬───. . . . . . . . . . . . . . . . │ . └─┐ │ . . . │ │ . . . . . │
│ . . . └─┐ ┌───────────────┐ │ . . . . . . . . . ──────. . . . . . . . └─┐ │ . . . │ ┌───┼─┐ . . . ┌─┘
│ . . . . │ │ . . . . . . . │ │ . . . . . . . . . . . . . . . . . . . . . │ │ . . . └─┘ . └─┴─┐ . ┌─┘
│ . . . . └───────┐ │ . . . . . . . ├───┘ . . . . . . . . . ┌───┐ . . . . . . . . ┌─┘ │ . . . . . . . . │ . │
├───. . . . . . . └─┐ │ .
@tommyettinger
tommyettinger / LessOpenedMaze.txt
Last active June 25, 2020 06:07
Output of an arena-type map generator, with info below each map
Less Opened Maze Generator
┌───────────────────┬───────┐
│...................│.......│
│.................┌─┘.│.┌──.│
│.....│...........│...│.│...│
├─..┌─┴───┐...│.┌─..┌─┘.│.──┤
│...│.....│...│.│...│...│...│
│...│.┌─..└──.│.│.│.└──.├──.│
│...│.│.......│.│.│.....│...│
│..─┤.├──....─┴─┘.└──...│.│.│
@tommyettinger
tommyettinger / LanguageOutput.txt
Created February 20, 2020 01:45
Output of FakeLanguageGen from SquidLib
Imitating language: "Lovecraft":
Ku ushku urk tachtal ith zvra...
Hmaanga teik ekhel oguts ape irk.
Ekhi; thi is ialaagh ogiltaats gleputs?
Aagrets nen nyeigh yeltaa!
Aarl ta; aha'at, sain zvrirkai-aikhug lia'aas!
Sol gukh emraats nyamre-op uxo tark fto.
Ux opits uvru as, en'yeh, pe-ialteish piakre.
@tommyettinger
tommyettinger / FloatArray_1_Before.java
Created February 14, 2020 21:47
libGDX's FloatArray before and after running libGDX's Eclipse formatter on it, in IntelliJ.
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tommyettinger
tommyettinger / FOV.java
Created September 12, 2019 05:59
Stripped-down version of Jagd's Field of View class
import java.util.Arrays;
/**
* This class provides methods for calculating Field of View in grids. Field of
* View (FOV) algorithms determine how much area surrounding a point can be
* seen. They return a two dimensional array of doubles, representing the amount
* of view (almost always sight) which the origin has of each cell.
* <br>
* The input resistanceMap is considered the percent of opacity. This resistance
* is on top of the resistance applied from the light spreading out. You can
@tommyettinger
tommyettinger / dungeon1000x1000.txt
Created August 5, 2019 19:34
1000x1000 DUNGEON
This file has been truncated, but you can view the full file.
┌────┐┌──┐┌──────┐ ┌──┐ ┌───────┐┌─────┬───┐ ┌────────┐ ┌──┐ ┌──────────┐ ┌──┐ ┌──────┬─────┐┌──┐ ┌──┐ ┌─────┐ ┌──┐ ┌──┐ ┌──┐┌──────┐ ┌──────┬─────┐┌──┐ ┌──┐ ┌────────┬───────┐ ┌──────┐ ┌────────┐┌──────┐ ┌──┐ ┌──────┐ ┌──┐ ┌──────────┐ ┌──┬─────┐ ┌──┐ ┌─────┐ ┌─────┐ ┌────────┐┌───────────┐┌─────┐ ┌────┬──┐┌────────┐ ┌──────┬─────────┐ ┌───┬───┐┌──┬─────┐ ┌──────┬─────────┐ ┌────────┐ ┌─────┐ ┌───────────┬─────┐ ┌─────┬──┐┌──────┐ ┌───────┬─────┬───┐ ┌─────┐ ┌───┐ ┌──────────────────┐ ┌──┐ ┌──┐ ┌──┐ ┌──────────┐ ┌────────┐ ┌────┐ ┌──┐ ┌──┐ ┌────────┐ ┌───┐ ┌───────────┬─────┐ ┌─────┐ ┌────────┐ ┌──────┐ ┌──┐ ┌─────┬──┐┌────────┐┌────┐ ┌──────┐┌────────┐┌────────┐ ┌──────┐ ┌──┐ ┌──┐ ┌──┐ ┌──────┐ ┌──┐ ┌───┐ ┌─────┐ ┌──┐ ┌────┬────┐ ┌───┬─────┐ ┌─────┐┌─────┬────────────┬───┬─────┐┌──────┐
│....└┘..││......└───
@tommyettinger
tommyettinger / MutantBatch.java
Created July 24, 2019 19:05
SpriteBatch that acts like 1.9.8's version but is compatible with 1.9.9 and 1.9.10
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttribute;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
@tommyettinger
tommyettinger / warm-mild.frag.glsl
Created April 25, 2019 09:08
Fragment Shader for YCwCm warm-and-mild color tweaks
// this is a libGDX ShaderBatch fragment shader; it may need some tweaks to fit in other frameworks.
// You can use this to desaturate colors by setting `u_mul` to `vec3(1.0, 0.5, 0.5)` or any other small fractions for Cw and Cm. You
// can make colors warmer by setting `u_add` to `vec3(0.0, 0.6, 0.0)`; while warmth is added, randomly setting the added Cm to a
// value between -0.5 and 0.5 can simulate a fiery color effect over the screen. You can make an icy effect by setting `u_add` to
// `vec3(0.3, -0.4, 0.0)`. You can simulate the desaturation and yellowing that happens to old paintings by setting `u_mul` to
// `vec3(0.9, 0.7, 0.75)` and `u_add` to `vec3(0.05, 0.14, 0.16)`. Many other effects are possible by changing warmth and/or mild over
// multiple frames, usually smoothly and usually applying the change to the additive uniform.
varying vec2 v_texCoords;
varying vec4 v_color;
@tommyettinger
tommyettinger / DawnBringer_Aurora.hex
Created December 4, 2018 01:47
DawnBringer Aurora .hex palette, 256 colors
000000
111111
222222
333333
444444
555555
666666
777777
888888
999999
@tommyettinger
tommyettinger / Linnorm.java
Created May 16, 2018 20:48
Linnorm benchmarks
public final class Linnorm {
private static long state = 0L;
private static long random()
{
long z = (state = state * 0x41C64E6DL + 1L);
z = (z ^ z >>> 28) * 0xAEF17502108EF2D9L;
return z ^ z >>> 30;
}
public static void main(String[] args) {
long out = 0L;