Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / dromaeo / tests / sunspider-controlflow-recursive.html
blobb0162481bc2acd12a876ef1d661c472c00066916
1 <html>
2 <head>
3 <script src="../htmlrunner.js"></script>
4 <script>
5 // The Computer Language Shootout
6 // http://shootout.alioth.debian.org/
7 // contributed by Isaac Gouy
9 function ack(m,n){
10 if (m==0) { return n+1; }
11 if (n==0) { return ack(m-1,1); }
12 return ack(m-1, ack(m,n-1) );
15 function fib(n) {
16 if (n < 2){ return 1; }
17 return fib(n-2) + fib(n-1);
20 function tak(x,y,z) {
21 if (y >= x) return z;
22 return tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y));
25 window.onload = function(){ startTest("sunspider-controlflow-recursive", '558ed308');
27 test("Ack", function(){
28 for ( var i = 3; i <= 5; i++ )
29 ack(3,i);
30 });
32 test("Fib", function(){
33 for ( var i = 3; i <= 5; i++ )
34 fib(17.0+i);
35 });
37 test("Tak", function(){
38 for ( var i = 3; i <= 5; i++ )
39 tak(3*i+3,2*i+2,i+1);
40 });
42 endTest(); };
43 </script>
44 </head>
45 <body></body>
46 </html>