Skip to content

Instantly share code, notes, and snippets.

View nulldatamap's full-sized avatar

Nulldata nulldatamap

View GitHub Profile
#Importere vaerktoejer
from Tkinter import *
import time
#Tiden
startTime = 0 # predefine for later use
endTime = 0
deltaTime = 0
#Importere vaerktoejer
from Tkinter import *
import time
#Tiden
startTime = 0 # predefine for later use
endTime = 0
deltaTime = 0
def spawn_button():
// main.rs
// ...
mod A;
// ...
// A/mod.rs
// ...
$ rustc --target=arm-unknown-linux-gnueabihf main.rs -C linker=arm-linux-gnueabihf-g++ -C "llvm-args=-mcpu=arm1176jzf-s"
rustc: Unknown command line argument '-mcpu=arm1176jzf-s'. Try: 'rustc -help'
rustc: Did you mean '-debug=arm1176jzf-s'?
// game.rs
extern crate rand;
use self::rand::Rng;
use std::io;
// Used for easily modifiable rules
pub struct GameRules {
// Deck rules
maxDeckSize : int,
minDeckSize : int,
def macro( f ):
f.__macro__ = True
return f
def lisp( prg ):
if type( prg ) != tuple:
return prg
f = prg[0]
if hasattr( f, "__macro__" ):
return f( *prg[1:] )
// Peek returns Option<char>
match chars.peek() {
Some( '(' ) => parseExpression(),
Some( 'a'..'z' | 'A'..'Z' | '_' ) => parseName(),
None => break // Break the loop and return from the parser
}
/*
Syntax (whitespace is ignored):
expr := '(' name (expr|val)* ')'
val := symbol|int|bool|string|list|name
symbol := ':' name
int := 0..9+
bool := 'true'|'false'
string := '"' (escape|char)* '"'
escape := '\\'|'\n'|'\t'|'\"'
// control.proto
package protocols;
option java_package = "io.nulldata.protocols";
option java_outer_classname = "ControlProtos";
message Handshake {
optional int32 magic = 1; [default = D0961]
optional int32 version = 2; [default = 0]
optional string token = 3;
doTypecheck = True
def typecheck( f ):
def wrapper( *args ):
global doTypecheck
if doTypecheck:
sig = signature( f )
for k, p in zip( args, sig.parameters.keys() ):
pv = sig.parameters[p]
if type( k ) != pv and not isinstance( k, pv ):