Code : Tout sélectionner
#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
$z = GUICreate("Statistiques", 363, 200, 393, 117)
GUISetFont(7, 400, 0, "Verdana")
$Calculer = GUICtrlCreateButton("Calculer", 0, 115, 363, 25, 0)
GUICtrlSetOnEvent($Calculer, "Calculer")
$min= GUICtrlCreateInput("", 150, 80, 140, 20, 0)
$LblListeSimulation = GUICtrlCreateLabel("Min :", 10, 80, 50, 20)
$max = GUICtrlCreateInput("", 107, 50, 140, 20, 0)
$LblListeSimulation = GUICtrlCreateLabel("Max :", 10, 50, 50, 20)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "quitter")
GUISetState(@SW_SHOW)
While 1
Sleep(1000)
WEnd
func Calculer()
$minv=GUICtrlRead($min)
$maxv=GUICtrlRead($max)
$reuslt1 = Random($minv, $maxv)
$reuslt2 = Random($minv, $maxv)
$reuslt3 = Random($minv, $maxv)
$reuslt4 = Random($minv, $maxv)
$reuslt5 = Random($minv, $maxv)
$reuslt6 = Random($minv, $maxv)
$reuslt7 = Random($minv, $maxv)
$reuslt8 = Random($minv, $maxv)
$reuslt9 = Random($minv, $maxv)
$addition = ($reuslt1 + $reuslt2 + $reuslt3 + $reuslt4 + $reuslt5 + $reuslt6 + $reuslt7 + $reuslt8 + $reuslt9)
$division = ($addition / 9)
MsgBox(0, "Result", "La moyenne est : " & $division)
GUICtrlSetData($max,"")
GUICtrlSetData($min,"")
EndFunc
Func quitter()
Exit
EndFunc