文件名称:Roll
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:578byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
做一个应用程序模拟掷色子的游戏:
1)使用Math.random方法分别取得两个随机数(掷两次色子),每个随机数为范围在1-6之间的整数,把两个随机数相加(则和的范围是2-12);
2)模拟36000次,然后计算和为2-12间各数出现的几率。判断是否合理(如:有6种方式可以掷出和为7,所以7的出现几率应该大概为1/6)。
-To do an application simulates the dice game:
1) Use the Math.random method to obtain two random numbers (throwing
Two dice), each random number as an integer in the range between 1-6,
Two random numbers together (and the range of 2-12)
2) simulation 36,000 times and then calculate and for 2-12 between each number appears
Chance. Determine whether reasonable
1)使用Math.random方法分别取得两个随机数(掷两次色子),每个随机数为范围在1-6之间的整数,把两个随机数相加(则和的范围是2-12);
2)模拟36000次,然后计算和为2-12间各数出现的几率。判断是否合理(如:有6种方式可以掷出和为7,所以7的出现几率应该大概为1/6)。
-To do an application simulates the dice game:
1) Use the Math.random method to obtain two random numbers (throwing
Two dice), each random number as an integer in the range between 1-6,
Two random numbers together (and the range of 2-12)
2) simulation 36,000 times and then calculate and for 2-12 between each number appears
Chance. Determine whether reasonable
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Roll.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.