java代码猜拳 java猜拳代码简单( 四 )


k++;
}
System.out.println("The total times you won are "+j+",The draw times are "+(n-j-k)+".");
if(jk)
System.out.println("You are the final winner");
else if(kj)
System.out.println("The computer is the winner.");
if(j==k)
System.out.println("The final result is draw");
}
}
登录后复制
compare方法部分
package SS2_5;
public class Compare {
public int compare(int a,int r){
int counter=0;
if(a==0r==0){
System.out.println("The computer comes out with cloth,it was a draw. ");
return 2;
}
else if(a==0r==1){
System.out.println("The computer comes out with stone, you won. ");
return 1;
}
else if(a==0r==2){
System.out.println("The computer comes out with scissor,you lost. ");
return 0;
}
else if(a==1r==0){
System.out.println("The computer comes out with cloth,you lost. ");
return 0;
}
else if(a==1r==1){
System.out.println("The computer comes out with stone,it was a draw. ");
return 2;
}
else if(a==1r==2){
System.out.println("The computer comes out with scissors,you won. ");
return 1;
}
else if(a==2r==0){
System.out.println("The computer comes out with cloth,you won. ");
return 1;
}
else if(a==2r==1){
System.out.println("The computer comes out with stone,you lost. ");
return 0;
}
else if(a==2r==2){
System.out.println("The computer comes out with scissors,it was a draw. ");
return 2;
}
else
return 0;
}
}
登录后复制
java
704拖拉机
精选推荐
广告
java写简单的猜拳游戏
2下载·0评论
2016年7月27日
用Java编写的猜拳小游戏
2029阅读·0评论·0点赞
2021年3月7日
Java猜拳游戏和Random的应用
21阅读·0评论·0点赞
2022年10月24日
java实现完整版猜拳小游戏
25下载·0评论
2018年11月22日
用python实现功能猜拳
1137阅读·2评论·3点赞
2022年7月14日
java猜拳switch计分制_java----猜拳(10局分胜负)
117阅读·0评论·1点赞
2021年3月15日
二手拖拉机交易市场 , 你还在高价买吗?
精选推荐
广告
利用Java编写简单的猜拳游戏
911阅读·0评论·1点赞
2022年9月8日
Java简单实现猜拳游戏
1.1W阅读·1评论·2点赞
2022年1月23日
java猜拳游戏代码_Java实现简单猜拳游戏
4496阅读·0评论·0点赞
2021年3月1日
用java来写一个简单的猜拳小游戏
890阅读·1评论·1点赞
2022年7月26日
java实现猜拳游戏
3180阅读·2评论·1点赞
2022年5月4日
JAVA编写猜拳游戏
3037阅读·3评论·3点赞
2021年3月16日
[Java教程]17.实战,趣味猜拳小游戏
8040阅读·2评论·3点赞
2020年6月24日
怎么用java实现人机猜拳?
1959阅读·6评论·9点赞
2021年7月22日
Java Random经典例子【猜拳游戏】
4318阅读·0评论·0点赞
2014年3月22日
java的人机猜拳代码_Java实现人机猜拳游戏
702阅读·0评论·2点赞
2021年3月12日
Java基础练习之猜拳游戏
363阅读·1评论·1点赞
2021年8月19日
用java写猜拳小游戏
1096阅读·0评论·1点赞
2021年9月1日
Java猜拳小游戏
97阅读·0评论·0点赞
2022年8月23日
java猜拳小游戏
500阅读·1评论·0点赞
2022年7月14日
java代码猜拳的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java猜拳代码简单、java代码猜拳的信息别忘了在本站进行查找喔 。

推荐阅读