Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Ackermann-function/VBScript/ackermann-function-1.vb
Normal file
20
Task/Ackermann-function/VBScript/ackermann-function-1.vb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
option explicit
|
||||
'~ dim depth
|
||||
function ack(m, n)
|
||||
'~ wscript.stdout.write depth & " "
|
||||
if m = 0 then
|
||||
'~ depth = depth + 1
|
||||
ack = n + 1
|
||||
'~ depth = depth - 1
|
||||
elseif m > 0 and n = 0 then
|
||||
'~ depth = depth + 1
|
||||
ack = ack(m - 1, 1)
|
||||
'~ depth = depth - 1
|
||||
'~ elseif m > 0 and n > 0 then
|
||||
else
|
||||
'~ depth = depth + 1
|
||||
ack = ack(m - 1, ack(m, n - 1))
|
||||
'~ depth = depth - 1
|
||||
end if
|
||||
|
||||
end function
|
||||
5
Task/Ackermann-function/VBScript/ackermann-function-2.vb
Normal file
5
Task/Ackermann-function/VBScript/ackermann-function-2.vb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
wscript.echo ack( 1, 10 )
|
||||
'~ depth = 0
|
||||
wscript.echo ack( 2, 1 )
|
||||
'~ depth = 0
|
||||
wscript.echo ack( 4, 4 )
|
||||
Loading…
Add table
Add a link
Reference in a new issue