blob: 2cc75e1ec3c82aaebeecfb1644081692832e4add (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class cat {
priv {
let mut meows : uint;
fn nap() { uint::range(1u, 10u) {|_i|}}
}
let how_hungry : int;
fn play() {
meows += 1u;
nap();
}
new(in_x : uint, in_y : int) { meows = in_x; how_hungry = in_y; }
}
fn main() {
let nyan : cat = cat(52u, 99);
nyan.play();
}
|