bastra | A simple terminal-based bastra game
kandi X-RAY | bastra Summary
kandi X-RAY | bastra Summary
A simple terminal-based bastra game. For more information, see
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bastra
bastra Key Features
bastra Examples and Code Snippets
Community Discussions
Trending Discussions on bastra
QUESTION
Sorry I'm new to python, sorry, if the question is too basic. I am trying to write a code for a card game called pishti or bastra. Shortly, two players (in my case a user and a computer) have hands consisting of 4 cards each and there are some cards in the middle one of which is on top and visible to the players (others are closed). Shortly I was able to deal cards for the user with a list of four card objects. However, after the user plays one of his/her cards, I can't remove the card from the list as it cannot be found. (I tried to use .remove() and del) However, I can access the cards with list[index] Here's my code (shortened to the parts related to this question):
...ANSWER
Answered 2020-Feb-02 at 13:35.index
calls the objects' __eq__
method, so you will have to implement it in Card
. Otherwise the objects will be compared based on their memory addresses.
Possible implementation:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bastra
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page