task5
This commit is contained in:
28
task4_main.py
Normal file
28
task4_main.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Short Deck Poker Hand Evaluation Script
|
||||
|
||||
Usage: python shortdeck_main.py "6sKs AhAdAc6s7s"
|
||||
"""
|
||||
|
||||
import sys
|
||||
from shortdeck import ShortDeckHandEvaluator
|
||||
from poker.hand_ranking import HandType
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print("输入: python shortdeck_main.py \"AsKs QhQdQc6s7s\"")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
hand_input = sys.argv[1]
|
||||
result = ShortDeckHandEvaluator.evaluate_from_input(hand_input)
|
||||
print(str(result))
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user