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
Really, my first Gist on GitHub |
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
https://www.youtube.com/watch?v=AoR8p_FGgh8&feature=youtube_gdata_player Nuevo vídeo |
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
http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/es/index.html |
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
/* | |
* bloco_loop.js | |
*/ | |
var lastTemp; | |
var preventLoop=0; | |
var leftCube; | |
var rightCube; | |
var forwardCube; | |
var backwardCube; | |
var lastControls; |
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
#[deriving(FromPrimitive)] | |
enum Instruction { | |
INTEGER = 0x00, | |
STRING = 0x01, | |
ADD = 0x02, | |
SHOWINTEGER = 0x0A, | |
SHOWVERSION = 0x0E, | |
EXITVM = 0x0F | |
} |
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
fn execute(&mut self, execbyte: u8) -> () { | |
if self.push { | |
self.push(execbyte); | |
self.push=false; | |
}else{ | |
let op: Option<Instruction> = FromPrimitive::from_u8(execbyte); | |
match op{ | |
None => { | |
println!("Unknown instruction, skipping..."); | |
}, |
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
#[deriving(FromPrimitive)] | |
enum Instruction { | |
INTEGER = 0x00, | |
STRING = 0x01, | |
ADD = 0x02, | |
SHOWINTEGER = 0x0A, | |
SHOWVERSION = 0x0E, | |
EXITVM = 0x0F | |
} |
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
pub fn interpreter(&mut self,bytecode: &'static str) -> (){ | |
for execbyte in bytecode.chars() { | |
self.execute(execbyte as u8); | |
} | |
} |
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
fn execute(&mut self, execbyte: u8) -> () { | |
if self.push { | |
self.push(execbyte); | |
self.push=false; | |
}else{ | |
let op: Option<Instruction> = FromPrimitive::from_u8(execbyte); | |
match op{ | |
None => { | |
println!("Unknown instruction, skipping..."); | |
}, |
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
fn push(&mut self, value: u8) -> (){ | |
self.stack.push(value); | |
} | |
fn pop(&mut self) -> u8{ | |
let a: Option<u8>=self.stack.pop(); | |
match a{ | |
None => { | |
println!("Failed to pop"); | |
0 | |
}, |
OlderNewer