Skip to content

Commit

Permalink
Add {left,right}_moves in python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
t4ccer committed Nov 5, 2023
1 parent be10498 commit 6446b79
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cgt-py/src/domineering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,20 @@ impl PyDomineering {
),
}
}

fn left_moves(&self) -> Vec<Self> {
self.inner
.left_moves()
.into_iter()
.map(Self::from)
.collect()
}

fn right_moves(&self) -> Vec<Self> {
self.inner
.right_moves()
.into_iter()
.map(Self::from)
.collect()
}
}
16 changes: 16 additions & 0 deletions cgt-py/src/ski_jumps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,20 @@ impl PySkiJumps {
),
}
}

fn left_moves(&self) -> Vec<Self> {
self.inner
.left_moves()
.into_iter()
.map(Self::from)
.collect()
}

fn right_moves(&self) -> Vec<Self> {
self.inner
.right_moves()
.into_iter()
.map(Self::from)
.collect()
}
}

0 comments on commit 6446b79

Please sign in to comment.