From dedd3e76dc2ab71bbe9ae97604f258a0183a2d02 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 12 Feb 2007 23:01:19 +0000 Subject: set svn:eol-style git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/other-lang/ack.pl | 22 +++---- benchmark/other-lang/ack.py | 32 +++++----- benchmark/other-lang/ack.rb | 24 ++++---- benchmark/other-lang/ack.scm | 14 ++--- benchmark/other-lang/eval.rb | 132 +++++++++++++++++++++--------------------- benchmark/other-lang/fact.pl | 26 ++++----- benchmark/other-lang/fact.py | 36 ++++++------ benchmark/other-lang/fact.rb | 26 ++++----- benchmark/other-lang/fact.scm | 16 ++--- benchmark/other-lang/fib.pl | 22 +++---- benchmark/other-lang/fib.py | 14 ++--- benchmark/other-lang/fib.rb | 18 +++--- benchmark/other-lang/fib.scm | 14 ++--- benchmark/other-lang/loop.pl | 6 +- benchmark/other-lang/loop.py | 4 +- benchmark/other-lang/loop.rb | 8 +-- benchmark/other-lang/loop.scm | 2 +- benchmark/other-lang/loop2.rb | 2 +- benchmark/other-lang/tak.pl | 22 +++---- benchmark/other-lang/tak.py | 16 ++--- benchmark/other-lang/tak.rb | 26 ++++----- benchmark/other-lang/tak.scm | 20 +++---- 22 files changed, 251 insertions(+), 251 deletions(-) (limited to 'benchmark/other-lang') diff --git a/benchmark/other-lang/ack.pl b/benchmark/other-lang/ack.pl index 8933c33ae..201e22ddf 100644 --- a/benchmark/other-lang/ack.pl +++ b/benchmark/other-lang/ack.pl @@ -1,11 +1,11 @@ -use integer; - -sub Ack { - return $_[0] ? ($_[1] ? Ack($_[0]-1, Ack($_[0], $_[1]-1)) - : Ack($_[0]-1, 1)) - : $_[1]+1; -} - -my $NUM = 9; -$NUM = 1 if ($NUM < 1); -my $ack = Ack(3, $NUM); +use integer; + +sub Ack { + return $_[0] ? ($_[1] ? Ack($_[0]-1, Ack($_[0], $_[1]-1)) + : Ack($_[0]-1, 1)) + : $_[1]+1; +} + +my $NUM = 9; +$NUM = 1 if ($NUM < 1); +my $ack = Ack(3, $NUM); diff --git a/benchmark/other-lang/ack.py b/benchmark/other-lang/ack.py index 971796f68..9968e7cfc 100644 --- a/benchmark/other-lang/ack.py +++ b/benchmark/other-lang/ack.py @@ -1,16 +1,16 @@ -import sys -sys.setrecursionlimit(5000000) - -def Ack(M, N): - if (not M): - return( N + 1 ) - if (not N): - return( Ack(M-1, 1) ) - return( Ack(M-1, Ack(M, N-1)) ) - -def main(): - NUM = 9 - sys.setrecursionlimit(10000) - Ack(3, NUM) - -main() +import sys +sys.setrecursionlimit(5000000) + +def Ack(M, N): + if (not M): + return( N + 1 ) + if (not N): + return( Ack(M-1, 1) ) + return( Ack(M-1, Ack(M, N-1)) ) + +def main(): + NUM = 9 + sys.setrecursionlimit(10000) + Ack(3, NUM) + +main() diff --git a/benchmark/other-lang/ack.rb b/benchmark/other-lang/ack.rb index 7886183ff..7451bed6c 100644 --- a/benchmark/other-lang/ack.rb +++ b/benchmark/other-lang/ack.rb @@ -1,12 +1,12 @@ -def ack(m, n) - if m == 0 then - n + 1 - elsif n == 0 then - ack(m - 1, 1) - else - ack(m - 1, ack(m, n - 1)) - end -end - -NUM = 9 -ack(3, NUM) +def ack(m, n) + if m == 0 then + n + 1 + elsif n == 0 then + ack(m - 1, 1) + else + ack(m - 1, ack(m, n - 1)) + end +end + +NUM = 9 +ack(3, NUM) diff --git a/benchmark/other-lang/ack.scm b/benchmark/other-lang/ack.scm index e9e188693..a80b73ba5 100644 --- a/benchmark/other-lang/ack.scm +++ b/benchmark/other-lang/ack.scm @@ -1,7 +1,7 @@ -(define (ack m n) - (cond ((zero? m) (+ n 1)) - ((zero? n) (ack (- m 1) 1)) - (else (ack (- m 1) (ack m (- n 1)))))) - -(ack 3 9) - +(define (ack m n) + (cond ((zero? m) (+ n 1)) + ((zero? n) (ack (- m 1) 1)) + (else (ack (- m 1) (ack m (- n 1)))))) + +(ack 3 9) + diff --git a/benchmark/other-lang/eval.rb b/benchmark/other-lang/eval.rb index e6ff94d29..387592738 100644 --- a/benchmark/other-lang/eval.rb +++ b/benchmark/other-lang/eval.rb @@ -1,66 +1,66 @@ - -Bench = %w( - loop - ack - fib - tak - fact -) - -Lang = <