Skip to content

Instantly share code, notes, and snippets.

View JohnEarnest's full-sized avatar

John Earnest JohnEarnest

View GitHub Profile
@JohnEarnest
JohnEarnest / Adventure.logo
Created December 22, 2013 02:43
A text adventure game framework written in Loko-compatible Logo.
@JohnEarnest
JohnEarnest / Eliza.logo
Created December 8, 2013 15:39
A very simple ELIZA-style psychotherapist program written in Loko-compatible Logo.
@JohnEarnest
JohnEarnest / euler.factor
Created June 19, 2013 00:31
Solving some Project Euler problems to become more familiar with factor. This is pretty old, but I thought it'd be worth stashing here for safekeeping.
USING:
kernel
sequences
sequences.deep
math
math.functions
math.order
math.ranges
math.primes
math.primes.factors
@JohnEarnest
JohnEarnest / LCD.fs
Created June 11, 2013 22:26
A FlashForth program for the PICDEM Explorer board which interfaces with the LCD Module.
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\ LCD Driver
\
\ This project uses FlashForth to write text
\ to the LCD display on the Microchip PICDEM
\ PIC18 Explorer Demo Board, running on a
\ PIC18F8722 microcontroller.
\
\ John Earnest
\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
@JohnEarnest
JohnEarnest / gist:5617525
Created May 21, 2013 04:42
A tiny HTTP server written in Java. Requests for resources will serve them up, while requests to a raw directory will execute a shell script named to correspond to the request method, such as "GET". URL arguments are decoded and made available to the shell script as environment variables, making basic dynamic content and form processing possible.
import java.util.*;
import java.net.*;
import java.io.*;
public class Web {
public static void main(String[] args) throws Exception {
ServerSocket server = new ServerSocket(10101);
while(true) {
Socket s = server.accept();
@JohnEarnest
JohnEarnest / Garbage.fs
Created January 13, 2013 03:21
A compact, simple implementation of a garbage-collected cons-pair heap utilizing Cheney's algorithm.
\
\ Garbage.fs
\
\ A compact, simple implementation of a garbage-collected
\ cons-pair heap utilizing Cheney's algorithm.
\ Pointers to pairs are identified by a pattern in the
\ high-order bits of a value, chosen not to collide
\ with the constants "true" or "false".
\
@JohnEarnest
JohnEarnest / Stop.java
Created January 8, 2013 01:19
A prototype game exploring the idea of a bullet hell space-shooter in which the player takes an entirely defensive role and must protect others in addition to themselves.
/**
* Stop
*
* A prototype game exploring the idea of a
* bullet hell space-shooter in which the
* player takes an entirely defensive role
* and must protect others in addition to
* themselves.
*
* Known issues/ things to ponder: