Simplify deck builds with list operations. #4

Merged
merged 1 commit into from Feb 18, 2015

Projects

None yet

2 participants

@barraponto
Collaborator

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
Owner

Simply amazing 😮,thanks

@MarcoWorms MarcoWorms merged commit 49796f4 into MarcoWorms:master Feb 18, 2015
@MarcoWorms
Owner

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
Collaborator

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

@MarcoWorms
Owner

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