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-05-31 15:17:22 -07:00
|
|
|
impl Wizard {
|
|
|
|
pub fn cast(&mut self) {
|
2013-08-01 03:16:42 -04:00
|
|
|
foreach &spell in self.spells.iter() {
|
2013-05-24 19:35:29 -07:00
|
|
|
println(spell);
|
2013-01-23 18:15:06 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
}
|