Skip to content

Instantly share code, notes, and snippets.

View tioover's full-sized avatar

ACCOUNT MOVED tioover

View GitHub Profile
enum State {
Static,
Queue (Vec<State>),
Paral (Vec<State>),
Loop (i64, Box<State>, Box<State>),
Func (Rc<Box<StateFn>>, Timer),
}
struct Sprite {
image: Image,
transform: Transform,
pixel_factor: Color,
state: State,
}
fn curve(ms: Ms, p: [Vec2<f32>; 4]) -> State {
time_func(Timer::new(ms), box move |sprite, timer| -> Option<State> {
// Cubic Bézier curves
use num::Float;
if timer.is_out() { return Some (Static) }
let t = timer.ratio();
let r = 1.0 - t;
class People:
def __add__(other: People):
pass
a = People()
b = People()
a + b # 社会秩序乱了!
class Noble:
use std::ops::DerefMut;
use std::ops::Deref;
#[derive(Show)]
struct List<T> {
car: T,
cdr: Option<Box<List<T>>>,
}
use std::boxed::Box;
struct X;
struct A {x: Option<Box<X>>}
fn main() {
let mut a = Box::new(A{x: Some(Box::new(X))});
let mut b = &mut a;
let mut c = b.x.take();
use std::ops::DerefMut;
use std::ops::Deref;
#[derive(Show)]
struct List<T> {
car: T,
cdr: Option<Box<List<T>>>,
}
use std::ops::DerefMut;
use std::ops::Deref;
struct List<T> {
car: T,
cdr: Option<Box<List<T>>>,
}
fn main() {
use std::ops::DerefMut;
use std::ops::Deref;
struct List<T> {
car: Option<T>,
cdr: Option<Box<List<T>>>,
}
fn main() {
struct List<T> {
car: T,
cdr: Option<Box<List<T>>>,
}
fn main() {
let mut a =
List {