Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Ackermann-function/AutoIt/ackermann-function-1.autoit
Normal file
11
Task/Ackermann-function/AutoIt/ackermann-function-1.autoit
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Func Ackermann($m, $n)
|
||||
If ($m = 0) Then
|
||||
Return $n+1
|
||||
Else
|
||||
If ($n = 0) Then
|
||||
Return Ackermann($m-1, 1)
|
||||
Else
|
||||
return Ackermann($m-1, Ackermann($m, $n-1))
|
||||
EndIf
|
||||
EndIf
|
||||
EndFunc
|
||||
18
Task/Ackermann-function/AutoIt/ackermann-function-2.autoit
Normal file
18
Task/Ackermann-function/AutoIt/ackermann-function-2.autoit
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Global $ackermann[2047][2047] ; Set the size to whatever you want
|
||||
Func Ackermann($m, $n)
|
||||
If ($ackermann[$m][$n] <> 0) Then
|
||||
Return $ackermann[$m][$n]
|
||||
Else
|
||||
If ($m = 0) Then
|
||||
$return = $n + 1
|
||||
Else
|
||||
If ($n = 0) Then
|
||||
$return = Ackermann($m - 1, 1)
|
||||
Else
|
||||
$return = Ackermann($m - 1, Ackermann($m, $n - 1))
|
||||
EndIf
|
||||
EndIf
|
||||
$ackermann[$m][$n] = $return
|
||||
Return $return
|
||||
EndIf
|
||||
EndFunc ;==>Ackermann
|
||||
Loading…
Add table
Add a link
Reference in a new issue