求一套中国象棋比较合理的局面评估函数

最近做一个中国象棋人机对弈,局面评估函数不知道怎么写。不用很复杂考虑到动态位置对子力的改变,只要每个棋子在各个位置的子力就可以了,不然自己不知道怎么设置比较合理,感谢~

1个回答

PC游戏编程---人机博弈有讲象棋和五子棋的 比较基础

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求解中国象棋规则问题

在unity中象棋怎么控制走法规则,新手求指导。用的是c#,现在基本能够达到移动棋子,但时是定义规则走法的时候不知道怎么做。

求关于c++象棋残局算法的资料

黑方只剩一个老将,红方剩下若干个棋子;下一步轮到黑方走,问他走到的那一步是否能逃命! 逃过当前的追杀就好,不管再走下去如何! 也就是说,他走了一步,如果红方一步就杀掉他,那就说出YES;否则输出NO! 车:走法,走直线,可以吃点在直线上相对的那个棋子 炮:隔人打,中间隔一个人,打后面的人;中间的人相当于炮架子 老将:一般不出城堡,如果像个老将相对了,中间没有间隔吗,那么老将可以吃掉对方 马:马走”日”字,注意蹩马腿!

关于中国象棋程序里面的阿尔法贝塔剪枝算法的缺点

如题, 最近在研究中国象棋,参考中国象棋程序一书的代码, 利用阿尔法贝塔剪枝法实现了简单的象棋程序, 后发现基于此算法的象棋程序有一定缺陷, 如果红方不主动进攻,黑方(AI)将不会进攻,只会不断地上士或者出将, 应该怎么解决呢?

unity2d象棋求求求 !!!!!!!!

有大神用unity做过中国象棋吗 有几个很基础的问题搞不懂 就是这篇文章的 SpriteRenderer 那部分 看不懂 求救! https://blog.csdn.net/sinat_24994943/article/details/54895270 有哪个大神有经验的 求了 !!!

急,跪求大神【JAVA】从零基础到能自己编写一个小型象棋游戏要掌握多少知识

急,跪求大神【JAVA】从零基础到能自己编写一个小型象棋游戏要掌握多少知识 请教一下,领导给布置了个任务,要求尽快自学java编写出一个象棋或者围棋的小游戏,自己本身在大学学过一点些入门知识,请教大神们要完成这个任务要掌握到什么程度,并且得配合哪些方面的学习,谢谢

用MFC编写中国象棋棋盘

VS2010自动生成几个基础代码 怎样进行改写绘制象棋棋盘和棋子

如何用纯C++编写国际象棋程序?

编写程序,实现国际象棋游戏,要求: (1)实现国际象棋游戏的各个规则。 (2)使用图形函数生成棋盘等。 (3)用文件存储用户的进度。 (4)用户开始新游戏时,先检测是否有历史记录,有的话可以继续未完成的棋局,也可以重新开始。 (5)实现用户排名功能。

alphaBeta算法做象棋还是很笨而且很卡,有没有好的AI算法效率还不错的

有没有对算法非常了解的大神,小弟在学做一个cocos2dx象棋游戏中使AI困难模式的算法使用alphaBetaSearch搜索算法,不过本人对这个算法的了解不是很深,整个游戏框架基本搭建完成,但是就算使用了减枝优化后,实际运行的时候还是卡的有点久AI才做出反应,有没有在此基础上还可以优化的方法。有懂算法的大神可以点播一下么。 我总觉得按他们那个alphaBeta算法做象棋AI还是很笨,我随随便便就下赢了,我是想这个作为我的论文的,到时候答辩要是他们专挑这些毛病,说什么AI怎么这么笨啊什么的我觉得就很不爽。。。。。。。。。。哎。。。我们那些老师就喜欢挑刺所以我想尽力做到接近目前我能理解的完美,有木有好的算法呢。

JAVA象棋棋子的算法怎么算的啊,大神们求助

需要个有点注释的,新手求助,谢谢了。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

基于HTML5的象棋对战系统

