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 / 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 / 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 / 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 / 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 / mult.elm
Created August 2, 2014 22:08
define multiplication over lists
sum [2,3,4]
product [2,3,4]
@mango314
mango314 / 1-helloworld.hs
Last active August 29, 2015 14:07
Having understood categories and monads, we give you...
-- http://hackage.haskell.org/package/pipes-text-0.0.0.12/docs/Pipes-Text-IO.html
-- http://hackage.haskell.org/package/pipes
-- http://hackage.haskell.org/package/pipes-text
import Pipes
import qualified Pipes.Text as Text
import qualified Pipes.Text.IO as Text
import System.IO
-- http://stackoverflow.com/questions/19521246/what-does-mean-do-in-haskell
@mango314
mango314 / command.sh
Created October 21, 2014 21:11
turning websites into Haskell
wget -O http://jaspervdj.be/blaze | blaze-from-html -v html4-transitional
#OR
curl -S http://jaspervdj.be/blaze | blaze-from-html -v html4-transitional
-- variant of tutorial
-- type "./notes" in terminal
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad (forM_)
import Text.Blaze.Html5
import Text.Blaze.Html5.Attributes
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
@mango314
mango314 / 2048.html
Last active August 29, 2015 14:10
2048 clone - progress report
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<svg id="board" width=500 height=500></svg>
@mango314
mango314 / abc.md
Last active August 29, 2015 14:11

$$ \int $$

x = − b