Add Python3 code to Verlet#146
Add Python3 code to Verlet#146HugoGranstrom wants to merge 3 commits intoalgorithm-archivists:masterfrom HugoGranstrom:master
Conversation
|
Let's wait with this until #141 is resolved. |
Butt4cak3
left a comment
There was a problem hiding this comment.
Alright. Now that the issue that I mentioned is resolved, I can finally go through this PR with you.
First off, welcome to the AAA! We're happy to see you want to contribute to the project!
There's only one thing that you need to change. In issue #141 we decided to entirely drop Python 2 and that's why I need you to fix something up. See the comment below.
| [import:2-18, lang:"java"](code/java/verlet.java) | ||
| {% sample lang="py2" %} | ||
| [import:28-33, lang:"python"](code/python2/verlet.py) | ||
| {% sample lang="py3" %} |
There was a problem hiding this comment.
We got rid of Python 2 and lang="py3" became just lang="py". Just remove the "3" everyone. Don't worry about the leftover Python 2 code imports.
|
Alright, thank you for the review :-). I'm away from home for a couple of days and I don't have my laptop with me so I can fix this on Wednesday. Is that ok? |
|
Yeah, get to it when you have time! Thanks for contributing! |
|
@leios thank you sir :-) Hopefully I won't be leaving AAA for a long time ;-) |
|
I just noticed that the old python2 version of verlet was changed yesterday to python3. I guess I should closed this one then? |
|
Oh no, you're right. I'm so sorry. I totally didn't think of that. I'm sure you will find another cool algorithm you can implement! The timing was just a bit unfortunate because we just made a big decision regarding Python. I hope that's okay. Still, thanks for contributing! We really appreciate that you put in some work! |
There was already Python2 code included in the article but as newcomers to Python should learn Python3 it makes sense to also add Python3 code. Hope my code makes sense.
In the last example I left Stormer-Verlet out because it is just Classical Verlet but you calculate the velocity but you don't use it in this example with the falling ball.