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
| #Importere vaerktoejer | |
| from Tkinter import * | |
| import time | |
| #Tiden | |
| startTime = 0 # predefine for later use | |
| endTime = 0 | |
| deltaTime = 0 | |
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
| #Importere vaerktoejer | |
| from Tkinter import * | |
| import time | |
| #Tiden | |
| startTime = 0 # predefine for later use | |
| endTime = 0 | |
| deltaTime = 0 | |
| def spawn_button(): |
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
| // main.rs | |
| // ... | |
| mod A; | |
| // ... | |
| // A/mod.rs | |
| // ... |
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
| $ 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'? |
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
| // 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, |
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
| 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:] ) |
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
| // 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 | |
| } |
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
| /* | |
| 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'|'\"' |
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
| // 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; |
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
| 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 ): |