Exemplo n.º 1
0
# Description:
#   模拟一个发牌机器和一个发牌员的场景
# ------------------------(max to 80 columns)-----------------------------------

from machine.std_mach import create_deck, \
    shuffled_deck, \
    record_deck

from dealer.mike import deal_to_a_player, deal_to_multi_players

# 场景一:
# 拿出一副新牌,记录; 洗牌,再记录
first_deck = []
create_deck(first_deck)
record_deck(first_deck, "deck-001.txt")

shuffled_deck(first_deck)
record_deck(first_deck, "deck-002.txt")
'''
# 场景二
Steven_deck =[]
deal_to_a_player(first_deck, 5, Steven_deck)
record_deck(Steven_deck, "Steven_deck.txt")

Vivian_deck =[]
deal_to_a_player(first_deck, 5, Vivian_deck)
record_deck(Vivian_deck, "Vivian_deck.txt")
'''

# 场景三
Exemplo n.º 2
0
# -*- coding: UTF-8 -*-
from machine.std_mach import create_deck,\
    shuffled_deck,\
    record_deck
from dealer.mike import deal_to_a_player, deal_to_multi_players
# 场景一:
# 拿出一副新牌
first_deck = []
create_deck(first_deck)
record_deck(first_deck, 'deck-001.txt')

shuffled_deck(first_deck)
record_deck(first_deck, 'deck-002.txt')
'''
#场景二:
_deck = []
deal_to_a_player(first_deck,5,Monika_deck)
record_deck(Monika_deck,'Monika_deck.txt')

Monika1_deck = []
deal_to_a_player(first_deck,5,Monika1_deck)
record_deck(Monika1_deck,'1_deck.txt')
'''
# 场景三
Monika_deck = []
Monika1_deck = []

deal_to_multi_players(first_deck, Monika_deck, Monika1_deck)
record_deck(Monika_deck, 'Monika_deck.txt')
record_deck(Monika1_deck, '1_deck.txt')
Exemplo n.º 3
0
from machine.std_mach import create_deck,\
                            shuffled_deck,\
                            record_deck
from dealer.mike import deal_to_a_player, deal_to_multi_players
# FIRST
# 新牌一副
first_deck = []
create_deck(first_deck)
record_deck(first_deck, 'deck-001.txt')
shuffled_deck(first_deck)
record_deck(first_deck, 'deck-002.txt')
# SECOND
'''
player1_deck = []
deal_to_a_player(first_deck, 10, player1_deck)
record_deck(player1_deck, 'player1_deck.txt')

player2_deck = []
deal_to_a_player(first_deck, 10, player2_deck)
record_deck(player2_deck, 'player2_deck.txt')

player3_deck = []
deal_to_a_player(first_deck, 10, player3_deck)
record_deck(player3_deck, 'player3_deck.txt')
'''
#THIRD
player1_deck = []
player2_deck = []
player3_deck = []
player4_deck = []
deal_to_multi_players(first_deck, player1_deck, player2_deck, player3_deck,
Exemplo n.º 4
0
# -*- coding: UTF-8 -*-
import random
from machine.std_mach import create_deck,\
    shuffled_deck,\
    record_deck
from dealer.mike import deal_to_a_player, deal_to_multi_players
# 场景1:
# 拿出一幅新牌,记录,洗牌,在记录
first_deck = []
create_deck(first_deck)
record_deck(first_deck, "deck_001.txt")

shuffled_deck(first_deck)
record_deck(first_deck, "deck_002.txt")
'''
#场景二
Lisa_deck = []
deal_to_a_player(first_deck,5,Lisa_deck)
record_deck(Lisa_deck,"Lisa_deck.txt")

Jimmy_deck = []
deal_to_a_player(first_deck,15,Jimmy_deck)
record_deck(Jimmy_deck,"Jimmy_deck.txt")


Nina_deck = []
deal_to_a_player(first_deck,13,Nina_deck)
record_deck(Nina_deck,"Nina_deck.txt")

Cindy_deck = []
deal_to_a_player(first_deck,7,Cindy_deck)
Exemplo n.º 5
0
# -*- coding: UTF-8 -*-
import random
import os
import codecs

from machine.std_mach import create_deck,\
    shuffled_deck,\
    record_deck
from dealer.Mike import deal_to_a_player,deal_to_multi_players
first_deck = []
create_deck(first_deck)
record_deck(first_deck, "deck-001.txt")

shuffled_deck(first_deck)
record_deck(first_deck, "deck_001.txt")
'''
Qitian_deck = []
deal_to_a_player(first_deck, 10, Qitian_deck)
record_deck(Qitian_deck, "Qitian_deck.txt")
Yilei_deck = []
deal_to_a_player(first_deck, 5, Yilei_deck)
record_deck(Yilei_deck, "Yilei_deck.txt")
Woguanni_deck = []
deal_to_a_player(first_deck, 15, Woguanni_deck)
record_deck(Woguanni_deck, "Woguanni_deck.txt")
'''
Qitian_deck=[]
Yilei_deck = []
Woguanni_deck = []
Weiguang_deck = []
deal_to_multi_players(first_deck,Qitian_deck,Yilei_deck,Woguanni_deck,Weiguang_deck)