代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Java
】
简单模拟发牌 洗牌的集合知识
作者:
小小酱油
/ 发布于
2013/10/11
/
489
package com.cards.form; public class Card { public static final int CLUBS = 1; public static final int DIAMOND = 2; public static final int SPADE = 3; public static final int HEART = 4; public static final int JOKER = 5; public static final int BLACK = 1; public static final int COLOR = 2; public static final int THREE = 3; public static final int FOUR = 4; public static final int FIVE = 5; public static final int SIX = 6; public static final int SEVEN = 7; public static final int EIGHT = 8; public static final int NINE = 9; public static final int TEN = 10; public static final int JACK = 11; public static final int QUEEN = 12; public static final int KING = 13; public static final int ACE = 14; public static final int DUECE = 15; //public static final String[] public static final String[] colors = new String[]{"梅花","方块","黑桃","红桃","王"}; public static final String[] ranks = new String[]{"小","大","3","4","5","6","7","8","9","10","J","Q","K","A","2"}; /* 卡牌的花色 */ public int color; /* 卡牌的大小 */ public int rank; public Card(int color) { this.color = color; } public Card(int color, int rank) { this.color = color; this.rank = rank; } public boolean equals(Object obj) { boolean flag = false; if(obj != null && obj instanceof Card) { Card temp = (Card)obj; if((color == temp.color) && (rank == temp.rank)) flag = true; } return flag; } public String toString() { if(color == 5) return ranks[rank - 1] + colors[color - 1]; else return colors[color - 1] + ranks[rank - 1]; } }
试试其它关键字
模拟发牌
同语言下
.
List 切割成几份 工具类
.
一行一行读取txt的内容
.
Java PDF转换成图片并输出给前台展示
.
java 多线程框架
.
double类型如果小数点后为零则显示整数否则保留两位小
.
将图片转换为Base64字符串公共类抽取
.
sqlParser 处理SQL(增删改查) 替换schema 用于多租户
.
JAVA 月份中的第几周处理 1-7属于第一周 依次类推 29-
.
java计算两个经纬度之间的距离
.
输入时间参数计算年龄
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
小小酱油
贡献的其它代码
(
1
)
.
简单模拟发牌 洗牌的集合知识
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3