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

Projects
None yet
2 participants
@barraponto
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

This comment has been minimized.

Show comment
Hide comment
@MarcoWorms

MarcoWorms Feb 18, 2015

Owner

Simply amazing 😮,thanks

Owner

MarcoWorms commented Feb 18, 2015

Simply amazing 😮,thanks

MarcoWorms added a commit that referenced this pull request Feb 18, 2015

Merge pull request #4 from barraponto/simplify-deck-build
Simplify deck builds with list operations.

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

@barraponto

This comment has been minimized.

Show comment
Hide comment
@MarcoWorms

This comment has been minimized.

Show comment
Hide comment
@MarcoWorms

MarcoWorms Feb 19, 2015

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

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

This comment has been minimized.

Show comment
Hide comment
@barraponto

barraponto Feb 19, 2015

Collaborator

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

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@MarcoWorms

MarcoWorms Feb 19, 2015

Owner

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

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