08/09/03 02:35:08
>>228
うーん、たとえば↓を実行した数値を眺めると
同じ数値が連続したり特定の数値ばかり偏る……ような気がします。
こんなものなのでしょうか
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head><meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"></head>
<body>
<script language="JavaScript">
<!--
function run(){
count = document.main.count.value;
for(i=0;i<count;i++){
dice = Math.floor(Math.random()*6) + 1;
var log = document.getElementById('log').value;
log += dice;
if(i%20 == 0){log += "\n";}
document.main.log.value = log;
}
}
-->
</script>
<form name="main">
試行回数:<input type="text" size="3" name="count">回
<input type="button" value="実行" onclick="run()"><br>
<textarea name="log" id="log" rows="4" cols="64"></textarea>
</form>
</body></html>