Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust Rewrite #298

Merged

Conversation

zarns
Copy link
Contributor

@zarns zarns commented Dec 28, 2024

This is still a work in progress, I'm learning Rust as I go. I'll try and push to this branch as I make progress on the TODOs.

Copy link
Owner

@bcollazo bcollazo left a comment

Choose a reason for hiding this comment

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

Woah! This looks great. Thanks @zarns for the amazing progress here. Taking!

Comment on lines +365 to +384
#[test]
fn test_longest_acyclic_path() {
let mut state = State::new_base();
let color = 0;

state.roads.insert((0, 1), color);
state.roads.insert((1, 2), color);
state.roads.insert((2, 3), color);
state.roads.insert((3, 4), color);
state.roads.insert((4, 5), color);
state.roads.insert((0, 5), color);
state.roads.insert((0, 20), color);
state.roads.insert((20, 19), color);
state.roads.insert((20, 22), color);
state.roads.insert((22, 23), color);
state.roads.insert((6, 23), color);

let all_nodes = HashSet::from([0, 1, 2, 3, 4, 5, 19, 20, 22, 23, 6]);
let path = state.longest_acyclic_path(&all_nodes, color);
assert_eq!(path.len(), 10);
Copy link
Owner

Choose a reason for hiding this comment

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

Woah, very nice test! 💪

@bcollazo bcollazo merged commit 6cc44c1 into bcollazo:feature/catanatron-rust Jan 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants