This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns overtone-tutorial.second-song | |
(:use overtone.live | |
overtone.inst.drum)) | |
(def metro (metronome 120)) | |
(definst saw-wave [freq 440 attack 0.01 sustain 0.4 release 0.1 vol 0.4] | |
(* (env-gen (lin-env attack sustain release) 1 1 0 1 FREE) | |
(saw freq) | |
vol)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var port = process.env.PORT || 5000; | |
var app = express(); | |
app.use(express.logger()); | |
app.get('/', function (req, res) { | |
res.send("Hello world, from Java`Script."); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn wilson-maze | |
"Returns a random maze carved out of walls; walls is a set of | |
two-item sets, #{a b}, where a and b are locations. The returned | |
maze is a set of the remaining walls." | |
[walls] | |
(let [paths (reduce | |
(fn [index [a b]] (merge-with into index {a [b] b [a]})) | |
{} (map seq walls)) | |
start-loc (rand-nth (keys paths))] | |
(loop [walls walls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; An exploration into Conway's Game of Life, in Clojure. | |
; Based on the work of Chas Emerick, Brian Carper and Christophe Grand, in the book | |
; _Clojure Programming_. | |
; | |
; There are three implementations of the stepping function here: | |
; - indexed-step, which handles the algorithm much like I have in other languages. | |
; - indexed-functional-step, which removes the loops and instead operates with reduces | |
; - functional-step, a method that removes the need for indexes by using the properties of sequences | |
; - pure-step, an elegant and tiny redesign of the idea. | |
(defn empty-board |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testml = require("../lib/testml") | |
class TestMLBridge | |
uppercase: (s) -> | |
s.to-upper-case! | |
lowercase: (s) -> | |
s.to-lower-case! | |
combine: (...args) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!env lsc | |
global <<< require \prelude-ls | |
cmd-line-args = drop 2, process.argv | |
console.log cmd-line-args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conway's Game of Life, in LiveScript | |
# ==================================== | |
# | |
# Conway's Game of Life is a cellular automaton, published by John H Conway | |
# in 1970, fulfilling the design principles but greatly simplifying the | |
# research of von Neumann, into a hypothetical machine that could build | |
# copies of itself. It is a zero-player game, meaning there is no input, and | |
# the game will progress on its own with a 'seed', or configuration, to | |
# begin with. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sevvie@Prudence - ~/Downloads % ping guildwars2.com [0] | |
PING guildwars2.com (64.25.40.16): 56 data bytes | |
64 bytes from 64.25.40.16: icmp_seq=0 ttl=112 time=136.137 ms | |
64 bytes from 64.25.40.16: icmp_seq=0 ttl=112 time=136.543 ms (DUP!) | |
64 bytes from 64.25.40.16: icmp_seq=0 ttl=112 time=136.551 ms (DUP!) | |
64 bytes from 64.25.40.16: icmp_seq=0 ttl=112 time=136.575 ms (DUP!) | |
64 bytes from 64.25.40.16: icmp_seq=1 ttl=112 time=95.445 ms | |
64 bytes from 64.25.40.16: icmp_seq=1 ttl=112 time=95.829 ms (DUP!) | |
64 bytes from 64.25.40.16: icmp_seq=1 ttl=112 time=95.849 ms (DUP!) | |
64 bytes from 64.25.40.16: icmp_seq=1 ttl=112 time=96.232 ms (DUP!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
package Card; | |
sub new { | |
my $type = shift; | |
my $obj = []; | |
my $args = [@_]; | |
if( ref(\$args->[0]) eq 'SCALAR' ) { | |
if( $args->[0] eq 'key' ) { | |
$obj = [$args->[1], $args->[3]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mapgen | |
import "testing" | |
func TestNoiseGenerator(t *testing.T) { | |
prng := new(PerlinNoisePRNG) | |
prng.seed = 1 | |
var e float64 | |
for i := 0.0; i < 64; i++ { | |
for j := 0.0; j < 64; j++ { |