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

Simplify deck builds with list operations. #4

Merged
merged 1 commit into from Feb 18, 2015

Conversation

@barraponto
Copy link
Collaborator

barraponto commented Feb 18, 2015

Python provides list operations:

[1] + [1] = [1, 1]
[1] + [1] + [1] = [1, 1, 1]
3 * [1] = [1, 1, 1]

We can use that to build the decks.

@MarcoWorms
Copy link
Owner

MarcoWorms commented Feb 18, 2015

Simply amazing 😮,thanks

MarcoWorms added a commit that referenced this pull request Feb 18, 2015
Simplify deck builds with list operations.
@MarcoWorms MarcoWorms merged commit 49796f4 into MarcoWorms:master Feb 18, 2015
@barraponto
Copy link
Collaborator Author

barraponto commented Feb 19, 2015

@MarcoWorms
Copy link
Owner

MarcoWorms commented Feb 19, 2015

So, what I got from that read is that basically a Tuple is an immutable Array. I googled "why use Tuple instead of Array" and got to the conclusion that I should use Tuple when doing immutable arrays simply because it's faster for Python to read them. Thanks again, this language never ceases to amaze me :D

@barraponto
Copy link
Collaborator Author

barraponto commented Feb 19, 2015

Actually, I wanted you to understand how a, b = 1, 2 works. It's used in 49796f4#diff-86afa4d6818202b7cafc3ef2a0cc023bR43

@MarcoWorms
Copy link
Owner

MarcoWorms commented Feb 19, 2015

Yep, you used "cardname, amount" to get both dictionary "columns" in the same line. Really awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.