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
( brute force ngaro assembler ) | |
chain: ming' | |
: nop, 0 , ; immediate | |
: drop, 3 , ; immediate | |
: pop, 6 , ; immediate | |
: ;, 9 , ; immediate | |
: !jump, 12 , ; immediate |
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
( Simple Hex Dump ) | |
needs bad' | |
needs console' | |
8 constant (dump-width) | |
: putxt xt->d d->name puts ; | |
: hexabyte ( "hexes a byte" ) | |
dup 10 < |
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
! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ |
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
#![feature(tuple_indexing)] | |
use std::default::Default; | |
const WORKS_CONST: uint = 23 ; | |
const ALSO_WORKS_CONST: uint = WORKS_CONST + 5 ; | |
struct Wrapper(uint); | |
const WRAPPED_CONST: Wrapper = Wrapper(42) ; | |
const BAD_CONST: uint = WRAPPED_CONST.0 ; |
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
type Cell = u32 ; | |
type Kilo = u32 ; | |
fn main() { | |
let x: Cell = 5 ; | |
let y: Kilo = 10 ; | |
let z = x + y ; | |
println!("Cell is {}, Kilo is {}, Nonsense is {}", x, y, z); | |
} |
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
use std::fmt; | |
const FORMATTER: &'static str = "{}" ; | |
fn main() { | |
let x = 5i; | |
println! (FORMATTER, x); | |
} |
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
function advise (adviceFn, ogFn) | |
return function (...) adviceFn(unpack(arg)) ogFn(unpack(arg)) end | |
end | |
function foo (x) | |
print ("foo") | |
print (x) | |
end |
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
package main | |
import "fmt" | |
import "github.com/pointlander/peg" | |
type pegger peg.Peg { | |
fmt.Printf("hi") | |
} | |
func main() { |
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
// now a function, also, can draw to any picture not just currentpicture | |
void drawgoban(picture pic=currentpicture, int gobansize, int gobanlines=19) { | |
int gobancounter=gobanlines + 1; | |
unitsize(pic,gobansize/(gobancounter+1)); | |
//Bounding Box and background | |
filldraw(pic,box((0,0),(gobancounter,gobancounter)),white,white); |
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
<html> | |
<head> | |
<script type="application/javascript"> | |
function draw() { | |
var canvas = document.getElementById('canvas'); | |
if (canvas.getContext) { | |
var ctx = canvas.getContext("2d"); | |
var canvasWidth = parseInt(canvas.getAttribute("width")); | |
var canvasHeight = parseInt(canvas.getAttribute("height")); | |
var rds = canvasWidth/4; |
OlderNewer