要做一个基于HTML5的象棋对战系统,要求实现玩家与玩家之间的对战以及战绩的存储查询,有没有大神提供思路?感激不尽。

中国象棋问题

Xiangqi is one of the most popular two-player board games in China. The game represents a battle between two armies with the goal of capturing the enemy’s “general” piece. In this problem, you are given a situation of later stage in the game. Besides, the red side has already “delivered a check”. Your work is to check whether the situation is “checkmate”. ![](http://acm.hdu.edu.cn/data/images/4121-5.jpg) Now we introduce some basic rules of Xiangqi. Xiangqi is played on a 10×9 board and the pieces are placed on the intersections (points). The top left point is (1,1) and the bottom right point is (10,9). There are two groups of pieces marked by black or red Chinese characters, belonging to the two players separately. During the game, each player in turn moves one piece from the point it occupies to another point. No two pieces can occupy the same point at the same time. A piece can be moved onto a point occupied by an enemy piece, in which case the enemy piece is "captured" and removed from the board. When the general is in danger of being captured by the enemy player on the enemy player’s next move, the enemy player is said to have "delivered a check". If the general's player can make no move to prevent the general's capture by next enemy move, the situation is called “checkmate”. ![](http://acm.hdu.edu.cn/data/images/4121-6.jpg) We only use 4 kinds of pieces introducing as follows: General: the generals can move and capture one point either vertically or horizontally and cannot leave the “palace” unless the situation called “flying general” (see the figure above). “Flying general” means that one general can “fly” across the board to capture the enemy general if they stand on the same line without intervening pieces. Chariot: the chariots can move and capture vertically and horizontally by any distance, but may not jump over intervening pieces Cannon: the cannons move like the chariots, horizontally and vertically, but capture by jumping exactly one piece (whether it is friendly or enemy) over to its target. Horse: the horses have 8 kinds of jumps to move and capture shown in the left figure. However, if there is any pieces lying on a point away from the horse horizontally or vertically it cannot move or capture in that direction (see the figure below), which is called “hobbling the horse’s leg”. Now you are given a situation only containing a black general, a red general and several red chariots, cannons and horses, and the red side has delivered a check. Now it turns to black side’s move. Your job is to determine that whether this situation is “checkmate”. Input The input contains no more than 40 test cases. For each test case, the first line contains three integers representing the number of red pieces N (2<=N<=7) and the position of the black general. The following n lines contain details of N red pieces. For each line, there are a char and two integers representing the type and position of the piece (type char ‘G’ for general, ‘R’ for chariot, ‘H’ for horse and ‘C’ for cannon). We guarantee that the situation is legal and the red side has delivered the check. There is a blank line between two test cases. The input ends by 0 0 0. Output For each test case, if the situation is checkmate, output a single word ‘YES’, otherwise output the word ‘NO’. Sample Input 2 1 4 G 10 5 R 6 4 3 1 5 H 4 5 G 10 5 C 7 5 0 0 0 Sample Output YES NO

象棋棋盘上的移动的算法问题的解答,用C程序设计的语言的方式如何解决的?

Problem Description Another boring Friday afternoon, Betty the Beetle thinks how to amuse herself. She goes out of her hiding place to take a walk around the living room in Bennett's house. Mr. and Mrs. Bennett are out to the theatre and there is a chessboard on the table! "The best time to practice my chessboard dance," Betty thinks! She gets so excited that she does not note that there are some pieces left on the board and starts the practice session! She has a script showing her how to move on the chessboard. The script is a sequence like the following example: At each instant of time Betty, stands on a square of the chessboard, facing one of the four directions (up, down, left, right) when the board is viewed from the above. Performing a "move n" instruction, she moves n squares forward in her current direction. If moving n squares goes outside the board, she stays at the last square on the board and does not go out. There are three types of turns: turn right, turn left, and turn back, which change the direction of Betty. Note that turning does not change the position of Betty. If Betty faces a chess piece when moving, she pushes that piece, together with all other pieces behind (a tough beetle she is!). This may cause some pieces fall of the edge of the chessboard, but she doesn't care! For example, in the following figure, the left board shows the initial state and the right board shows the state after performing the script in the above example. Upper-case and lower-case letters indicate the white and black pieces respectively. The arrow shows the position of Betty along with her direction. Note that during the first move, the black king (r) falls off the right edge of the board! You are to write a program that reads the initial state of the board as well as the practice dance script, and writes the final state of the board after the practice. Input There are multiple test cases in the input. Each test case has two parts: the initial state of the board and the script. The board comes in eight lines of eight characters. The letters r, d, t, a, c, p indicate black pieces, R, D, T, A, C, P indicate the white pieces and the period (dot) character indicates an empty square. The square from which Betty starts dancing is specified by one of the four characters <, >, ^, and v which also indicates her initial direction (left, right, up, and down respectively). Note that the input is not necessarily a valid chess game status. The script comes immediately after the board. It consists of several lines (between 0 and 1000). In each line, there is one instruction in one of the following formats (n is a non-negative integer number): move n turn left turn right turn back At the end of each test case, there is a line containing a single # character. The last line of the input contains two dash characters. Output The output for each test case should show the state of the board in the same format as the input. Write an empty line in the output after each board. Sample Input .....c.. .p..A..t D..>T.Pr ....aP.P p.d.C... .....p.R ........ ........ move 2 turn right move 3 turn left turn left move 1 # -- Sample Output .....c.. .p..A..t D.....TP ....a..P p.d.C^.. .......R .....P.. .....p..

Chinese Chess 中国象棋的问题

Problem Description Winnie is very interested in chinese chess. Now, let's consider a game which is similar to it. There is a N * M chess board, we hope we can put rooks as more as possible. But just a certain number of postions can be put rooks on. One rook can attack another if they are in the same row or column. Now you may think this is a very simple problem for you. But as very whuacmers know, winnie is evil enough to cheat you. Let's consider some positions called critical postions. If we don't put rook on the critical position, the maximum number of rook we can put on this chess board will reduce. How many critical positions on the chess board? Input Input will contain multiple test cases. The first line contains three numbers N, M, K(N, M ≤ 10000, K ≤ 100000) which indicate height, width and number of positions which can be put rook on. Then next K lines follow, each contains two integer X ans Y which indicate we can put rook on the Xth row, Yth column. Output Output as follow: Board T have C important blanks for L chessmen. C indicate the number of critical positions ans L indicate the maximum rooks can be put. Sample Input 3 3 4 1 2 1 3 2 1 2 2 3 3 4 1 2 1 3 2 1 3 2 Sample Output Board 1 have 0 important blanks for 2 chessmen. Board 2 have 3 important blanks for 3 chessmen.

国际象棋的棋盘的移动方式,如何利用C语言的办法去解决的?

Problem Description Another boring Friday afternoon, Betty the Beetle thinks how to amuse herself. She goes out of her hiding place to take a walk around the living room in Bennett's house. Mr. and Mrs. Bennett are out to the theatre and there is a chessboard on the table! "The best time to practice my chessboard dance," Betty thinks! She gets so excited that she does not note that there are some pieces left on the board and starts the practice session! She has a script showing her how to move on the chessboard. The script is a sequence like the following example: At each instant of time Betty, stands on a square of the chessboard, facing one of the four directions (up, down, left, right) when the board is viewed from the above. Performing a "move n" instruction, she moves n squares forward in her current direction. If moving n squares goes outside the board, she stays at the last square on the board and does not go out. There are three types of turns: turn right, turn left, and turn back, which change the direction of Betty. Note that turning does not change the position of Betty. If Betty faces a chess piece when moving, she pushes that piece, together with all other pieces behind (a tough beetle she is!). This may cause some pieces fall of the edge of the chessboard, but she doesn't care! For example, in the following figure, the left board shows the initial state and the right board shows the state after performing the script in the above example. Upper-case and lower-case letters indicate the white and black pieces respectively. The arrow shows the position of Betty along with her direction. Note that during the first move, the black king (r) falls off the right edge of the board! You are to write a program that reads the initial state of the board as well as the practice dance script, and writes the final state of the board after the practice. Input There are multiple test cases in the input. Each test case has two parts: the initial state of the board and the script. The board comes in eight lines of eight characters. The letters r, d, t, a, c, p indicate black pieces, R, D, T, A, C, P indicate the white pieces and the period (dot) character indicates an empty square. The square from which Betty starts dancing is specified by one of the four characters <, >, ^, and v which also indicates her initial direction (left, right, up, and down respectively). Note that the input is not necessarily a valid chess game status. The script comes immediately after the board. It consists of several lines (between 0 and 1000). In each line, there is one instruction in one of the following formats (n is a non-negative integer number): move n turn left turn right turn back At the end of each test case, there is a line containing a single # character. The last line of the input contains two dash characters. Output The output for each test case should show the state of the board in the same format as the input. Write an empty line in the output after each board. Sample Input .....c.. .p..A..t D..>T.Pr ....aP.P p.d.C... .....p.R ........ ........ move 2 turn right move 3 turn left turn left move 1 # -- Sample Output .....c.. .p..A..t D.....TP ....a..P p.d.C^.. .......R .....P.. .....p..

国际象棋马的极小满覆盖!!急求算法描述!

有兄弟知道国际象棋马的极小满覆盖算法的吗,希望能介绍下算法!先谢过了!!

求问C编写国际象棋游戏人机博弈

c编写国际象棋人机博弈要怎么做?是要用到棋谱这些吗?要用到一些什么算法

为什么自己写的函数不能调用

如题,最近在研究一个象棋程序,按照中国象棋程序一书写的程序, 编译没有任何错误,可以运行,但是每次都是鼠标点击第二次的时候, 不能移动棋子,程序会卡崩溃。 调试发现是因为走法合理性检验 if (m_Board.LegalMove(mv)) 这一步过不去, 跳进函数里面看是因为num = GenAllMove(mvArray);这个语句过不去, 但是GenAllMove(mvArray)这个函数是我自己编写的函数,应该没什么问题呀 想问问大家怎么回事。。。 ps.其中genallmove()函数和 LegalMove()函数是在一个cpp里, 然后在主对话框cpp里面调用 //这是对话框里面的代码 if (from != NOMOVE) //如果已经先选中本方棋子 { move mv; mv.from = ((from/9 +3) *16 + from%9 +3); //将10*9的棋盘位置转换成16*16的棋盘位置 mv.to = ((dest/9 +3) *16 + dest%9 +3); int jy; jy=m_Board.LegalMove(mv); if (m_Board.LegalMove(mv)) //走法合理性检验,源位置z,目的位置k { m_Board.MakeMove(mv); m_interface[dest] = m_interface[from]; m_interface[from] = 0; m_SelectMoveTo = dest; RequireDrawCell(dest); m_SelectMoveFrom = from; //着重显示走法起始点 RequireDrawCell(from); //将源点及目的点重新显示 Beep(200,300); num = m_Board.HasLegalMove(); //判断胜负 if (!num) { KillTimer(m_RedTimer); m_gameState = GAMEOVER; MessageBox("红方获胜", "系统消息"); return; } KillTimer(m_RedTimer); m_gameState = BLACKTHINKING; PostMessage(WM_COMMAND, IDM_LET_COMPUTERTHINK); //这是判断走法合理性的代码 int CBoard::LegalMove(move mv) //判断走法是否合理 { move mvArray[128]; int num,i; num = GenAllMove(mvArray); for(i=0; i<num; i++) { if(mv.from == mvArray[i].from && mv.to == mvArray[i].to) return 1; } return 0; } //这是genallmove()的代码 int CBoard::GenAllMove(move *MoveArray)//生成所有走法 { short i,j,k; unsigned char p; //p->棋子位置 unsigned char n;//n 下一步可能行走的位置 unsigned char m;//马腿、象眼的位置 int SideTag;//走棋方标识,红16,黑32 int OverFlag;//炮翻山标识 move *mvArray = MoveArray; SideTag = 16+16*side; //将的走法 p=piece[SideTag];//将的位置 if(!p) //==if(p==null) return 0; for(k=0;k<4;k++)//4个方向 { n=p+KingDir[k]; if(LegalPosition[side][n] & PositionMask[0])//if里为非0值或true执行 { if(!(board[n] & SideTag))//目标位置上没有本方棋子 if(SaveMove(p,n,mvArray)) mvArray++; } } //士的走法 for(i=1;i<=2;i++) { p = piece[SideTag+i]; if(!p) continue; for(k=0;k<4;k++) { n= p +AdvisorDir[k]; if(LegalPosition[side][n] & PositionMask[1])//位置是否合理 { if(!(board[n] & SideTag))//没有本方棋子 if(SaveMove(p,n,mvArray)) mvArray++; } } } //象的走法 for(i=3;i>=4;i++) { p = piece[SideTag + i]; if(!p) continue; for(k=0;k<4;k++) { n = p +BishopDir[k]; if(!board[m]) //->if(board[m]=0)象眼位置没有棋子 { if(!(board[n] & SideTag)) //目标位置上没有本方棋子 if(SaveMove(p,n,mvArray)) mvArray++; } } } //马的走法 for(i=5;i<=6;i++) { p= piece[SideTag + i]; if(!p) continue; for(k=0;k<8;k++)//8个可能走法 { n = p+KnightDir[k]; if(LegalPosition[side][n] & PositionMask[3]) { m = p+KnightCheck[k]; if(!board[m])//没有蹩脚 { if(!(board[n] & SideTag))//目标位置没有自己棋子 if(SaveMove(p,n,mvArray)) mvArray++; } } } } //车的走法 for(i=7;i<=8;i++) { p= piece[SideTag + i]; if(!p) continue; for(k=0;k<4;k++)//四个方向 { for(j=1;j<10;j++)//横向最多8个可能位置,纵向最多9个可能位置 { n=p+j*RookDir[k]; if(!(LegalPosition[side][n] & PositionMask[4])) break;//如果位置不合理 结束 else if(!board[n] & SideTag) break;//如果目标位置上是本方棋子 结束 else { if(SaveMove(p,n,mvArray)) mvArray++; break; } } } } //炮的走法 for(i=9;i<=10;i++) { p = piece[SideTag + i]; if(!p) continue; for(k=0;k<4;k++) { OverFlag = 0;//初始翻山标志 for(j=1;j<10;j++) { n = p+j*CannonDir[k]; if(!(LegalPosition[side][n] & PositionMask[5])) break;//如果位置不合理 结束 if(!board[n])//如果目标位置没有棋子 { if(!OverFlag)//未翻山 if(SaveMove(p,n,mvArray)) mvArray++; //已翻山则不作处理,考察下一个位置 } else//如果目标 位置有棋子 { if(!OverFlag) OverFlag = 1; else { if(!(board[n] & SideTag))//是对方棋子 if(SaveMove(p, n, mvArray)) mvArray++; break; } } } } } //兵的走法 for(i=11;i<=15;i++) { p=piece[SideTag + i]; if(!p) continue; for(k=0;k<3;k++) { n = p+PawnDir[side][k]; if(LegalPosition[side][n] & PositionMask[6]) { if(!(board[n]) & SideTag) if(SaveMove(p,n,mvArray)) mvArray++; } } } return mvArray - MoveArray; }

Java实现一个有联网功能的象棋要用哪种技术?

学校大作业,我以前只用socket写过聊天的功能,不知道象棋的联网功能要怎么实现?socket我只知道用来传输字符流,应该不能用于这种较复杂的棋类联网吧?

我想用MPI+OpenMP混合编程模型实现中国象棋博弈树并行搜索可以吗?怎么实现呢?

对于中国象棋的博弈树怎样用MPI+OpenMP混合编程模型分解,MPI是进程级的,OpenMP是线程级的,两者混合可以实现博弈树的并行搜索吗

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