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 return to the solve() function #1

Closed
AlejandroMonteseirin opened this issue Apr 19, 2019 · 2 comments
Closed

Add return to the solve() function #1

AlejandroMonteseirin opened this issue Apr 19, 2019 · 2 comments

Comments

@AlejandroMonteseirin
Copy link

actually the solve function only prints the results, I workaround this problem by adding

self.solution=self._solution_to_string(n)

to the line before 141 in solve.py to return the last solution

@tcbegley
Copy link
Owner

Good suggestion. I've only ever really used this interactively, but having a return value so this can be extended more easily seems like a sensible idea.

@tcbegley
Copy link
Owner

Hey @AlejandroMonteseirin

Sorry it's been over a year, possibly you don't care any more, but I finally found time to make some improvements, in particular returning the value rather than printing it like you suggested.

You can now do this

from twophase import solve

solve("<cube_string>")  # returns the solution

Will close this now.

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

No branches or pull requests

2 participants