#!/usr/bin/perl use strict; use warnings; my $wheel = 26.5; my @chainWheels = qw (42 32 22); my @cogs = qw (11 13 15 17 19 21 24 28 32); print "Wheelsize: $wheel\n"; print "Chainwheels: @chainWheels\n"; print "Sprockets: @cogs\n\n"; for my $chainSel (1 .. @chainWheels) { my $wheelMul = $wheel * $chainWheels[$chainSel - 1]; print "Chain wheel: $chainSel ratios: \n"; for my $cogSel (1 .. @cogs) { printf "%d: %5.2f ", $cogSel, $wheelMul / $cogs[$cogSel - 1]; } print "\n"; } #### Wheelsize: 26.5 Chainwheels: 42 32 22 Sprockets: 11 13 15 17 19 21 24 28 32 Chain wheel: 1 ratios: 1: 101.18 2: 85.62 3: 74.20 4: 65.47 5: 58.58 6: 53.00 7: 46.38 8: 39.75 9: 34.78 Chain wheel: 2 ratios: 1: 77.09 2: 65.23 3: 56.53 4: 49.88 5: 44.63 6: 40.38 7: 35.33 8: 30.29 9: 26.50 Chain wheel: 3 ratios: 1: 53.00 2: 44.85 3: 38.87 4: 34.29 5: 30.68 6: 27.76 7: 24.29 8: 20.82 9: 18.22