斗地主(按照顺序给玩家发牌)

斗地主
人物
String[ ] names={“奥巴马”,“特朗普”,“小泽玛利亚”};
发牌
String[ ] cards={“黑桃8”,“红桃6”,“方片7”,“梅花5”,“黑桃5”,“红桃2”,“方片3”,“梅花4”,“黑桃10”,“红桃10”,“方片9”,“梅花8”,“黑桃K”,“红桃A”,“方片10”,“梅花1”,“梅花J”,“方片Q”,“红桃Q”}
将扑克牌按照顺序发放给玩家

public static void main(String[] args){
	String[ ]  names={"奥巴马","特朗普","小泽玛利亚"};
	String[ ]  cards={"黑桃8","红桃6","方片7","梅花5","黑桃5","红桃2","方片3","梅花4","黑桃	  10","红桃10","方片9","梅花8","黑桃K","红桃A","方片10","梅花1","梅花J","方片Q","红桃Q"};
	for(int i=0:i<names.length;i++){
		System.out.println(names[i]+"的牌是:");
		for(int j=0;j<cards.length;j++){
			if(j%3==i){
			System.out.ptint(cards[j}+"");
		}
	}
	System.out.println();
}

你可能感兴趣的:(斗地主(按照顺序给玩家发牌))