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

project completed #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

project completed #2

wants to merge 1 commit into from

Conversation

jwen2
Copy link

@jwen2 jwen2 commented Sep 30, 2017

No description provided.

victorbianchi added a commit to victorbianchi/ComputationalArt that referenced this pull request Oct 2, 2017
victorbianchi added a commit to victorbianchi/ComputationalArt that referenced this pull request Oct 2, 2017
return x ** 2
elif f[0] == "cube":
# print("return : ", f[1]**3 )
return x ** 3

Choose a reason for hiding this comment

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

Great job overall, but I think you can remove the commented print code when submitting

if randomfunction in ["x","y"]:
list.append(randomfunction)
return list

Choose a reason for hiding this comment

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

For the two if statements from the bottom, I think you can make it as elif statement. That would make the code to jump right to the return if the randomfunction was 'avg' or 'prod'. (Just minor details)
Also, I think list is a reserved keyword for python language, so I would recommend not to use list as variable names. Sometimes you might see unexpected behaviors

>>> evaluate_random_function(["sin_pi", ["avg", ["prod", ["avg", ["x"],["y"]], ["x"]], ["prod", ["x"], ["y"]]]], 0, 0)
0.0
>>> evaluate_random_function(['sin_pi', ['cos_pi', ['cos_pi', ['x']]]], -1, -1)
0.0

Choose a reason for hiding this comment

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

I like how you added more unit tests! Great!

@jwen2
Copy link
Author

jwen2 commented Oct 11, 2017 via email

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.

None yet

2 participants