2012-02-09 14:16:12 -08:00
|
|
|
class cat {
|
|
|
|
priv {
|
2012-03-26 18:35:18 -07:00
|
|
|
let mut meows : uint;
|
2012-02-09 14:16:12 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
let how_hungry : int;
|
|
|
|
|
2012-03-28 14:17:41 -07:00
|
|
|
new(in_x : uint, in_y : int) { self.meows = in_x; self.how_hungry = in_y; }
|
2012-02-20 15:42:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let nyan : cat = cat(52u, 99);
|
2012-02-20 17:21:33 -08:00
|
|
|
let kitty = cat(1000u, 2);
|
2012-03-03 17:49:23 -08:00
|
|
|
assert(nyan.how_hungry == 99);
|
|
|
|
assert(kitty.how_hungry == 2);
|
|
|
|
}
|