2012-11-18から1日間の記事一覧
昨日のint版のランダム値生成では、指定した最大値が出ないという間違いがあった。Math.floor()ではなく、四捨五入のMath.round()を使うことで修正。 // ランダム値生成 var randfloat = function(min, max) { return Math.random() * (max-min) + min; }; v…
昨日のint版のランダム値生成では、指定した最大値が出ないという間違いがあった。Math.floor()ではなく、四捨五入のMath.round()を使うことで修正。 // ランダム値生成 var randfloat = function(min, max) { return Math.random() * (max-min) + min; }; v…