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

Add Hanoi benchmark #265

Merged
merged 3 commits into from
Aug 30, 2023
Merged

Add Hanoi benchmark #265

merged 3 commits into from
Aug 30, 2023

Conversation

bcarlet
Copy link
Contributor

@bcarlet bcarlet commented Aug 30, 2023

No description provided.

Copy link
Owner

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

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

Looks good! If you're interested, I have one minor/unimportant suggestion about leaving the inputs as parameters.

Comment on lines 21 to 24
disk: int = const 2;
src: int = const 0;
dst: int = const 2;
spare: int = const 1;
Copy link
Owner

Choose a reason for hiding this comment

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

FWIW, if you're interested, you could pass these as parameters from the test harness instead of hard-coding them in @main. That would (hypothetically) make it easier to run the benchmark on different inputs. Here's an example:

# ARGS: 407
@main(input : int) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to take the number of disks as a parameter. The other constants are more or less baked in to the design of the game, so I left those hard coded.

@sampsyo
Copy link
Owner

sampsyo commented Aug 30, 2023

Looks perfect; thanks.

@sampsyo sampsyo merged commit e2c821f into sampsyo:main Aug 30, 2023
5 checks passed
@bcarlet bcarlet deleted the hanoi branch August 30, 2023 16:07
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