斗地主排序

本文主要介绍了如何进行斗地主扑克牌的排序,并详细展示了数据库操作的七个步骤,包括加载驱动、创建连接、编写SQL、执行查询、处理结果集以及关闭资源。
摘要由CSDN通过智能技术生成

一、斗地主排序

package com.zhongruan;

import java.util.*;

public class DouDiZhu2 {
public static void main(String[] args) {
//1.拿到一副牌
Map<Integer,String> poker=new HashMap<>();
String[] nums={“A”,“2”,“3”,“4”,“5”,“6”,“7”,“8”,“9”,“10”,“J”,“Q”,“K”};

    String[] colors={"黑桃","红心","梅花","方块"};
    int index=0;
    for(String color:colors){
        for(String num:nums){
            String pai=color+num;
            index=index+1;
            poker.put(index,pai);
        }
    }
    System.out.println(index);
    index++;
    poker.put(index,"大王");
    index++;
    poker.put(index,"小王");
    System.out.println(poker);
    //2.洗牌
    List<Integer> pokerIndexs=new ArrayList<>();
    Set<Integer> integers = poker.keySet();
  //  System.out.println(integers);
    for(Integ
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值