Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python - help for beginner
#1
Hello, im planning to create a python program and i need some advices for beginner.
The program is about cards. I will have 52 cards, i want to store all the possible combinations, example ace-king, ace-Queen, ace-9...the user can choose the combination card1 - card2, position on the table and then to give a specific result of each combination. So i want to store somewhere all the combination of card1 +card2+position =result, to give the result when the user choose card1 and card2 and position. Which method i need to use? I will need any sql database? Which GUI is better to use with Python for the program? I have qt designer, is it good or is any other more useful to start?
I like someone to give me some advice on which methods i will need to do this program
Thanks
Reply
#2
Whether or not you need an SQL database depends on the number of positions and how result is calculated. If result is easily calculated, than you just write a function that does that calculation. For example, the value of a Blackjack hand is very easy to calculate, so you don't need to store anything. If the result can't be calculated for some reason, there are 1,326 possible two card combinations with a standard playing card deck. If you don't have too many positions, you could maybe store the results in a file and just read them into a dictionary. If there are a lot of positions, you might want a database to store them. Although if the game is that complicated, maybe it's too complicated?

If there was a "better" GUI for Python, that would be the only one left. It is in many ways a matter of personal preference/familiarity as to which GUI gets used.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
Thanks for the reply. Basically is not mathematical result. The result will be decision "fold" - "call"- "raise" based on which hand the player have and which position is seating. Like a strategy decision.

For example, the user choose A-2 at position 4 then the result will be fold, user choose A2 at position 2 the result will be call. What is the most easiest way to do that? Which functions will be better to use for that. The combination will be more than 300
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020