Skip to content

Commit cefd99f

Browse files
committed
[shootout] convert hard tabs into spaces
1 parent 536199b commit cefd99f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22

33
# The Computer Language Benchmarks Game
4-
#
4+
#
55
# Based on the submission for Perl 5.
66
# contributed by Daniel carrera
77
#
@@ -11,40 +11,40 @@
1111
my $sequence = '';
1212
my $lines;
1313
while $*IN.get -> $line {
14-
last if ($line.substr(0,6) eq '>THREE');
14+
last if ($line.substr(0,6) eq '>THREE');
1515
}
1616
while $*IN.get -> $line {
17-
last if ($line.substr(0,1) eq '>');
18-
$sequence = $sequence ~ lc $line.subst(/\n/,'');
17+
last if ($line.substr(0,1) eq '>');
18+
$sequence = $sequence ~ lc $line.subst(/\n/,'');
1919
}
2020

2121
# Count nucleotide sequences
2222
my $len = $sequence.chars;
2323
my (@keys,%table,$sum,$frame_size);
2424
for 1..2 -> $frame_size {
25-
%table = ();
26-
update_hash($frame_size);
25+
%table = ();
26+
update_hash($frame_size);
2727

28-
# Print.
29-
$sum = $len - $frame_size + 1;
30-
for %table.sort: {$^b.value <=> $^a.value||$^a.key leg $^b.key} {
31-
printf "%s %.3f\n", .key, .value*100/$sum;
32-
}
33-
print "\n";
28+
# Print.
29+
$sum = $len - $frame_size + 1;
30+
for %table.sort: {$^b.value <=> $^a.value||$^a.key leg $^b.key} {
31+
printf "%s %.3f\n", .key, .value*100/$sum;
32+
}
33+
print "\n";
3434
}
3535

3636
for <ggt ggta ggtatt ggtattttaatt ggtattttaatttatagt> -> $seq {
37-
%table = ();
38-
update_hash($seq.chars);
39-
printf "%3d\t$seq\n", (%table{$seq} || 0);
37+
%table = ();
38+
update_hash($seq.chars);
39+
printf "%3d\t$seq\n", (%table{$seq} || 0);
4040
}
4141

4242
# Procedure to update a hashtable of k-nucleotide keys and count values
4343
# for a particular reading-frame.
4444
sub update_hash($frame_size) {
45-
for 0..($len - $frame_size) -> $i {
46-
%table{$sequence.substr($i,$frame_size)}++;
47-
}
45+
for 0..($len - $frame_size) -> $i {
46+
%table{$sequence.substr($i,$frame_size)}++;
47+
}
4848
}
4949

5050
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)