Global $aNum[10][2]
Global $aPlus[5], $aMinus[5]
Local $nTmp1, $nTmp2, $i = 0, $x = 0
Do
$nTmp1 = Random(0, 10, 1)
$nTmp2 = Random(0, 10, 1)
If $nTmp1 + $nTmp2 > 10 Or IsDeclared($nTmp1 & ' + ' & $nTmp2) Then ContinueLoop
$aNum[$i][0] = $nTmp1
$aNum[$i][1] = $nTmp2
Assign($nTmp1 & ' + ' & $nTmp2, 0)
$aPlus[$i] = $nTmp1 & ' + ' & $nTmp2 & ' = '
$i += 1
Until $i = 5
Do
$nTmp1 = Random(0, 10, 1)
$nTmp2 = Random(0, 10, 1)
If $nTmp1 - $nTmp2 < 0 Or IsDeclared($nTmp1 & ' - ' & $nTmp2) Then ContinueLoop
$aNum[$i][0] = $nTmp1
$aNum[$i][1] = $nTmp2
Assign($nTmp1 & ' - ' & $nTmp2, 0)
$aMinus[$x] = $nTmp1 & ' - ' & $nTmp2 & ' = '
$i += 1
$x += 1
Until $i = 10
#include <Array.au3>
_ArrayDisplay($aNum, '$aNum')
_ArrayDisplay($aPlus, '$aPlus')
_ArrayDisplay($aMinus, '$aMinus')
|