Files
@ r18473:7523037cb48c
Branch filter:
Location: cpp/openttd-patchpack/source/src/3rdparty/squirrel/samples/ackermann.nut - annotation
r18473:7523037cb48c
392 B
text/plain
(svn r23327) -Update from WebTranslator v3.0:
belarusian - 16 changes by KorneySan
finnish - 15 changes by jpx_
german - 8 changes by planetmaker
italian - 8 changes by lorenzodv
korean - 10 changes by junho2813
russian - 1 changes by Lone_Wolf
vietnamese - 15 changes by nglekhoi
welsh - 9 changes by kazzie
belarusian - 16 changes by KorneySan
finnish - 15 changes by jpx_
german - 8 changes by planetmaker
italian - 8 changes by lorenzodv
korean - 10 changes by junho2813
russian - 1 changes by Lone_Wolf
vietnamese - 15 changes by nglekhoi
welsh - 9 changes by kazzie
r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r11225:37853e3b55c7 r12787:de500a3ee74b | /*
*
* Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/)
*
*/
function Ack(M, N) {
if (M == 0) return( N + 1 );
if (N == 0) return( Ack(M - 1, 1) );
return( Ack(M - 1, Ack(M, (N - 1))) );
}
local n;
if(ARGS.len()!=0) {
n = ARGS[0].tointeger();
if(n < 1) n = 1;
} else {
n = 1;
}
print("n="+n+"\n");
print("Ack(3,"+ n+ "):"+ Ack(3, n));
|