Skip to content

Commit

Permalink
Add Solvable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenyangMao committed Nov 18, 2023
1 parent 5600812 commit d576c31
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/games/crossteaser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,18 @@ implement! { for Session =>

impl Solvable<1> for Session {
fn weights(&self) -> SMatrix<Utility, 1, 1> {
todo!()
SMatrix::<Utility, 1, 1>::identity()
}

fn utility(&self, state: State) -> Option<SVector<Utility, 1>> {
todo!()
if !self.accepts(state) {

This comment has been minimized.

Copy link
@maxfierrog

maxfierrog Nov 18, 2023

Member

Nitpick: Unnecessary negation on conditional.

if self.accepts(state) {
    Some(SVector::<Utility, 1>::from_element(1))
} else {
    None
}
None
} else {
Some(SVector::<Utility, 1>::from_element(1))
}
}

fn coalesce(&self, state: State) -> SVector<Utility, 1> {
todo!()
SVector::<Utility, 1>::from_element(1)
}
}

1 comment on commit d576c31

@maxfierrog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, thank you Mia!

Please sign in to comment.