This file contains 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
--- dcpu16.txt 2012-04-26 13:57:37.477152465 +0200 | |
+++ dcpu16_1_5.txt 2012-04-26 13:57:12.209965926 +0200 | |
@@ -1,6 +1,6 @@ | |
DCPU-16 Specification | |
Copyright 1985 Mojang | |
-Version 1.4 | |
+Version 1.5 | |
This file contains 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
:begin | |
set A, foo | |
set B, foo | |
add B, 2 | |
set C, 0x8000 | |
jsr upack | |
jsr makevisible | |
:end sub PC, 1 |
This file contains 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
my best solution so far: changing the updateTransformation function to take the transformation as an argument and then change the variable... something like updateTransformation({'rotate':-0.05}); | |
function getTransformerCallback(delta) { | |
return function() { | |
delta.rotate && (rotate += delta.rotate) | |
delta.translateX && (translateX += delta.translateX) | |
delta.translateY && (translateY += delta.translateY) | |
updateTransformation() | |
} |
This file contains 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
/** | |
* Applies a set of named arguments to a `func`. | |
* | |
* Example: var f = function(x, y, z) { return x * (y - z); }; | |
* namedApply(f, {x: 1, y: 2, z: 3}); | |
* | |
* @param func {Function} A function to invoke. | |
* @param args {Object} A collection of named arguments. | |
* @return {Function} A new function with partially applied named arguments. | |
*/ |
This file contains 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 Talkable = { | |
talk: function(){ | |
return this.name + ': ' + this.speech() | |
} | |
} | |
var Animal = Object |> { | |
trait Talkable, | |
name: 'Animal', |
This file contains 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
vinyls = [ | |
record: | |
name: "The best" | |
year: 2005 | |
, | |
record: | |
name: "OK, The Best For Real" | |
year: 2010 | |
] |
NewerOlder