hello Kernelpanic
as others have stated, you run out of stack, but you can increase the stack size
open internal\c\makeline_win.txt
add: -Wl,--stack,10485760
your opening post needs a couple of small corrections
as others have stated, you run out of stack, but you can increase the stack size
open internal\c\makeline_win.txt
add: -Wl,--stack,10485760
your opening post needs a couple of small corrections
Code: (Select All)
'Ackermann Funktion - 15. Juli 2022
'Absturz schon bei 4, 1 = 65533 (?)
Option _Explicit
Declare Function ackermann(m as Integer, n as Integer) as Long
Dim m, n As Long
Dim i, j As Integer
Print
Print "Ackermann Funktion - Geben Sie zwei Zahlen ein"
Print
Input "Zahl 1: ", m
Input "Zahl 2: ", n
Print
i = 0: j = 0
For i = 0 To m
For j = 0 To n
Print Using "Ackermann (#, #) = ######"; i, j, ackermann(i, j)
Next j
Next i
End
Function ackermann (m As _Unsigned Integer, n As _Unsigned Integer)
If m = 0 Then ackermann = n + 1
If m > 0 And n = 0 Then
ackermann = ackermann(m - 1, 1)
End If
If m > 0 And n > 0 Then
ackermann = ackermann(m - 1, ackermann(m, n - 1))
End If
End Function