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-05-31 17:17:22 -05:00
|
|
|
impl Wizard {
|
|
|
|
pub fn cast(&mut self) {
|
2013-08-03 11:45:23 -05:00
|
|
|
for &spell in self.spells.iter() {
|
2013-05-24 21:35:29 -05:00
|
|
|
println(spell);
|
2013-01-23 20:15:06 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
}
|