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