2013-01-23 20:15:06 -06:00
|
|
|
struct Wizard {
|
2013-03-14 13:22:51 -05:00
|
|
|
spells: ~[&'static str]
|
2013-01-23 20:15:06 -06:00
|
|
|
}
|
|
|
|
|
2013-02-26 19:47:41 -06:00
|
|
|
pub impl Wizard {
|
2013-01-23 20:15:06 -06:00
|
|
|
fn cast(&mut self) {
|
|
|
|
for self.spells.each |&spell| {
|
|
|
|
io::println(spell);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2013-01-23 20:15:06 -06:00
|
|
|
let mut harry = Wizard {
|
|
|
|
spells: ~[ "expelliarmus", "expecto patronum", "incendio" ]
|
|
|
|
};
|
|
|
|
harry.cast();
|
|
|
|
}
|