pastermil@sh.itjust.works to Programmer Humor@programming.dev · 6 months agoThat Nim Flashbackssh.itjust.worksimagemessage-square44fedilinkarrow-up1799arrow-down17
arrow-up1792arrow-down1imageThat Nim Flashbackssh.itjust.workspastermil@sh.itjust.works to Programmer Humor@programming.dev · 6 months agomessage-square44fedilink
minus-squareJATtho@sopuli.xyzlinkfedilinkarrow-up5·6 months agoLettme introduce you to ackermann’s function: int ack(int m, int n) { if (m == 0) { return n+1; } else if((m > 0) && (n == 0)){ return ack(m-1, 1); } else if((m > 0) && (n > 0)) { return ack(m-1, ack(m, n-1)); } } You won’t run out of stackoverflows any time soon.
Lettme introduce you to ackermann’s function:
int ack(int m, int n) { if (m == 0) { return n+1; } else if((m > 0) && (n == 0)){ return ack(m-1, 1); } else if((m > 0) && (n > 0)) { return ack(m-1, ack(m, n-1)); } }
You won’t run out of stackoverflows any time soon.