Skip to content

Instantly share code, notes, and snippets.

View Art's full-sized avatar

Art Scott Art

View GitHub Profile
@CarstenKoenig
CarstenKoenig / lightsOut.py
Last active December 19, 2015 19:28
ligths Out for "Coding the Matrix: Linear Algebra through Computer Science Applications" You need pygame to run this and you have to place this file inside your matrix-folder (where it can find GF2.py and your vec.py) Then you can run it with "python3 ligthOut.py" Mouseclick will switch the ligth according to the rules of the game To exit click …
import pygame
import random
import math
from vec import Vec
from GF2 import *
pygame.init()
screen_width = 600
@lobrien
lobrien / gist:7273287
Last active December 27, 2015 05:19
let GetAsync(url : string, i : int) =
async {
let req = WebRequest.Create(url)
let! rsp = req.AsyncGetResponse()
use stream = (rsp :?> HttpWebResponse).GetResponseStream()
use zip = new GZipStream(stream, CompressionMode.Decompress)
use reader = new StreamReader(zip)
Console.WriteLine("Received page " + i.ToString())
return reader.ReadToEnd()
}
open System
type Cylinder =
| FourFourEight
| SixSixTwelve
| ThreeThreeSix
| TwoTwoTwo
type CylinderMeasurement =
{ WidthA: float
@ninegrid
ninegrid / universe.fs
Last active March 26, 2016 14:03
1D 2-color cellular automata in F#
type cell = A | B
type 'cell U = U of 'cell LazyList * 'cell * LazyList<'cell>
module Universe =
open LazyList
let U left focus right = U (left, focus, right)
let initial () = U (repeat A) B (repeat A)
let shiftRight = fun (U (left,focus,Cons(focus',right))) -> U (cons focus left) focus' right

#r @"E:\Assemblies\OpenTK\OpenTK.dll"
open System
open System.Drawing
open System.Collections.Generic
open OpenTK
open OpenTK.Graphics
open OpenTK.Graphics.OpenGL
@palladin
palladin / gist:c5fca07b74da782832cb
Last active September 25, 2021 17:52
Parallel Streams Test
#time
#r "bin/Release/Streams.Core.dll"
open Nessos.Streams.Core
let data = [|1..10000000|] |> Array.map int64
#r "../../packages/FSharp.Collections.ParallelSeq.1.0/lib/net40/FSharp.Collections.ParallelSeq.dll"

Keybase proof

I hereby claim:

  • I am cure53 on github.
  • I am cure53 (https://keybase.io/cure53) on keybase.
  • I have a public key whose fingerprint is F98B 0EC1 8640 2F60 292C 5877 C26C 8580 90F7 0ADA

To claim this, I am signing this object:

@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active June 15, 2024 22:49
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@mavnn
mavnn / paket.dependencies
Last active August 29, 2015 14:08
stealing
source https://nuget.org/api/v2
nuget FSharp.Formatting
nuget NUnit
nuget NUnit.Runners
nuget Nuget.CommandLine
nuget FAKE
nuget SourceLink.Fake
github fsharp/FAKE modules/Octokit/Octokit.fsx
@hodzanassredin
hodzanassredin / fun3d.fsx
Last active August 29, 2015 14:22
Tower of Hanoi
let countOfDisks = 10
let initialState = [for x in 1..countOfDisks do yield x], List.empty, List.empty
let bottDiskSize = 4.
let cylHeight = 4.0
let diskSize size = size * bottDiskSize / float(countOfDisks)
let diskHeight = cylHeight / float(countOfDisks)
let diskPosition pos = pos * diskHeight
let cyl =