簡易抽選
♥0 |
Line 55 |
Modified 2010-10-20 00:30:22 |
MIT License
archived:2017-03-20 13:51:42
ActionScript3 source code
/**
* Copyright Nowloading_ ( http://wonderfl.net/user/Nowloading_ )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/jt1N
*/
// forked from ton_'s textTest03
// forked from ton_'s textTest02.5
// forked from ton_'s textTest02
// forked from ton_'s textTest01
/**
簡易スロット用確率テーブル1
10000通りで計算(Math.cil(Math.random()*10000-1))
当たり確率1/100(100個)
10枚ベル1/10(1000個:うち重複5個→0.5%)
3枚リプレイ1/8(1250個:うち重複2個→0.16%)
5枚スイカ1/50(200個:うち重複16個→8%)
9枚チェリー1/80(125個:うち重複25個→20%)
1枚役(100個:うち重複40個→25%)
単独(12個→0.12%)
純はずれ(7313個)
1クリックで100回ずつ試行→結果を表示
**/
package {
import flash.events.Event;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.text.TextField;
public class FlashTest extends Sprite {
private var fld:TextField;
private var XY:Array = new Array();
private var Sai:Array = [0,0,0,0,0,0,0];
private var now:int;
private var St:String;
private var Total:int = 0;
public var bgColor:Sprite;
public function FlashTest() {
// write as3 code here..
fld = new TextField();
fld.wordWrap = true;
fld.height = 465;
fld.width = 300;
addChild(fld);
stage.addEventListener(MouseEvent.CLICK, onClick);
}
public function onClick(e:MouseEvent):void{
//サイコロ処理部分
Operation1();
//テキスト表示部分
XY.unshift(["Now",St,"Total = ",Sai[0],Sai[1],Sai[2],Sai[3],Sai[4],Sai[5],Sai[6],"Count = ",Total,"\n"]);
fld.text = "," + String(XY);
}
public function Operation1():void{
now = Math.ceil(Math.random()*10000)-1;
if(now <= 999) {
Sai[0] += 1;
St = "Bell";
} else if(now >999 && now <= 2249) {
Sai[1] += 1;
St = "Replay";
} else if(now > 2249 && now <= 2449) {
Sai[2] += 1;
St = "Suika";
} else if(now > 2449 && now <= 2574){
Sai[3] += 1;
St = "Cherry";
} else if(now > 2574 && now <= 2674){
Sai[4] += 1;
St = "Itimai";
} else if(now > 2674 && now <= 2774){
Sai[5] += 1;
St = "Tandoku";
} else {
Sai[6] += 1;
St = "Hazure";
}
Total += 1;
}
}
}