Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Ackermann-function/TSE-SAL/ackermann-function.tse
Normal file
18
Task/Ackermann-function/TSE-SAL/ackermann-function.tse
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// library: math: get: ackermann: recursive <description></description> <version>1.0.0.0.5</version> <version control></version control> (filenamemacro=getmaare.s) [kn, ri, tu, 27-12-2011 14:46:59]
|
||||
INTEGER PROC FNMathGetAckermannRecursiveI( INTEGER mI, INTEGER nI )
|
||||
IF ( mI == 0 )
|
||||
RETURN( nI + 1 )
|
||||
ENDIF
|
||||
IF ( nI == 0 )
|
||||
RETURN( FNMathGetAckermannRecursiveI( mI - 1, 1 ) )
|
||||
ENDIF
|
||||
RETURN( FNMathGetAckermannRecursiveI( mI - 1, FNMathGetAckermannRecursiveI( mI, nI - 1 ) ) )
|
||||
END
|
||||
|
||||
PROC Main()
|
||||
STRING s1[255] = "2"
|
||||
STRING s2[255] = "3"
|
||||
IF ( NOT ( Ask( "math: get: ackermann: recursive: m = ", s1, _EDIT_HISTORY_ ) ) AND ( Length( s1 ) > 0 ) ) RETURN() ENDIF
|
||||
IF ( NOT ( Ask( "math: get: ackermann: recursive: n = ", s2, _EDIT_HISTORY_ ) ) AND ( Length( s2 ) > 0 ) ) RETURN() ENDIF
|
||||
Message( FNMathGetAckermannRecursiveI( Val( s1 ), Val( s2 ) ) ) // gives e.g. 9
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue