Categories
Mastering Development

Issue using images in Python Tkinter

I am creating a Blackjack GUI game with Tkinter and I’m running into an issue where the deal button clears the image of the old card from the screen when a new one is added. My educated guess is the card_image inside the deal() function is overwriting itself when I use the function again. If […]

Categories
Ask Biology

Can ants distinguish individual ants in the colony?

I am aware that ants have the ability to distinguish which female is the queen and which ones aren’t. However, can ants also uniquely distinguish other individual ants in the colony? Is the differentiation between the classes only (worker-ant, queen, non-queen) or is it within the classes as well like hey its bob?

Categories
Ask Biology

Ants | Can Ants Distinguish Other Ants in the Colony Based on Individual Trait

I am aware that ants has a sense to distinguish which female is the queen and which one isnt. But is it fair to see that they can also distinguish uniquely other ants in the colony. Is the differentiation between the classes only (worker-ant, queen, non-queen) or is it within the classes as well like […]

Categories
CMS Drupal Mastering Development

Drupal 7 Commerce, Update /shop View When Filtering By Facet

We are using Commerce 7 to sell mattresses that may or may not have size variants like Single, Double, Queen, King . We have a facet filter on size that allows us to filter mattresses that are say Single in the /shop view. We also display the "size-price" in the /shop view. It is always […]

Categories
Mastering Development

Match list indices with strings to create a working deck of cards

This is for a school assignment. I have a list from 0 to 51 that represents a deck of cards. My goal is to make a function that allows the user to input a number from 0 to 51 and every number will match a card in the deck. For example if the number 0 […]

Categories
Mastering Development

Calling setPos() on custom QGraphicsPixmapItem doesn’t update QGraphicsScene immediately

I’m working on a little poker game and I am having a graphical glitch I would like to understand better and fix. For my “Card” class I subclassed QGraphicsPixmap items and added a 52-card “deck” to my QGraphicsScene. During runtime, I click on a button to deal the cards which then calls setPos() on the […]

Categories
Mastering Development

Is there a way to sort objects created through classes that is made up of both strings and integers in Python?

I have an assignment to create a deck of cards through the use of a class with methods that deal, shuffle, fan, order and checks if the deck is in order but I am having trouble creating the last one. The deck must be ordered by their values in each suit, and the suits ordered […]

Categories
Mastering Development

Card Java program suggestions/ advice heeeeelp

So I’m working on this Card project. I have to create a DeckOfCards class. Create a ‘Card’ array with 52 Card objects. Like the traditional deck of cards, it has 4 suits and each suit has a total of 13 cards(number cards that go from 2 to 10 & the face cards Jack, King, Queen, […]

Categories
Mastering Development

Sorting a list using sorted() by passing a list as the key argument

I’ve got a list which contains all cards from a standard 52 cards deck. I’m now wondering how i could sort these cards after their values, from Aces to Kings. My Idea was to use sorted() but I’m failing to grasp how I could pass the order of the list blueprint_deck as the key for […]

Categories
Mastering Development

Python, probability generate precise drawing?

So, there is a drawing of 3 cards for a game of 52 cards. I would like to know the probability of having the first card equal to 3, then the second card being a spade, then the last card being a black card (so spade or clubs). At the moment, I have this code, […]