arimaa_engine/macros.rs
1#[macro_export]
2macro_rules! take_actions {
3 ($($action: expr),* $(,)?) => {{
4 take_actions![GameState::initial() => $($action),*]
5 }};
6 ($game_state: expr => $($action: expr),*) => {{
7 let mut game_state = $game_state;
8 $({
9 let action = <$crate::Action as std::str::FromStr>::from_str(stringify!($action)).unwrap();
10 game_state = game_state.take_action(&action);
11 })*
12 game_state
13 }};
14}