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 / Random-Game-Ideas.txt
Last active October 23, 2022 13:03
Randomly generated indie game ideas
This random game idea generator was a collaboration between David O'Toole (dto)
and myself (Tommy Ettinger). The generator is a Clojure program that is available
to fork and tweak at http://ideone.com/0MG8ED .
@tommyettinger
tommyettinger / diff.clj
Last active August 29, 2015 14:06 — forked from dagda1/diff.clj
(defn diff [l1 l2]
(let [a (group-by identity l1)
b (group-by identity l2)]
(mapcat #(repeat
(-
(count (second %))
(count (get b (key %))))
(key %))
a)))
@tommyettinger
tommyettinger / core.clj
Last active August 29, 2015 14:06
Working Simplex Noise shader with play-clj
(ns pixmappery.core
(:require [play-clj.core :refer :all]
[play-clj.entities :as e]
[play-clj.g2d :refer :all]
[play-clj.ui :refer :all])
(:import [com.badlogic.gdx.graphics.g2d Batch SpriteBatch]
[com.badlogic.gdx.graphics.glutils ShaderProgram]))
(defn vert [] "attribute vec4 a_position;
attribute vec4 a_color;
@tommyettinger
tommyettinger / main.clj
Created October 20, 2014 09:24
Clj-Ebay with at-at
(ns clj-ebay.main
(:require [overtone.at-at :as schedule]
[clj-ebay.core]
[clj-ebay.finding :as finder])
(:gen-class))
(def my-pool (schedule/mk-pool))
(defn search-from-ebay
"comment"
[searched-key max-price]
(let [result (finder/find-items-advanced {:entries-per-page "1",
@tommyettinger
tommyettinger / AndroidMiniFormatter.java
Created February 24, 2015 01:43
MiniFormatter: formats some printf-style format strings on GWT
public class AndroidMiniFormatter implements MiniFormatter {
public static String format(final String formatString, final Object... args) {
return String.format(formatString, args);
}
}
1
stack: [1] //data, integer 1
1 +
stack: [(+ 1 _)] //curried function that will await an argument and add 1 to it
1 + 2
stack: [3] //argument has been supplied to an awaiting function, function is evaluated
//with full set of args
1 + 2 *
stack: [(* 3 _)] //another curried function that will await an argument and multiply it by 3
1 + 2 * [#
@tommyettinger
tommyettinger / dungeon.txt
Created October 29, 2015 05:54
Big Dungeon.
┌───────────────┐
┌─┘ . . . . . . . └─┐
┌───┬───┐ ┌─────┐ ┌───┐ ┌─────┐ │ . . . . . . . . . │
┌───────┘ ~ │ . └─┬─┘ . . └─┐ ┌───────────┘ . └─────┘ . . └───┐ │ . . . . . . . . . │
┌─┘ ~ ~ ~ ~ ~ , . . │ . .
@tommyettinger
tommyettinger / dungeon.txt
Last active October 29, 2015 06:41
More Dungeon.
┌───────────────────────────┐
┌─┘ . . . . . . . . . . ^ . . └─┐ ┌───┐ ┌─────────────────┐
│ . . . . . . . . . . . . . . . │ ┌───────┘ . └───────┐ │ . . . . . . . . │
└─┐ . . . . . . . . . ^ . . . ┌─┘ ┌─┘ . . . . . . . . . └─┐ │ . . . . . . . . │
@tommyettinger
tommyettinger / layer-dungeon.txt
Created November 3, 2015 07:13
Multi-Layer Dungeon
┌───────┬───────────────────────┐ ┌───────────────────────┐
┌─┘ . . . │ . . . . . . . . . . . └─┐ │ . . . . > . . . . . . │
│ . . . . . . . . . . . . . . . . . └─┐ │ . . . . . . . . . . . │
│ . . . . . . . . . . . . . . . . . > │ │ . . . . . . . . . . . │