用的是比较挫的数组下标来比较牌的大小,不过也实现Comparable接口。。。
http://www.imooc.com/opus/resource?opus_id=3488
http://www.imooc.com/opus/resource?opus_id=3488
2017-12-26
for(int i=0; i < 10; i++) {
do {
sb = new StringBuilder("");
int length = random.nextInt(10) + 1;
for(int j=0; j<length; j++)
sb.append(totalString.charAt(random.nextInt(totalString.length() - 1)));
} while(stringList.contains(sb.toString()));
stringList.add(sb.toString());
}
do {
sb = new StringBuilder("");
int length = random.nextInt(10) + 1;
for(int j=0; j<length; j++)
sb.append(totalString.charAt(random.nextInt(totalString.length() - 1)));
} while(stringList.contains(sb.toString()));
stringList.add(sb.toString());
}
2017-12-25
public class HelloWorld {
public static void main(String[] args) {
StringBuilder str=new StringBuilder();
str.append("jaewkjldfxmopzdm");
for(int i=str.length()-3;i>0;i=i-3)
{
str.insert(i,",");
}
// 将StringBuilder对象转换为String对象并输出
System.out.print(str.toString());
}
}
public static void main(String[] args) {
StringBuilder str=new StringBuilder();
str.append("jaewkjldfxmopzdm");
for(int i=str.length()-3;i>0;i=i-3)
{
str.insert(i,",");
}
// 将StringBuilder对象转换为String对象并输出
System.out.print(str.toString());
}
}
2017-12-25
for(int i=str.length()-3;i>0;i-=3){
str.insert(i,",");
}
str.insert(i,",");
}
2017-12-25
https://www.imooc.com/article/22297
三季看完花了几天才写出来,玩家数量可以自定义,改个参数就行,欢迎交流
三季看完花了几天才写出来,玩家数量可以自定义,改个参数就行,欢迎交流
2017-12-23
搞事作死,无数组方法,仅用List即可实现,精巧细致的逻辑,粗狂耿直的思路,尽在:
https://www.imooc.com/article/22289
https://www.imooc.com/article/22289
2017-12-23
String prefix =fileName.substring(index+1);
// 判断必须包含"."号,且不能出现在首位,同时后缀名为"java"
if ( index>0&&prefix.equals("java")
如果substring()里面的index+1的话,prefix.equals()里面就可以是"java"了
// 判断必须包含"."号,且不能出现在首位,同时后缀名为"java"
if ( index>0&&prefix.equals("java")
如果substring()里面的index+1的话,prefix.equals()里面就可以是"java"了
2017-12-22
https://www.imooc.com/article/22183 自己写的练习手记,欢迎多指教
2017-12-22
感觉有点问题啊,这节课讲的是Set啊,怎么存放课程类型courseToSelect定义的是List型的?这样取出来的元素不就有序了吗?我按照老师的步骤结果都是有序的,你们呢?
2017-12-20