Skip to content

Instantly share code, notes, and snippets.

View drbawb's full-sized avatar

Robbie Straw drbawb

View GitHub Profile
use std::f64;
static TILE_SIZE: i32 = 32;
pub struct Game(f64);
pub struct Pixel(i32);
pub struct Tile(uint);
pub struct Frame(uint);
pub trait AsGame {fn to_game(&self) -> Game;}
@drbawb
drbawb / main.rs
Last active August 29, 2015 13:56
pub mod units;
/// A main() outside the module does not work, #to_pixel() not in scope?
fn main() {
let mut gs: units::Game = units::Game(640.0) * units::Game(480.0);
println!("gs->pix, outside mod: {:?}", gs.to_pixel());
}
use std::f64;
static TILE_SIZE: i32 = 32;
pub struct Game(f64);
pub struct Pixel(i32);
pub struct Tile(uint);
pub struct Frame(uint);
trait AsGame {fn to_game(&self) -> Game;}
--summary--
--KOEO SELF TEST--
118 O,C Coolant Temp (EdT) Sensor circuit above maximum voitage/ -40 F
113 O,C Air Charge Temp (ACT) Sensor circuit above maximum voltagE/ -40 F
327 O,R,C EVP circuit below minimum voltage
--CONTINUOUS MEMORY--
113 O,C Air Charge Temp (ACT) Sensor circuit above maximum voltagE/ -40 F
118 O,C Coolant Temp (EdT) Sensor circuit above maximum voitage/ -40 F
157 C Mass Air Flow (MAE) Sensor circuit below minimum voltage
158 O,C Mass Air Flow (MAE) Sensor circuit above maximum voltage
@drbawb
drbawb / bark.rs
Created April 1, 2013 21:52
Iterating over Traits causes segfault on Linux! (rust 0.6)
extern mod std;
struct Dog {
name : ~str
}
trait Barks {
fn bark(&self) -> ~str;
}
@drbawb
drbawb / main.rs
Created March 29, 2013 15:35
rust snippet -- playing w/ MutexARC
extern mod std;
use core::io::*;
use std::timer::*;
struct Dog {
mut name : ~str
}
fn lol() -> int {