using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestScript : MonoBehaviour { private int count = 1; private float result = 0f; private float loseProbability = 0f; private float winProbability = 0f; private float deuceProbability = 0f; // Start is called before the first frame update void Start() { for (int i = 1; i <= 6; i++) { loseProbability += (6 - i) / 6f; } loseProbability = loseProbability / 6f; for (int i = 1; i <= 6; i++) { winProbability += (i - 1) / 6f; } winProbability = winProbability / 6f; deuceProbability = 1 / 6f; Debug.Log("win:"+winProbability + "deuce:" + deuceProbability + "lose:" + loseProbability); result = Mathf.Pow(winProbability, 7) * Mathf.Pow(deuceProbability, 3); Debug.Log("result:" + result*100+"%"); } // Update is called once per frame void Update() { } }