先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024b (备注Java)
正文
Common.getBoomb(list2, model); // ok
// ------拆3带
Common.getThree(list2, model);
// 拆飞机
Common.getPlane(list2, model);
// ------拆对子
Common.getTwo(list2, model);
// 拆连队
Common.getTwoTwo(list2, model);
// 拆顺子
Common.get123(list2, model);
// 拆单
Common.getSingle(list2, model);
return model;
}
// 拆连子
public static void get123(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
if (list.size() > 0 && (Common.getValue(list.get(0)) < 7 || Common.getValue(list.get(list.size() - 1)) > 10))
return;
if (list.size() < 5)
return;
for (int i = 0, len = list.size(); i < len; i++) {
int k = i;
for (int j = i; j < len; j++) {
if (Common.getValue(list.get(i)) - Common.getValue(list.get(j)) == j - i) {
k = j;
}
}
if (k - i >= 4) {
String s = “”;
for (int j = i; j < k; j++) {
s += list.get(j).name + “,”;
del.add(list.get(j));
}
s += list.get(k).name;
del.add(list.get(k));
model.a123.add(s);
i = k;
}
}
list.removeAll(del);
}
// 拆双顺
public static void getTwoTwo(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 从model里面的对子找
List l = model.a2;
if (l.size() < 3)
return;
Integer s[] = new Integer[l.size()];
for (int i = 0, len = l.size(); i < len; i++) {
String[] name = l.get(i).split(“,”);
s[i] = Integer.parseInt(name[0].substring(2, name[0].length()));
}
// s0,1,2,3,4 13,9,8,7,6
for (int i = 0, len = l.size(); i < len; i++) {
int k = i;
for (int j = i; j < len; j++) {
if (s[i] - s[j] == j - i)
k = j;
}
if (k - i >= 2)// k=4 i=1
{// 说明从i到k是连队
String ss = “”;
for (int j = i; j < k; j++) {
ss += l.get(j) + “,”;
del.add(l.get(j));
}
ss += l.get(k);
model.a112233.add(ss);
del.add(l.get(k));
i = k;
}
}
l.removeAll(del);
}
// 拆飞机
public static void getPlane(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 从model里面的3带找
List l = model.a3;
if (l.size() < 2)
return;
Integer s[] = new Integer[l.size()];
for (int i = 0, len = l.size(); i < len; i++) {
String[] name = l.get(i).split(“,”);
s[i] = Integer.parseInt(name[0].substring(2, name[0].length()));
}
for (int i = 0, len = l.size(); i < len; i++) {
int k = i;
for (int j = i; j < len; j++) {
if (s[i] - s[j] == j - i)
k = j;
}
if (k != i) {// 说明从i到k是飞机
String ss = “”;
for (int j = i; j < k; j++) {
ss += l.get(j) + “,”;
del.add(l.get(j));
}
ss += l.get(k);
model.a111222.add(ss);
del.add(l.get(k));
i = k;
}
}
l.removeAll(del);
}
// 拆炸弹
public static void getBoomb(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 王炸
if (list.size() >= 2 && Common.getColor(list.get(0)) == 5 && Common.getColor(list.get(1)) == 5) {
model.a4.add(list.get(0).name + “,” + list.get(1).name); // 按名字加入
del.add(list.get(0));
del.add(list.get(1));
}
// 如果王不构成炸弹咋先拆单
if (Common.getColor(list.get(0)) == 5 && Common.getColor(list.get(1)) != 5) {
del.add(list.get(0));
model.a1.add(list.get(0).name);
}
list.removeAll(del);
// 一般的炸弹
for (int i = 0, len = list.size(); i < len; i++) {
if (i + 3 < len && Common.getValue(list.get(i)) == Common.getValue(list.get(i + 3))) {
String s = list.get(i).name + “,”;
s += list.get(i + 1).name + “,”;
s += list.get(i + 2).name + “,”;
s += list.get(i + 3).name;
model.a4.add(s);
for (int j = i; j <= i + 3; j++)
del.add(list.get(j));
i = i + 3;
}
}
list.removeAll(del);
}
// 拆3带
public static void getThree(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 连续3张相同
for (int i = 0, len = list.size(); i < len; i++) {
if (i + 2 < len && Common.getValue(list.get(i)) == Common.getValue(list.get(i + 2))) {
String s = list.get(i).name + “,”;
s += list.get(i + 1).name + “,”;
s += list.get(i + 2).name;
model.a3.add(s);
for (int j = i; j <= i + 2; j++)
del.add(list.get(j));
i = i + 2;
}
}
list.removeAll(del);
}
// 拆对子
public static void getTwo(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 连续2张相同
for (int i = 0, len = list.size(); i < len; i++) {
if (i + 1 < len && Common.getValue(list.get(i)) == Common.getValue(list.get(i + 1))) {
String s = list.get(i).name + “,”;
s += list.get(i + 1).name;
model.a2.add(s);
for (int j = i; j <= i + 1; j++)
del.add(list.get(j));
i = i + 1;
}
}
list.removeAll(del);
}
// 拆单牌
public static void getSingle(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 1
for (int i = 0, len = list.size(); i < len; i++) {
model.a1.add(list.get(i).name);
del.add(list.get(i));
}
list.removeAll(del);
}
// 隐藏之前出过的牌
public static void hideCards(List list) {
for (int i = 0, len = list.size(); i < len; i++) {
list.get(i).setVisible(false);
}
}
// 检查牌的是否能出
public static int checkCards(List c, List[] current) {
// 找出当前最大的牌是哪个电脑出的,c是点选的牌
List currentlist = (current[0].size() > 0) ? current[0] : current[2];
CardType cType = Common.jugdeType©;
// 如果张数不同直接过滤
if (cType != CardType.c4 && c.size() != currentlist.size())
return 0;
// 比较我的出牌类型
if (Common.jugdeType© != Common.jugdeType(currentlist)) {
return 0;
}
// 比较出的牌是否要大
// 王炸弹
if (cType == CardType.c4) {
if (c.size() == 2)
return 1;
if (currentlist.size() == 2)
return 0;
}
// 单牌,对子,3带,4炸弹
if (cType == CardType.c1 || cType == CardType.c2 || cType == CardType.c3 || cType == CardType.c4) {
if (Common.getValue(c.get(0)) <= Common.getValue(currentlist.get(0))) {
return 0;
} else {
return 1;
}
}
// 顺子,连队,飞机裸
if (cType == CardType.c123 || cType == CardType.c1122 || cType == CardType.c111222) {
if (Common.getValue(c.get(0)) <= Common.getValue(currentlist.get(0)))
return 0;
else
return 1;
}
// 按重复多少排序
// 3带1,3带2 ,飞机带单,双,4带1,2,只需比较第一个就行,独一无二的
if (cType == CardType.c31 || cType == CardType.c32 || cType == CardType.c411 || cType == CardType.c422
|| cType == CardType.c11122234 || cType == CardType.c1112223344) {
List a1 = Common.getOrder2©; // 我出的牌
List a2 = Common.getOrder2(currentlist);// 当前最大牌
if (Common.getValue(a1.get(0)) < Common.getValue(a2.get(0)))
return 0;
}
return 1;
}
// 按照重复次数排序
public static List getOrder2(List list) {
List list2 = new ArrayList(list);
List list3 = new ArrayList();
// List list4=new ArrayList();
int len = list2.size();
int a[] = new int[20];// 记录数
for (int i = 0; i < 20; i++)
a[i] = 0;
for (int i = 0; i < len; i++) {
a[Common.getValue(list2.get(i))]++;
}
int max = 0;
for (int i = 0; i < 20; i++) {
max = 0;
for (int j = 19; j >= 0; j–) {
if (a[j] > a[max])
max = j;
}
for (int k = 0; k < len; k++) {
if (Common.getValue(list2.get(k)) == max) {
list3.add(list2.get(k));
}
}
list2.remove(list3);
a[max] = 0;
}
return list3;
}
}
class Card_index {
List a[] = new ArrayList[4];// 单张
}
Model.java
package com.sjsq;
import java.util.ArrayList;
import java.util.List;
/**
-
扑克类型List类
-
@author shuijianshiqing
-
@date 2020-09-09 20:47
*/
public class Model {
//一组牌
int value; //权值
int num;// 手数 (几次能够走完,没有挡的情况下)
List a1=new ArrayList(); //单张
List a2=new ArrayList(); //对子
List a3=new ArrayList(); //3带
List a123=new ArrayList(); //连子
List a112233=new ArrayList(); //连牌
List a111222=new ArrayList(); //飞机
List a4=new ArrayList(); //炸弹
}
NewSwing.java
package com.sjsq;
import javax.swing.SwingUtilities;
public class NewSwing {
}
Time.java
package com.sjsq;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
public class Time extends Thread {
Main main;
boolean isRun = true;
int i = 10;
public Time(Main m, int i) {
this.main = m;
this.i = i;
}
@Override
public void run() {
while (i > -1 && isRun) {
main.time[1].setText(“倒计时:” + i–);
second(1);// 等一秒
}
if (i == -1)// 正常终结,说明超时
main.time[1].setText(“不抢”);
main.landlord[0].setVisible(false);
main.landlord[1].setVisible(false);
for (Card card2 : main.playerList[1])
card2.canClick = true;// 可被点击
// 如果自己抢到地主
if (main.time[1].getText().equals(“抢地主”)) {
// 得到地主牌
main.playerList[1].addAll(main.lordList);
openlord(true);
second(2);// 等待五秒
Common.order(main.playerList[1]);
Common.rePosition(main, main.playerList[1], 1);
setlord(1);
} else {
// 电脑选地主
if (Common.getScore(main.playerList[0]) < Common.getScore(main.playerList[2])) {
main.time[2].setText(“抢地主”);
main.time[2].setVisible(true);
setlord(2);// 设定地主
openlord(true);// 把地主牌翻开
second(3);
main.playerList[2].addAll(main.lordList);
Common.order(main.playerList[2]);
Common.rePosition(main, main.playerList[2], 2);
openlord(false);
} else {
main.time[0].setText(“抢地主”);
main.time[0].setVisible(true);
setlord(0);// 设定地主
openlord(true);
second(3);
main.playerList[0].addAll(main.lordList);
Common.order(main.playerList[0]);
Common.rePosition(main, main.playerList[0], 0);
// openlord(false);
}
}
// 选完地主后 关闭地主按钮
main.landlord[0].setVisible(false);
main.landlord[1].setVisible(false);
turnOn(false);
for (int i = 0; i < 3; i++) {
main.time[i].setText(“不要”);
main.time[i].setVisible(false);
}
// 开始游戏 根据地主不同顺序不同
main.turn = main.dizhuFlag;
while (true) {
if (main.turn == 1) // 我
{
turnOn(true);// 出牌按钮 --我出牌
timeWait(30, 1);// 我自己的定时器
System.out.println(“我出牌”);
turnOn(false);// 选完关闭
main.turn = (main.turn + 1) % 3;
if (win())// 判断输赢
break;
}
if (main.turn == 0) {
computer0();
main.turn = (main.turn + 1) % 3;
if (win())// 判断输赢
break;
}
if (main.turn == 2) {
computer2();
main.turn = (main.turn + 1) % 3;
if (win())// 判断输赢
break;
}
}
}
// 等待i秒
public void second(int i) {
try {
Thread.sleep(i * 1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// 地主牌翻看
public void openlord(boolean is) {
for (int i = 0; i < 3; i++) {
if (is)
main.lordList.get(i).turnFront(); // 地主牌翻看
else {
main.lordList.get(i).turnRear(); // 地主牌闭合
}
main.lordList.get(i).canClick = true;// 可被点击
}
}
// 设定地主
public void setlord(int i) {
Point point = new Point();
if (i == 1)// 我是地主
{
point.x = 80;
point.y = 430;
main.dizhuFlag = 1;// 设定地主
}
if (i == 0) {
point.x = 80;
point.y = 20;
main.dizhuFlag = 0;
}
if (i == 2) {
point.x = 700;
point.y = 20;
main.dizhuFlag = 2;
}
main.dizhu.setLocation(point);
main.dizhu.setVisible(true);
}
// 打开出牌按钮
public void turnOn(boolean flag) {
main.publishCard[0].setVisible(flag);
main.publishCard[1].setVisible(flag);
}
// 电脑0走牌(我代表1)
public void computer0() {
timeWait(3, 0); // 定时
ShowCard(0); // 出牌
}
// 电脑2走牌(我代表1)
public void computer2() {
timeWait(3, 2); // 定时
ShowCard(2); // 出牌
}
// 走牌
public void ShowCard(int role) {
Model model = Common.getModel(main.playerList[role]);
// 待走的牌
List list = new ArrayList();
// 如果是主动出牌
if (main.time[(role + 1) % 3].getText().equals(“不要”) && main.time[(role + 2) % 3].getText().equals(“不要”)) {
// 有单出单 (除开3带,飞机能带的单牌)
if (model.a1.size() > (model.a111222.size() * 2 + model.a3.size())) {
list.add(model.a1.get(model.a1.size() - 1));
} // 有对子出对子 (除开3带,飞机)
else if (model.a2.size() > (model.a111222.size() * 2 + model.a3.size())) {
list.add(model.a2.get(model.a2.size() - 1));
} // 有顺子出顺子
else if (model.a123.size() > 0) {
list.add(model.a123.get(model.a123.size() - 1));
} // 有3带就出3带,没有就出光3
else if (model.a3.size() > 0) {
// 3带单,且非关键时刻不能带王,2
if (model.a1.size() > 0) {
list.add(model.a1.get(model.a1.size() - 1));
} // 3带对
else if (model.a2.size() > 0) {
list.add(model.a2.get(model.a2.size() - 1));
}
list.add(model.a3.get(model.a3.size() - 1));
} // 有双顺出双顺
else if (model.a112233.size() > 0) {
list.add(model.a112233.get(model.a112233.size() - 1));
} // 有飞机出飞机
else if (model.a111222.size() > 0) {
String name[] = model.a111222.get(0).split(“,”);
// 带单
if (name.length / 3 <= model.a1.size()) {
list.add(model.a111222.get(model.a111222.size() - 1));
for (int i = 0; i < name.length / 3; i++)
list.add(model.a1.get(i));
} else if (name.length / 3 <= model.a2.size())// 带双
{
list.add(model.a111222.get(model.a111222.size() - 1));
for (int i = 0; i < name.length / 3; i++)
list.add(model.a2.get(i));
}
// 有炸弹出炸弹
} else if (model.a4.size() > 0) {
// 4带2,1
int sizea1 = model.a1.size();
int sizea2 = model.a2.size();
if (sizea1 >= 2) {
list.add(model.a1.get(sizea1 - 1));
list.add(model.a1.get(sizea1 - 2));
list.add(model.a4.get(0));
} else if (sizea2 >= 2) {
list.add(model.a2.get(sizea1 - 1));
list.add(model.a2.get(sizea1 - 2));
list.add(model.a4.get(0));
} else {// 直接炸
list.add(model.a4.get(0));
}
}
} // 如果是跟牌
else {
-
List player = main.currentList[(role + 2) % 3].size() > 0 ? main.currentList[(role + 2) % 3]
- main.currentList[(role + 1) % 3];// 当前出的牌
CardType cType = Common.jugdeType(player);// 桌面别人出的牌
// 如果是单牌
if (cType == CardType.c1) {
AI_1(model.a1, player, list, role);
} // 如果是对子
else if (cType == CardType.c2) {
AI_1(model.a2, player, list, role);
} // 3带
else if (cType == CardType.c3) {
AI_1(model.a3, player, list, role);
} // 炸弹
else if (cType == CardType.c4) {
AI_1(model.a4, player, list, role);
} // 如果是3带1
else if (cType == CardType.c31) {
// 偏家 涉及到拆牌
// if((role+1)%3==main.dizhuFlag)
AI_2(model.a3, model.a1, player, list, role);
} // 如果是3带2
else if (cType == CardType.c32) {
// 偏家
// if((role+1)%3==main.dizhuFlag)
AI_2(model.a3, model.a2, player, list, role);
} // 如果是4带11
else if (cType == CardType.c411) {
AI_5(model.a4, model.a1, player, list, role);
}
// 如果是4带22
else if (cType == CardType.c422) {
AI_5(model.a4, model.a2, player, list, role);
}
// 顺子
else if (cType == CardType.c123) {
AI_3(model.a123, player, list, role);
}
// 双顺
else if (cType == CardType.c1122) {
AI_3(model.a112233, player, list, role);
}
// 飞机带单
else if (cType == CardType.c11122234) {
AI_4(model.a111222, model.a1, player, list, role);
}
// 飞机带对
else if (cType == CardType.c1112223344) {
AI_4(model.a111222, model.a2, player, list, role);
}
// 炸弹
if (list.size() == 0) {
int len4 = model.a4.size();
if (len4 > 0)
list.add(model.a4.get(len4 - 1));
}
}
// 定位出牌
main.currentList[role].clear();
if (list.size() > 0) {
Point point = new Point();
if (role == 0)
point.x = 200;
if (role == 2)
point.x = 550;
point.y = (400 / 2) - (list.size() + 1) * 15 / 2;// 屏幕中部
// 将name转换成Card
for (int i = 0, len = list.size(); i < len; i++) {
List cards = getCardByName(main.playerList[role], list.get(i));
for (Card card : cards) {
Common.move(card, card.getLocation(), point, 10);
point.y += 15;
main.currentList[role].add(card);
main.playerList[role].remove(card);
}
}
Common.rePosition(main, main.playerList[role], role);
} else {
main.time[role].setVisible(true);
main.time[role].setText(“不要”);
}
for (Card card : main.currentList[role])
card.turnFront();
}
// 按name获得Card,方便从Model取出
public List getCardByName(List list, String n) {
String[] name = n.split(“,”);
List cardsList = new ArrayList();
int j = 0;
for (int i = 0, len = list.size(); i < len; i++) {
if (j < name.length && list.get(i).name.equals(name[j])) {
cardsList.add(list.get(i));
i = 0;
j++;
}
}
return cardsList;
}
// 顺子
public void AI_3(List model, List player, List list, int role) {
for (int i = 0, len = model.size(); i < len; i++) {
String[] s = model.get(i).split(“,”);
if (s.length == player.size() && getValueInt(model.get(i)) > Common.getValue(player.get(0))) {
list.add(model.get(i));
return;
}
}
}
// 飞机带单,双
public void AI_4(List model1, List model2, List player, List list, int role) {
// 排序按重复数
player = Common.getOrder2(player);
int len1 = model1.size();
int len2 = model2.size();
if (len1 < 1 || len2 < 1)
return;
for (int i = 0; i < len1; i++) {
String[] s = model1.get(i).split(“,”);
String[] s2 = model2.get(0).split(“,”);
if ((s.length / 3 <= len2) && (s.length * (3 + s2.length) == player.size())
&& getValueInt(model1.get(i)) > Common.getValue(player.get(0))) {
list.add(model1.get(i));
for (int j = 1; j <= s.length / 3; j++)
list.add(model2.get(len2 - j));
}
}
}
// 4带1,2
public void AI_5(List model1, List model2, List player, List list, int role) {
// 排序按重复数
player = Common.getOrder2(player);
int len1 = model1.size();
int len2 = model2.size();
if (len1 < 1 || len2 < 2)
return;
for (int i = 0; i < len1; i++) {
if (getValueInt(model1.get(i)) > Common.getValue(player.get(0))) {
list.add(model1.get(i));
for (int j = 1; j <= 2; j++)
list.add(model2.get(len2 - j));
}
}
}
// 单牌,对子,3个,4个,通用
public void AI_1(List model, List player, List list, int role) {
// 顶家
if ((role + 1) % 3 == main.dizhuFlag) {
for (int i = 0, len = model.size(); i < len; i++) {
if (getValueInt(model.get(i)) > Common.getValue(player.get(0))) {
list.add(model.get(i));
break;
}
}
} else {// 偏家
for (int len = model.size(), i = len - 1; i >= 0; i–) {
if (getValueInt(model.get(i)) > Common.getValue(player.get(0))) {
list.add(model.get(i));
break;
}
}
}
}
// 3带1,2,4带1,2
public void AI_2(List model1, List model2, List player, List list, int role) {
// model1是主牌,model2是带牌,player是玩家出的牌,list是准备回的牌
// 排序按重复数
player = Common.getOrder2(player);
int len1 = model1.size();
int len2 = model2.size();
// 如果有王直接炸了
if (len1 > 0 && model1.get(0).length() < 10) {
list.add(model1.get(0));
System.out.println(“王炸”);
return;
}
if (len1 < 1 || len2 < 1)
return;
for (int len = len1, i = len - 1; i >= 0; i–) {
if (getValueInt(model1.get(i)) > Common.getValue(player.get(0))) {
list.add(model1.get(i));
break;
}
}
list.add(model2.get(len2 - 1));
if (list.size() < 2)
list.clear();
}
// 延时,模拟时钟
public void timeWait(int n, int player) {
if (main.currentList[player].size() > 0)
Common.hideCards(main.currentList[player]);
if (player == 1)// 如果是我,10秒到后直接下一家出牌
{
int i = n;
while (main.nextPlayer == false && i >= 0) {
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
second(1);
i–;
}
if (i == -1) {
main.time[player].setText(“超时”);
}
main.nextPlayer = false;
} else {
for (int i = n; i >= 0; i–) {
second(1);
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
}
}
main.time[player].setVisible(false);
}
// 通过name估值
public int getValueInt(String n) {
String name[] = n.split(“,”);
String s = name[0];
int i = Integer.parseInt(s.substring(2, s.length()));
if (s.substring(0, 1).equals(“5”))
i += 3;
if (s.substring(2, s.length()).equals(“1”) || s.substring(2, s.length()).equals(“2”))
i += 13;
最后
由于篇幅原因,就不多做展示了
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
}
// 延时,模拟时钟
public void timeWait(int n, int player) {
if (main.currentList[player].size() > 0)
Common.hideCards(main.currentList[player]);
if (player == 1)// 如果是我,10秒到后直接下一家出牌
{
int i = n;
while (main.nextPlayer == false && i >= 0) {
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
second(1);
i–;
}
if (i == -1) {
main.time[player].setText(“超时”);
}
main.nextPlayer = false;
} else {
for (int i = n; i >= 0; i–) {
second(1);
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
}
}
main.time[player].setVisible(false);
}
// 通过name估值
public int getValueInt(String n) {
String name[] = n.split(“,”);
String s = name[0];
int i = Integer.parseInt(s.substring(2, s.length()));
if (s.substring(0, 1).equals(“5”))
i += 3;
if (s.substring(2, s.length()).equals(“1”) || s.substring(2, s.length()).equals(“2”))
i += 13;
最后
[外链图片转存中…(img-fp25RSjy-1713599618030)]
[外链图片转存中…(img-JeG8TXqD-1713599618031)]
[外链图片转存中…(img-YEhBz0PM-1713599618031)]
[外链图片转存中…(img-3TnWGBbw-1713599618032)]
[外链图片转存中…(img-v3SgVOXg-1713599618032)]
[外链图片转存中…(img-29S6RXHR-1713599618033)]
由于篇幅原因,就不多做展示了
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
[外链图片转存中…(img-uXT2PYXc-1713599618033)]
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024b (备注Java)
正文
Common.getBoomb(list2, model); // ok
// ------拆3带
Common.getThree(list2, model);
// 拆飞机
Common.getPlane(list2, model);
// ------拆对子
Common.getTwo(list2, model);
// 拆连队
Common.getTwoTwo(list2, model);
// 拆顺子
Common.get123(list2, model);
// 拆单
Common.getSingle(list2, model);
return model;
}
// 拆连子
public static void get123(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
if (list.size() > 0 && (Common.getValue(list.get(0)) < 7 || Common.getValue(list.get(list.size() - 1)) > 10))
return;
if (list.size() < 5)
return;
for (int i = 0, len = list.size(); i < len; i++) {
int k = i;
for (int j = i; j < len; j++) {
if (Common.getValue(list.get(i)) - Common.getValue(list.get(j)) == j - i) {
k = j;
}
}
if (k - i >= 4) {
String s = “”;
for (int j = i; j < k; j++) {
s += list.get(j).name + “,”;
del.add(list.get(j));
}
s += list.get(k).name;
del.add(list.get(k));
model.a123.add(s);
i = k;
}
}
list.removeAll(del);
}
// 拆双顺
public static void getTwoTwo(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 从model里面的对子找
List l = model.a2;
if (l.size() < 3)
return;
Integer s[] = new Integer[l.size()];
for (int i = 0, len = l.size(); i < len; i++) {
String[] name = l.get(i).split(“,”);
s[i] = Integer.parseInt(name[0].substring(2, name[0].length()));
}
// s0,1,2,3,4 13,9,8,7,6
for (int i = 0, len = l.size(); i < len; i++) {
int k = i;
for (int j = i; j < len; j++) {
if (s[i] - s[j] == j - i)
k = j;
}
if (k - i >= 2)// k=4 i=1
{// 说明从i到k是连队
String ss = “”;
for (int j = i; j < k; j++) {
ss += l.get(j) + “,”;
del.add(l.get(j));
}
ss += l.get(k);
model.a112233.add(ss);
del.add(l.get(k));
i = k;
}
}
l.removeAll(del);
}
// 拆飞机
public static void getPlane(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 从model里面的3带找
List l = model.a3;
if (l.size() < 2)
return;
Integer s[] = new Integer[l.size()];
for (int i = 0, len = l.size(); i < len; i++) {
String[] name = l.get(i).split(“,”);
s[i] = Integer.parseInt(name[0].substring(2, name[0].length()));
}
for (int i = 0, len = l.size(); i < len; i++) {
int k = i;
for (int j = i; j < len; j++) {
if (s[i] - s[j] == j - i)
k = j;
}
if (k != i) {// 说明从i到k是飞机
String ss = “”;
for (int j = i; j < k; j++) {
ss += l.get(j) + “,”;
del.add(l.get(j));
}
ss += l.get(k);
model.a111222.add(ss);
del.add(l.get(k));
i = k;
}
}
l.removeAll(del);
}
// 拆炸弹
public static void getBoomb(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 王炸
if (list.size() >= 2 && Common.getColor(list.get(0)) == 5 && Common.getColor(list.get(1)) == 5) {
model.a4.add(list.get(0).name + “,” + list.get(1).name); // 按名字加入
del.add(list.get(0));
del.add(list.get(1));
}
// 如果王不构成炸弹咋先拆单
if (Common.getColor(list.get(0)) == 5 && Common.getColor(list.get(1)) != 5) {
del.add(list.get(0));
model.a1.add(list.get(0).name);
}
list.removeAll(del);
// 一般的炸弹
for (int i = 0, len = list.size(); i < len; i++) {
if (i + 3 < len && Common.getValue(list.get(i)) == Common.getValue(list.get(i + 3))) {
String s = list.get(i).name + “,”;
s += list.get(i + 1).name + “,”;
s += list.get(i + 2).name + “,”;
s += list.get(i + 3).name;
model.a4.add(s);
for (int j = i; j <= i + 3; j++)
del.add(list.get(j));
i = i + 3;
}
}
list.removeAll(del);
}
// 拆3带
public static void getThree(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 连续3张相同
for (int i = 0, len = list.size(); i < len; i++) {
if (i + 2 < len && Common.getValue(list.get(i)) == Common.getValue(list.get(i + 2))) {
String s = list.get(i).name + “,”;
s += list.get(i + 1).name + “,”;
s += list.get(i + 2).name;
model.a3.add(s);
for (int j = i; j <= i + 2; j++)
del.add(list.get(j));
i = i + 2;
}
}
list.removeAll(del);
}
// 拆对子
public static void getTwo(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 连续2张相同
for (int i = 0, len = list.size(); i < len; i++) {
if (i + 1 < len && Common.getValue(list.get(i)) == Common.getValue(list.get(i + 1))) {
String s = list.get(i).name + “,”;
s += list.get(i + 1).name;
model.a2.add(s);
for (int j = i; j <= i + 1; j++)
del.add(list.get(j));
i = i + 1;
}
}
list.removeAll(del);
}
// 拆单牌
public static void getSingle(List list, Model model) {
List del = new ArrayList();// 要删除的Cards
// 1
for (int i = 0, len = list.size(); i < len; i++) {
model.a1.add(list.get(i).name);
del.add(list.get(i));
}
list.removeAll(del);
}
// 隐藏之前出过的牌
public static void hideCards(List list) {
for (int i = 0, len = list.size(); i < len; i++) {
list.get(i).setVisible(false);
}
}
// 检查牌的是否能出
public static int checkCards(List c, List[] current) {
// 找出当前最大的牌是哪个电脑出的,c是点选的牌
List currentlist = (current[0].size() > 0) ? current[0] : current[2];
CardType cType = Common.jugdeType©;
// 如果张数不同直接过滤
if (cType != CardType.c4 && c.size() != currentlist.size())
return 0;
// 比较我的出牌类型
if (Common.jugdeType© != Common.jugdeType(currentlist)) {
return 0;
}
// 比较出的牌是否要大
// 王炸弹
if (cType == CardType.c4) {
if (c.size() == 2)
return 1;
if (currentlist.size() == 2)
return 0;
}
// 单牌,对子,3带,4炸弹
if (cType == CardType.c1 || cType == CardType.c2 || cType == CardType.c3 || cType == CardType.c4) {
if (Common.getValue(c.get(0)) <= Common.getValue(currentlist.get(0))) {
return 0;
} else {
return 1;
}
}
// 顺子,连队,飞机裸
if (cType == CardType.c123 || cType == CardType.c1122 || cType == CardType.c111222) {
if (Common.getValue(c.get(0)) <= Common.getValue(currentlist.get(0)))
return 0;
else
return 1;
}
// 按重复多少排序
// 3带1,3带2 ,飞机带单,双,4带1,2,只需比较第一个就行,独一无二的
if (cType == CardType.c31 || cType == CardType.c32 || cType == CardType.c411 || cType == CardType.c422
|| cType == CardType.c11122234 || cType == CardType.c1112223344) {
List a1 = Common.getOrder2©; // 我出的牌
List a2 = Common.getOrder2(currentlist);// 当前最大牌
if (Common.getValue(a1.get(0)) < Common.getValue(a2.get(0)))
return 0;
}
return 1;
}
// 按照重复次数排序
public static List getOrder2(List list) {
List list2 = new ArrayList(list);
List list3 = new ArrayList();
// List list4=new ArrayList();
int len = list2.size();
int a[] = new int[20];// 记录数
for (int i = 0; i < 20; i++)
a[i] = 0;
for (int i = 0; i < len; i++) {
a[Common.getValue(list2.get(i))]++;
}
int max = 0;
for (int i = 0; i < 20; i++) {
max = 0;
for (int j = 19; j >= 0; j–) {
if (a[j] > a[max])
max = j;
}
for (int k = 0; k < len; k++) {
if (Common.getValue(list2.get(k)) == max) {
list3.add(list2.get(k));
}
}
list2.remove(list3);
a[max] = 0;
}
return list3;
}
}
class Card_index {
List a[] = new ArrayList[4];// 单张
}
Model.java
package com.sjsq;
import java.util.ArrayList;
import java.util.List;
/**
-
扑克类型List类
-
@author shuijianshiqing
-
@date 2020-09-09 20:47
*/
public class Model {
//一组牌
int value; //权值
int num;// 手数 (几次能够走完,没有挡的情况下)
List a1=new ArrayList(); //单张
List a2=new ArrayList(); //对子
List a3=new ArrayList(); //3带
List a123=new ArrayList(); //连子
List a112233=new ArrayList(); //连牌
List a111222=new ArrayList(); //飞机
List a4=new ArrayList(); //炸弹
}
NewSwing.java
package com.sjsq;
import javax.swing.SwingUtilities;
public class NewSwing {
}
Time.java
package com.sjsq;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
public class Time extends Thread {
Main main;
boolean isRun = true;
int i = 10;
public Time(Main m, int i) {
this.main = m;
this.i = i;
}
@Override
public void run() {
while (i > -1 && isRun) {
main.time[1].setText(“倒计时:” + i–);
second(1);// 等一秒
}
if (i == -1)// 正常终结,说明超时
main.time[1].setText(“不抢”);
main.landlord[0].setVisible(false);
main.landlord[1].setVisible(false);
for (Card card2 : main.playerList[1])
card2.canClick = true;// 可被点击
// 如果自己抢到地主
if (main.time[1].getText().equals(“抢地主”)) {
// 得到地主牌
main.playerList[1].addAll(main.lordList);
openlord(true);
second(2);// 等待五秒
Common.order(main.playerList[1]);
Common.rePosition(main, main.playerList[1], 1);
setlord(1);
} else {
// 电脑选地主
if (Common.getScore(main.playerList[0]) < Common.getScore(main.playerList[2])) {
main.time[2].setText(“抢地主”);
main.time[2].setVisible(true);
setlord(2);// 设定地主
openlord(true);// 把地主牌翻开
second(3);
main.playerList[2].addAll(main.lordList);
Common.order(main.playerList[2]);
Common.rePosition(main, main.playerList[2], 2);
openlord(false);
} else {
main.time[0].setText(“抢地主”);
main.time[0].setVisible(true);
setlord(0);// 设定地主
openlord(true);
second(3);
main.playerList[0].addAll(main.lordList);
Common.order(main.playerList[0]);
Common.rePosition(main, main.playerList[0], 0);
// openlord(false);
}
}
// 选完地主后 关闭地主按钮
main.landlord[0].setVisible(false);
main.landlord[1].setVisible(false);
turnOn(false);
for (int i = 0; i < 3; i++) {
main.time[i].setText(“不要”);
main.time[i].setVisible(false);
}
// 开始游戏 根据地主不同顺序不同
main.turn = main.dizhuFlag;
while (true) {
if (main.turn == 1) // 我
{
turnOn(true);// 出牌按钮 --我出牌
timeWait(30, 1);// 我自己的定时器
System.out.println(“我出牌”);
turnOn(false);// 选完关闭
main.turn = (main.turn + 1) % 3;
if (win())// 判断输赢
break;
}
if (main.turn == 0) {
computer0();
main.turn = (main.turn + 1) % 3;
if (win())// 判断输赢
break;
}
if (main.turn == 2) {
computer2();
main.turn = (main.turn + 1) % 3;
if (win())// 判断输赢
break;
}
}
}
// 等待i秒
public void second(int i) {
try {
Thread.sleep(i * 1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// 地主牌翻看
public void openlord(boolean is) {
for (int i = 0; i < 3; i++) {
if (is)
main.lordList.get(i).turnFront(); // 地主牌翻看
else {
main.lordList.get(i).turnRear(); // 地主牌闭合
}
main.lordList.get(i).canClick = true;// 可被点击
}
}
// 设定地主
public void setlord(int i) {
Point point = new Point();
if (i == 1)// 我是地主
{
point.x = 80;
point.y = 430;
main.dizhuFlag = 1;// 设定地主
}
if (i == 0) {
point.x = 80;
point.y = 20;
main.dizhuFlag = 0;
}
if (i == 2) {
point.x = 700;
point.y = 20;
main.dizhuFlag = 2;
}
main.dizhu.setLocation(point);
main.dizhu.setVisible(true);
}
// 打开出牌按钮
public void turnOn(boolean flag) {
main.publishCard[0].setVisible(flag);
main.publishCard[1].setVisible(flag);
}
// 电脑0走牌(我代表1)
public void computer0() {
timeWait(3, 0); // 定时
ShowCard(0); // 出牌
}
// 电脑2走牌(我代表1)
public void computer2() {
timeWait(3, 2); // 定时
ShowCard(2); // 出牌
}
// 走牌
public void ShowCard(int role) {
Model model = Common.getModel(main.playerList[role]);
// 待走的牌
List list = new ArrayList();
// 如果是主动出牌
if (main.time[(role + 1) % 3].getText().equals(“不要”) && main.time[(role + 2) % 3].getText().equals(“不要”)) {
// 有单出单 (除开3带,飞机能带的单牌)
if (model.a1.size() > (model.a111222.size() * 2 + model.a3.size())) {
list.add(model.a1.get(model.a1.size() - 1));
} // 有对子出对子 (除开3带,飞机)
else if (model.a2.size() > (model.a111222.size() * 2 + model.a3.size())) {
list.add(model.a2.get(model.a2.size() - 1));
} // 有顺子出顺子
else if (model.a123.size() > 0) {
list.add(model.a123.get(model.a123.size() - 1));
} // 有3带就出3带,没有就出光3
else if (model.a3.size() > 0) {
// 3带单,且非关键时刻不能带王,2
if (model.a1.size() > 0) {
list.add(model.a1.get(model.a1.size() - 1));
} // 3带对
else if (model.a2.size() > 0) {
list.add(model.a2.get(model.a2.size() - 1));
}
list.add(model.a3.get(model.a3.size() - 1));
} // 有双顺出双顺
else if (model.a112233.size() > 0) {
list.add(model.a112233.get(model.a112233.size() - 1));
} // 有飞机出飞机
else if (model.a111222.size() > 0) {
String name[] = model.a111222.get(0).split(“,”);
// 带单
if (name.length / 3 <= model.a1.size()) {
list.add(model.a111222.get(model.a111222.size() - 1));
for (int i = 0; i < name.length / 3; i++)
list.add(model.a1.get(i));
} else if (name.length / 3 <= model.a2.size())// 带双
{
list.add(model.a111222.get(model.a111222.size() - 1));
for (int i = 0; i < name.length / 3; i++)
list.add(model.a2.get(i));
}
// 有炸弹出炸弹
} else if (model.a4.size() > 0) {
// 4带2,1
int sizea1 = model.a1.size();
int sizea2 = model.a2.size();
if (sizea1 >= 2) {
list.add(model.a1.get(sizea1 - 1));
list.add(model.a1.get(sizea1 - 2));
list.add(model.a4.get(0));
} else if (sizea2 >= 2) {
list.add(model.a2.get(sizea1 - 1));
list.add(model.a2.get(sizea1 - 2));
list.add(model.a4.get(0));
} else {// 直接炸
list.add(model.a4.get(0));
}
}
} // 如果是跟牌
else {
-
List player = main.currentList[(role + 2) % 3].size() > 0 ? main.currentList[(role + 2) % 3]
- main.currentList[(role + 1) % 3];// 当前出的牌
CardType cType = Common.jugdeType(player);// 桌面别人出的牌
// 如果是单牌
if (cType == CardType.c1) {
AI_1(model.a1, player, list, role);
} // 如果是对子
else if (cType == CardType.c2) {
AI_1(model.a2, player, list, role);
} // 3带
else if (cType == CardType.c3) {
AI_1(model.a3, player, list, role);
} // 炸弹
else if (cType == CardType.c4) {
AI_1(model.a4, player, list, role);
} // 如果是3带1
else if (cType == CardType.c31) {
// 偏家 涉及到拆牌
// if((role+1)%3==main.dizhuFlag)
AI_2(model.a3, model.a1, player, list, role);
} // 如果是3带2
else if (cType == CardType.c32) {
// 偏家
// if((role+1)%3==main.dizhuFlag)
AI_2(model.a3, model.a2, player, list, role);
} // 如果是4带11
else if (cType == CardType.c411) {
AI_5(model.a4, model.a1, player, list, role);
}
// 如果是4带22
else if (cType == CardType.c422) {
AI_5(model.a4, model.a2, player, list, role);
}
// 顺子
else if (cType == CardType.c123) {
AI_3(model.a123, player, list, role);
}
// 双顺
else if (cType == CardType.c1122) {
AI_3(model.a112233, player, list, role);
}
// 飞机带单
else if (cType == CardType.c11122234) {
AI_4(model.a111222, model.a1, player, list, role);
}
// 飞机带对
else if (cType == CardType.c1112223344) {
AI_4(model.a111222, model.a2, player, list, role);
}
// 炸弹
if (list.size() == 0) {
int len4 = model.a4.size();
if (len4 > 0)
list.add(model.a4.get(len4 - 1));
}
}
// 定位出牌
main.currentList[role].clear();
if (list.size() > 0) {
Point point = new Point();
if (role == 0)
point.x = 200;
if (role == 2)
point.x = 550;
point.y = (400 / 2) - (list.size() + 1) * 15 / 2;// 屏幕中部
// 将name转换成Card
for (int i = 0, len = list.size(); i < len; i++) {
List cards = getCardByName(main.playerList[role], list.get(i));
for (Card card : cards) {
Common.move(card, card.getLocation(), point, 10);
point.y += 15;
main.currentList[role].add(card);
main.playerList[role].remove(card);
}
}
Common.rePosition(main, main.playerList[role], role);
} else {
main.time[role].setVisible(true);
main.time[role].setText(“不要”);
}
for (Card card : main.currentList[role])
card.turnFront();
}
// 按name获得Card,方便从Model取出
public List getCardByName(List list, String n) {
String[] name = n.split(“,”);
List cardsList = new ArrayList();
int j = 0;
for (int i = 0, len = list.size(); i < len; i++) {
if (j < name.length && list.get(i).name.equals(name[j])) {
cardsList.add(list.get(i));
i = 0;
j++;
}
}
return cardsList;
}
// 顺子
public void AI_3(List model, List player, List list, int role) {
for (int i = 0, len = model.size(); i < len; i++) {
String[] s = model.get(i).split(“,”);
if (s.length == player.size() && getValueInt(model.get(i)) > Common.getValue(player.get(0))) {
list.add(model.get(i));
return;
}
}
}
// 飞机带单,双
public void AI_4(List model1, List model2, List player, List list, int role) {
// 排序按重复数
player = Common.getOrder2(player);
int len1 = model1.size();
int len2 = model2.size();
if (len1 < 1 || len2 < 1)
return;
for (int i = 0; i < len1; i++) {
String[] s = model1.get(i).split(“,”);
String[] s2 = model2.get(0).split(“,”);
if ((s.length / 3 <= len2) && (s.length * (3 + s2.length) == player.size())
&& getValueInt(model1.get(i)) > Common.getValue(player.get(0))) {
list.add(model1.get(i));
for (int j = 1; j <= s.length / 3; j++)
list.add(model2.get(len2 - j));
}
}
}
// 4带1,2
public void AI_5(List model1, List model2, List player, List list, int role) {
// 排序按重复数
player = Common.getOrder2(player);
int len1 = model1.size();
int len2 = model2.size();
if (len1 < 1 || len2 < 2)
return;
for (int i = 0; i < len1; i++) {
if (getValueInt(model1.get(i)) > Common.getValue(player.get(0))) {
list.add(model1.get(i));
for (int j = 1; j <= 2; j++)
list.add(model2.get(len2 - j));
}
}
}
// 单牌,对子,3个,4个,通用
public void AI_1(List model, List player, List list, int role) {
// 顶家
if ((role + 1) % 3 == main.dizhuFlag) {
for (int i = 0, len = model.size(); i < len; i++) {
if (getValueInt(model.get(i)) > Common.getValue(player.get(0))) {
list.add(model.get(i));
break;
}
}
} else {// 偏家
for (int len = model.size(), i = len - 1; i >= 0; i–) {
if (getValueInt(model.get(i)) > Common.getValue(player.get(0))) {
list.add(model.get(i));
break;
}
}
}
}
// 3带1,2,4带1,2
public void AI_2(List model1, List model2, List player, List list, int role) {
// model1是主牌,model2是带牌,player是玩家出的牌,list是准备回的牌
// 排序按重复数
player = Common.getOrder2(player);
int len1 = model1.size();
int len2 = model2.size();
// 如果有王直接炸了
if (len1 > 0 && model1.get(0).length() < 10) {
list.add(model1.get(0));
System.out.println(“王炸”);
return;
}
if (len1 < 1 || len2 < 1)
return;
for (int len = len1, i = len - 1; i >= 0; i–) {
if (getValueInt(model1.get(i)) > Common.getValue(player.get(0))) {
list.add(model1.get(i));
break;
}
}
list.add(model2.get(len2 - 1));
if (list.size() < 2)
list.clear();
}
// 延时,模拟时钟
public void timeWait(int n, int player) {
if (main.currentList[player].size() > 0)
Common.hideCards(main.currentList[player]);
if (player == 1)// 如果是我,10秒到后直接下一家出牌
{
int i = n;
while (main.nextPlayer == false && i >= 0) {
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
second(1);
i–;
}
if (i == -1) {
main.time[player].setText(“超时”);
}
main.nextPlayer = false;
} else {
for (int i = n; i >= 0; i–) {
second(1);
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
}
}
main.time[player].setVisible(false);
}
// 通过name估值
public int getValueInt(String n) {
String name[] = n.split(“,”);
String s = name[0];
int i = Integer.parseInt(s.substring(2, s.length()));
if (s.substring(0, 1).equals(“5”))
i += 3;
if (s.substring(2, s.length()).equals(“1”) || s.substring(2, s.length()).equals(“2”))
i += 13;
最后
由于篇幅原因,就不多做展示了
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
}
// 延时,模拟时钟
public void timeWait(int n, int player) {
if (main.currentList[player].size() > 0)
Common.hideCards(main.currentList[player]);
if (player == 1)// 如果是我,10秒到后直接下一家出牌
{
int i = n;
while (main.nextPlayer == false && i >= 0) {
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
second(1);
i–;
}
if (i == -1) {
main.time[player].setText(“超时”);
}
main.nextPlayer = false;
} else {
for (int i = n; i >= 0; i–) {
second(1);
// main.container.setComponentZOrder(main.time[player], 0);
main.time[player].setText(“倒计时:” + i);
main.time[player].setVisible(true);
}
}
main.time[player].setVisible(false);
}
// 通过name估值
public int getValueInt(String n) {
String name[] = n.split(“,”);
String s = name[0];
int i = Integer.parseInt(s.substring(2, s.length()));
if (s.substring(0, 1).equals(“5”))
i += 3;
if (s.substring(2, s.length()).equals(“1”) || s.substring(2, s.length()).equals(“2”))
i += 13;
最后
[外链图片转存中…(img-fp25RSjy-1713599618030)]
[外链图片转存中…(img-JeG8TXqD-1713599618031)]
[外链图片转存中…(img-YEhBz0PM-1713599618031)]
[外链图片转存中…(img-3TnWGBbw-1713599618032)]
[外链图片转存中…(img-v3SgVOXg-1713599618032)]
[外链图片转存中…(img-29S6RXHR-1713599618033)]
由于篇幅原因,就不多做展示了
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
[外链图片转存中…(img-uXT2PYXc-1713599618033)]
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!