Skip to content

Instantly share code, notes, and snippets.

View Lambdanaut's full-sized avatar
👁️‍🗨️
λ

Joshua Quirk Lambdanaut

👁️‍🗨️
λ
View GitHub Profile
@Lambdanaut
Lambdanaut / Percept.hs
Last active December 11, 2015 14:18
A binary labeling perceptron written in Haskell
module Percept where
-- The example training/testing data has single digit numbers set to True, and double digit numbers set to False
trainingData :: [([Double], Bool)]
testingData :: [([Double], Bool)]
trainingData = [
([1], True),
([5], True),
([6], True),
([9], True),
@Lambdanaut
Lambdanaut / main.py
Created September 8, 2012 22:59
A Text Based RPG that my Nephew is working on.
# Constants
class Player:
def __init__(self):
self.name = "Clinton Bill"
self.room = Family_Den()
self.description = "You are a tall dark and mysterious rogue android hell bent on finding your creator. You are a robotic aparition used for being a butlerbot. "
self.items = [Tophat()]
def view_items(self):
@Lambdanaut
Lambdanaut / Mandelbrot.hs
Created April 29, 2012 16:54
A Mandelbrot Set visualizer in Haskell
module Mandelbrot where
import Graphics.UI.SDL as SDL
import System.Exit
resolution = 30
drawSlowly = True
@Lambdanaut
Lambdanaut / markdown
Created April 21, 2012 18:51
My cheat sheets for the "sheet" Ruby program
url: http://daringfireball.net/projects/markdown/syntax
@Lambdanaut
Lambdanaut / lambdatumblr.html
Created April 19, 2012 16:44
An old tumblr layout I wrote with simplicity in mind.
<html>
<head>
<title>{Title}</title>
<link rel="shortcut icon" href="{Favicon}">
<link rel="alternate" type="application/rss+xml" href="{RSS}">
{block:Description}
<meta name="description" content="{MetaDescription}" />
{/block:Description}
<style>
body {
@Lambdanaut
Lambdanaut / Classify.py
Created April 2, 2012 06:54
A Naive Bayesian Classifier. The Classifier class can be trained by "classifier.train(True,'I am so happy!')" or "classifier.train(False,'I am a sad man. ')". To check if something falls in either the True or the False category.
#! /usr/bin/python2
from __future__ import division
from ignoreWords import *
class Classifier:
def __init__ (self):
self.examples = []
@Lambdanaut
Lambdanaut / index.html
Created March 10, 2012 22:09
A Proof of Concept simulation of a bunch of different types of cells that can connect to make larger organisms. Requires JsGameSoup
<html>
<head>
<script src="jsGameSoup/js/jsgamesoup.js"></script>
<script src="jsGameSoup/js/random.js"></script>
<script src="jsGameSoup/js/sprite.js"></script>
<script src="jsGameSoup/js/collisions.js"></script>
<script src="main.js"></script>
</head>
<style>
html, body {
@Lambdanaut
Lambdanaut / love.py
Created January 20, 2012 19:26
A Genetic Algorithm that I wrote for Catherine K
#! /usr/bin/python
import random
#goal = "This message evolves like my love for you. I'll always love you, Cat. -Josh <3"
goal = "I Love You Cat"
generations = None
popSize = 25
mutation = 150 #Bigger = Less mutation
@Lambdanaut
Lambdanaut / todo.py
Created September 22, 2011 02:45
A tool for managing tasks.
#! /usr/bin/python
import sys, os, pickle
header = "todo.py: A tool for managing tasks\n==================================\n "
def path():
pathname = os.path.dirname(sys.argv[0])
return os.path.abspath(pathname)
@Lambdanaut
Lambdanaut / gist:1209033
Created September 11, 2011 01:07
A Falling Sand game made using Python2 & SDL
#!/usr/bin/python
#An experimental falling(or rising, in this case) sand game coded by Lambdanaut
import pygame, sys, os, random
from pygame.locals import *
if sys.platform == 'win32' or sys.platform == 'win64':
os.environ['SDL_VIDEO_CENTERED'] = '1'
#Init Variables
def popRoom(x,y):
room = []