总结
一般像这样的大企业都有好几轮面试,所以自己一定要花点时间去收集整理一下公司的背景,公司的企业文化,俗话说「知己知彼百战不殆」,不要盲目的去面试,还有很多人关心怎么去跟HR谈薪资。
这边给大家一个建议,如果你的理想薪资是30K,你完全可以跟HR谈33~35K,而不是一下子就把自己的底牌暴露了出来,不过肯定不能说的这么直接,比如原来你的公司是25K,你可以跟HR讲原来的薪资是多少,你们这边能给到我的是多少?你说我这边希望可以有一个20%涨薪。
最后再说几句关于招聘平台的,总之,简历投递给公司之前,请确认下这家公司到底咋样,先去百度了解下,别被坑了,每个平台都有一些居心不良的广告党等着你上钩,千万别上当!!!
Java架构学习资料,学习技术内容包含有:Spring,Dubbo,MyBatis, RPC, 源码分析,高并发、高性能、分布式,性能优化,微服务 高级架构开发等等。
还有Java核心知识点+全套架构师学习资料和视频+一线大厂面试宝典+面试简历模板可以领取+阿里美团网易腾讯小米爱奇艺快手哔哩哔哩面试题+Spring源码合集+Java架构实战电子书。
public class Tetromino {
public Cell[] cells = new Cell[4];
//旋转的状态
protected State[] states;
//声明旋转次数
protected int count = 10000;
//左移方法
public void moveLeft() {
for (Cell cell : cells) {
cell.left();
}
}
//右移方法
public void moveRight() {
for (Cell cell : cells) {
cell.right();
}
}
//单元格下落
public void moveDrop() {
for (Cell cell : cells) {
cell.down();
}
}
//编写随机生成四方格
public static Tetromino randomOne() {
int num = (int) (Math.random() * 7);
Tetromino tetromino = null;
switch (num) {
case 0:
tetromino = new I();
break;
case 1:
tetromino = new J();
break;
case 2:
tetromino = new L();
break;
case 3:
tetromino = new O();
break;
case 4:
tetromino = new S();
break;
case 5:
tetromino = new T();
break;
case 6:
tetromino = new Z();
break;
}
return tetromino;
}
//顺时针旋转的方法
public void rotateRight() {
if (states.length == 0) {
return;
}
//旋转次数+1
count++;
State s = states[count % states.length];
Cell cell = cells[0];
int row = cell.getRow();
int col = cell.getCol();
cells[1].setRow(row + s.row1);
cells[1].setCol(col + s.col1);
cells[2].setRow(row + s.row2);
cells[2].setCol(col + s.col2);
cells[3].setRow(row + s.row3);
cells[3].setCol(col + s.col3);
}
//逆时针旋转的方法
public void rotateLeft() {
if (states.length == 0) {
return;
}
//旋转次数+1
count--;
State s = states[count % states.length];
Cell cell = cells[0];
int row = cell.getRow();
int col = cell.getCol();
cells[1].setRow(row + s.row1);
cells[1].setCol(col + s.col1);
cells[2].setRow(row + s.row2);
cells[2].setCol(col + s.col2);
cells[3].setRow(row + s.row3);
cells[3].setCol(col + s.col3);
}
//四方格旋转状态的内部类
protected class State {
//存储四方格各元素的位置
int row0, col0, row1, col1, row2, col2, row3, col3;
public State() {
}
public State(int row0, int col0, int row1, int col1, int row2, int col2, int row3, int col3) {
this.row0 = row0;
this.col0 = col0;
this.row1 = row1;
this.col1 = col1;
this.row2 = row2;
this.col2 = col2;
this.row3 = row3;
this.col3 = col3;
}
public int getRow0() {
return row0;
}
public void setRow0(int row0) {
this.row0 = row0;
}
public int getCol0() {
return col0;
}
public void setCol0(int col0) {
this.col0 = col0;
}
public int getRow1() {
return row1;
}
public void setRow1(int row1) {
this.row1 = row1;
}
public int getCol1() {
return col1;
}
public void setCol1(int col1) {
this.col1 = col1;
}
public int getRow2() {
return row2;
}
public void setRow2(int row2) {
this.row2 = row2;
}
public int getCol2() {
return col2;
}
public void setCol2(int col2) {
this.col2 = col2;
}
public int getRow3() {
return row3;
}
public void setRow3(int row3) {
this.row3 = row3;
}
public int getCol3() {
return col3;
}
public void setCol3(int col3) {
this.col3 = col3;
}
@Override
public String toString() {
return "State{" +
"row0=" + row0 +
", col0=" + col0 +
", row1=" + row1 +
", col1=" + col1 +
", row2=" + row2 +
", col2=" + col2 +
", row3=" + row3 +
", col3=" + col3 +
'}';
}
}
}
七种图形类:I、J、L、O、S、T、Z
public class I extends Tetromino {
public I() {
cells[0] = new Cell(0,4, Tetris.I);
cells[1] = new Cell(0,3, Tetris.I);
cells[2] = new Cell(0,5, Tetris.I);
cells[3] = new Cell(0,6, Tetris.I);
//共有两种旋转状态
states =new State[2];
//初始化两种状态的相对坐标
states[0]=new State(0,0,0,-1,0,1,0,2);
states[1]=new State(0,0,-1,0,1,0,2,0);
}
}
public class J extends Tetromino {
public J() {
cells[0] = new Cell(0,4, Tetris.J);
cells[1] = new Cell(0,3, Tetris.J);
cells[2] = new Cell(0,5, Tetris.J);
cells[3] = new Cell(1,5, Tetris.J);
states=new State[4];
states[0]=new State(0,0,0,-1,0,1,1,1);
states[1]=new State(0,0,-1,0,1,0,1,-1);
states[2]=new State(0,0,0,1,0,-1,-1,-1);
states[3]=new State(0,0,1,0,-1,0,-1,1);
}
}
public class L extends Tetromino {
public L() {
cells[0] = new Cell(0,4, Tetris.L);
cells[1] = new Cell(0,3, Tetris.L);
cells[2] = new Cell(0,5, Tetris.L);
cells[3] = new Cell(1,3, Tetris.L);
states=new State[4];
states[0]=new State(0,0,0,-1,0,1,1,-1);
states[1]=new State(0,0,-1,0,1,0,-1,-1);
states[2]=new State(0,0,0,1,0,-1,-1,1);
states[3]=new State(0,0,1,0,-1,0,1,1);
}
}
public class O extends Tetromino {
public O() {
cells[0] = new Cell(0, 4, Tetris.O);
cells[1] = new Cell(0, 5, Tetris.O);
cells[2] = new Cell(1, 4, Tetris.O);
cells[3] = new Cell(1, 5, Tetris.O);
//无旋转状态
states = new State[0];
}
}
public class S extends Tetromino {
public S() {
cells[0] = new Cell(0,4, Tetris.S);
cells[1] = new Cell(0,5, Tetris.S);
cells[2] = new Cell(1,3, Tetris.S);
cells[3] = new Cell(1,4, Tetris.S);
//共有两种旋转状态
states =new State[2];
//初始化两种状态的相对坐标
states[0]=new State(0,0,0,1,1,-1,1,0);
states[1]=new State(0,0,1,0,-1,-1,0,-1);
}
}
public class T extends Tetromino {
public T() {
cells[0] = new Cell(0,4, Tetris.T);
cells[1] = new Cell(0,3, Tetris.T);
cells[2] = new Cell(0,5, Tetris.T);
cells[3] = new Cell(1,4, Tetris.T);
states=new State[4];
states[0]=new State(0,0,0,-1,0,1,1,0);
states[1]=new State(0,0,-1,0,1,0,0,-1);
states[2]=new State(0,0,0,1,0,-1,-1,0);
states[3]=new State(0,0,1,0,-1,0,0,1);
}
}
public class Z extends Tetromino {
public Z() {
cells[0] = new Cell(1,4, Tetris.Z);
cells[1] = new Cell(0,3, Tetris.Z);
cells[2] = new Cell(0,4, Tetris.Z);
cells[3] = new Cell(1,5, Tetris.Z);
//共有两种旋转状态
states =new State[2];
//初始化两种状态的相对坐标
states[0]=new State(0,0,-1,-1,-1,0,0,1);
states[1]=new State(0,0,-1,1,0,1,1,0);
}
}
俄罗斯方块游戏主类:Tetris
public class Tetris extends JPanel {
//正在下落的方块
private Tetromino currentOne = Tetromino.randomOne();
//将要下落的方块
private Tetromino nextOne = Tetromino.randomOne();
//游戏主区域
private Cell[][] wall = new Cell[18][9];
//声明单元格的值
private static final int CELL_SIZE = 48;
//游戏分数池
int[] scores_pool = {0, 1, 2, 5, 10};
//当前游戏的分数
private int totalScore = 0;
//当前消除的行数
private int totalLine = 0;
//游戏三种状态 游戏中、暂停、结束
public static final int PLING = 0;
public static final int STOP = 1;
public static final int OVER = 2;
//当前游戏状态值
private int game_state;
//显示游戏状态
String[] show_state = {"P[pause]", "C[continue]", "S[replay]"};
//载入方块图片
public static BufferedImage I;
public static BufferedImage J;
public static BufferedImage L;
public static BufferedImage O;
public static BufferedImage S;
public static BufferedImage T;
public static BufferedImage Z;
public static BufferedImage background;
static {
try {
I = ImageIO.read(new File("images/I.png"));
J = ImageIO.read(new File("images/J.png"));
L = ImageIO.read(new File("images/L.png"));
O = ImageIO.read(new File("images/O.png"));
S = ImageIO.read(new File("images/S.png"));
T = ImageIO.read(new File("images/T.png"));
Z = ImageIO.read(new File("images/Z.png"));
background = ImageIO.read(new File("images/background.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void paint(Graphics g) {
g.drawImage(background, 0, 0, null);
//平移坐标轴
g.translate(22, 15);
//绘制游戏主区域
paintWall(g);
//绘制正在下落的四方格
paintCurrentOne(g);
//绘制下一个将要下落的四方格
paintNextOne(g);
//绘制游戏得分
paintSource(g);
//绘制当前游戏状态
paintState(g);
}
public void start() {
game_state = PLING;
KeyListener l = new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
int code = e.getKeyCode();
switch (code) {
case KeyEvent.VK_DOWN:
sortDropActive();
break;
case KeyEvent.VK_LEFT:
moveleftActive();
break;
case KeyEvent.VK_RIGHT:
moveRightActive();
break;
case KeyEvent.VK_UP:
rotateRightActive();
break;
case KeyEvent.VK_SPACE:
hadnDropActive();
break;
case KeyEvent.VK_P:
//判断当前游戏状态
if (game_state == PLING) {
game_state = STOP;
}
break;
case KeyEvent.VK_C:
if (game_state == STOP) {
game_state = PLING;
}
break;
case KeyEvent.VK_S:
//重新开始
game_state = PLING;
wall = new Cell[18][9];
currentOne = Tetromino.randomOne();
nextOne = Tetromino.randomOne();
totalScore = 0;
totalLine = 0;
break;
}
}
};
//将窗口设置为焦点
this.addKeyListener(l);
this.requestFocus();
while (true) {
if (game_state == PLING) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (camDrop()) {
currentOne.moveDrop();
} else {
landToWall();
destroyLine();
if (isGameOver()) {
game_state = OVER;
} else {
//游戏没有结束
currentOne = nextOne;
nextOne = Tetromino.randomOne();
}
}
}
repaint();
}
}
//创建顺时针旋转
public void rotateRightActive() {
currentOne.rotateRight();
if (outOFBounds() || coincide()) {
currentOne.rotateLeft();
}
}
//瞬间下落
public void hadnDropActive() {
while (true) {
//判断能否下落
if (camDrop()) {
currentOne.moveDrop();
} else {
break;
}
}
//嵌入到墙中
landToWall();
destroyLine();
if (isGameOver()) {
game_state = OVER;
} else {
//游戏没有结束
currentOne = nextOne;
nextOne = Tetromino.randomOne();
}
}
//按键一次,下落一格
public void sortDropActive() {
if (camDrop()) {
//当前四方格下落一格
currentOne.moveDrop();
} else {
landToWall();
destroyLine();
if (isGameOver()) {
game_state = OVER;
} else {
//游戏没有结束
currentOne = nextOne;
nextOne = Tetromino.randomOne();
}
}
}
//单元格嵌入墙中
private void landToWall() {
Cell[] cells = currentOne.cells;
for (Cell cell : cells) {
# 总结
谈到面试,其实说白了就是刷题刷题刷题,天天作死的刷。。。。。
为了准备这个“金三银四”的春招,狂刷一个月的题,狂补超多的漏洞知识,像这次美团面试问的算法、数据库、Redis、设计模式等这些题目都是我刷到过的
**并且我也将自己刷的题全部整理成了PDF或者Word文档(含详细答案解析)**
![我的美团offer凉凉了?开发工程师(Java岗)三面结束等通知...](https://img-blog.csdnimg.cn/img_convert/f0b3dd23004b1340aee9e0c3d6743d14.webp?x-oss-process=image/format,png)
66个Java面试知识点
**架构专题(MySQL,Java,Redis,线程,并发,设计模式,Nginx,Linux,框架,微服务等)+大厂面试题详解(百度,阿里,腾讯,华为,迅雷,网易,中兴,北京中软等)**
![我的美团offer凉凉了?开发工程师(Java岗)三面结束等通知...](https://img-blog.csdnimg.cn/img_convert/37322aac01544d9103d58feb2f0e8da6.webp?x-oss-process=image/format,png)
**算法刷题(PDF)**
![我的美团offer凉凉了?开发工程师(Java岗)三面结束等通知...](https://img-blog.csdnimg.cn/img_convert/a04d9e163630712e6777d18c2e6f5c6e.webp?x-oss-process=image/format,png)
> **本文已被[CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**
**[需要这份系统化的资料的朋友,可以点击这里获取](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)**
l();
destroyLine();
if (isGameOver()) {
game_state = OVER;
} else {
//游戏没有结束
currentOne = nextOne;
nextOne = Tetromino.randomOne();
}
}
}
//单元格嵌入墙中
private void landToWall() {
Cell[] cells = currentOne.cells;
for (Cell cell : cells) {
# 总结
谈到面试,其实说白了就是刷题刷题刷题,天天作死的刷。。。。。
为了准备这个“金三银四”的春招,狂刷一个月的题,狂补超多的漏洞知识,像这次美团面试问的算法、数据库、Redis、设计模式等这些题目都是我刷到过的
**并且我也将自己刷的题全部整理成了PDF或者Word文档(含详细答案解析)**
[外链图片转存中...(img-M9bwsfrp-1715568437908)]
66个Java面试知识点
**架构专题(MySQL,Java,Redis,线程,并发,设计模式,Nginx,Linux,框架,微服务等)+大厂面试题详解(百度,阿里,腾讯,华为,迅雷,网易,中兴,北京中软等)**
[外链图片转存中...(img-sS6iHiwG-1715568437908)]
**算法刷题(PDF)**
[外链图片转存中...(img-gcLfEbSR-1715568437908)]
> **本文已被[CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**
**[需要这份系统化的资料的朋友,可以点击这里获取](https://bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)**