Skip to content

Instantly share code, notes, and snippets.

View mango314's full-sized avatar
💭
https://retrocomputing.stackexchange.com/questions/tagged/6502

JM mango314

💭
https://retrocomputing.stackexchange.com/questions/tagged/6502
View GitHub Profile
@mango314
mango314 / items.elm
Created July 31, 2014 18:12
mixing Signals and other things
f x y = [x] ++ y
--<function> : a -> [a] -> [a]
g y = (\x -> f x y)
--<function> : [a] -> a -> [a]
items = [1,2,3]
--[1,2,3] : [number]
g items
--<function> : number -> [number]
g items 5
@mango314
mango314 / rubik.elm
Created July 29, 2014 19:31
rubik's cube
main : Element
main = cube
cube = flow down [ row1, row2, row3, row4 ]
row1 = flow right [
color grey (container 30 30 middle (plainText "A"))
, color grey (container 30 30 middle (plainText ""))
@mango314
mango314 / rubik.elm
Last active August 29, 2015 14:04
rubik's cube
main : Element
main = cube
cube = flow down tiles
f x = color grey (container 30 30 middle (plainText x))
g x = flow right (map f x)
tiles = map g
@mango314
mango314 / eval.elm
Last active August 29, 2015 14:04
fancy stuff with eval
f1 z = z + 1
f2 z = z + 2
f3 z = z + 3
f4 z = z + 4
g f = f 1
-- g f1 = 2
[f1 1, f2 1, f3 1, f4 1]
-- [2,3,4,5] : [number]
@mango314
mango314 / hilbert.elm
Last active October 30, 2015 07:55
hilbert space filling curve
main : Element
main = collage 400 400
(map (move (50, 0) )(
(motif x red ) ++ (motif (t x) blue ) ++ (motif (t (t x)) green ) ++
(motif (t (t (t x))) orange ) ))
-- build motif from path and color
motif : [(number, number)] -> Color -> [Form]
motif z color = [ traced (solid color) (path z) , move ( last z) (filled color (circle 3.0))]
@mango314
mango314 / main.elm
Created July 25, 2014 00:23
error message with tab
main : Element
main = flow down
[ leftAligned (toText "A")
, leftAligned (toText "B")
, leftAligned (toText "C")
]

Voronoi Tesselation

Move your mouse around

Voronoi Tesselation

Move your mouse around

@mango314
mango314 / readme.md
Last active August 29, 2015 14:02
how to do screencasts on ubuntu
@mango314
mango314 / colors.py
Created May 14, 2014 00:51
grab K=10 colors off image
from skimage import io
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['figure.figsize'] = 6,6
im = io.imread("filename.jpg")
#crop
piece = im[1250:2250, 1250:2250,:]