Skip to content

Commit

Permalink
Create MultiplicationTable.au3
Browse files Browse the repository at this point in the history
  • Loading branch information
majorangle committed Feb 12, 2020
1 parent 5277176 commit 65460b4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions MultiplicationTable.au3
@@ -0,0 +1,20 @@
#include <Array.au3>

_ArrayDisplay(MultiplicationTable(12))
_ArrayDisplay(MultiplicationTable(14, 12))

; $iSize - The size of the final 2D array
; $iNull - The number at which to create Null values instead of multiplying
Func MultiplicationTable($iSize, $iNull = 999999)
Local $aTemp[$iSize][$iSize]
For $iRow=1 To $iSize
For $iCol=1 To $iSize
If ($iRow > $iNull) Or ($iCol > $iNull) Then
$aTemp[$iRow - 1][$iCol - 1] = Null
Else
$aTemp[$iRow - 1][$iCol - 1] = $iRow * $iCol
EndIf
Next
Next
Return $aTemp
EndFunc

0 comments on commit 65460b4

Please sign in to comment.