Skip to main content
added 5 characters in body
Source Link
nutki
  • 3.7k
  • 11
  • 12

Perl 5: 183 - 100 = 83

Edit: I managed to cut some extra characters so I also altered the chord names like in the Python solution, so I can pretend for a moment that I am leading.

#!perl -pa
for$z(0..11){$x=0;$x|=1<<((/#/-/b/+$z+1.61*ord)%12or$o=$_)for@F;$x-/\d+_?/-$_*4||push@r,$o.$'
for qw(36M 34- 68+ 18o 40sus2 33sus4 292_7 290-7 546-M7 548M7 324+7 146o7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
C-

Perl 5: 183 - 100 = 83

Edit: I managed to cut some extra characters so I altered the chord names like in the Python solution, so I can pretend for a moment that I am leading.

#!perl -pa
for$z(0..11){$x=0;$x|=1<<((/#/-/b/+$z+1.61*ord)%12or$o=$_)for@F;$x-/\d+_?/-$_*4||push@r,$o.$'
for qw(36M 34- 68+ 18o 40sus2 33sus4 292_7 290-7 546-M7 548M7 324+7 146o7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
C-

Perl 5: 183 - 100 = 83

Edit: I managed to cut some extra characters so I also altered the chord names like in the Python solution, so I can pretend for a moment that I am leading.

#!perl -pa
for$z(0..11){$x=0;$x|=1<<((/#/-/b/+$z+1.61*ord)%12or$o=$_)for@F;$x-/\d+_?/-$_*4||push@r,$o.$'
for qw(36M 34- 68+ 18o 40sus2 33sus4 292_7 290-7 546-M7 548M7 324+7 146o7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
C-
added 134 characters in body
Source Link
nutki
  • 3.7k
  • 11
  • 12

Perl 5: 202183 - 100 = 10283

Edit: I managed to cut some extra characters so I altered the chord names like in the Python solution, so I can pretend for a moment that I am leading.

#!perl -pa
for$z(0..11){$x=0;$x|=1<<($%=(/#/-/b/+$z+1.61*ord)%12%12or$o=$_),$%or$o=$_
for@F;$x-/\d+_?/-$_*4||push@r,$o.$' for
for qw(36M 34m34- 68aug68+ 18dim18o 40sus2 33sus4 292_7 290m7290-7 546mmaj7546-M7 548maj7548M7 324aug7324+7 146dim7146o7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
CmC-

Perl 5: 202 - 100 = 102

#!perl -pa
for$z(0..11){$x=0;$x|=1<<($%=(/#/-/b/+$z+1.61*ord)%12),$%or$o=$_
for@F;$x-/\d+_?/-$_*4||push@r,$o.$' for
qw(36M 34m 68aug 18dim 40sus2 33sus4 292_7 290m7 546mmaj7 548maj7 324aug7 146dim7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
Cm

Perl 5: 183 - 100 = 83

Edit: I managed to cut some extra characters so I altered the chord names like in the Python solution, so I can pretend for a moment that I am leading.

#!perl -pa
for$z(0..11){$x=0;$x|=1<<((/#/-/b/+$z+1.61*ord)%12or$o=$_)for@F;$x-/\d+_?/-$_*4||push@r,$o.$'
for qw(36M 34- 68+ 18o 40sus2 33sus4 292_7 290-7 546-M7 548M7 324+7 146o7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
C-
deleted 2 characters in body
Source Link
nutki
  • 3.7k
  • 11
  • 12

Perl 5: 204202 - 100 = 104102

#!perl -pa
for$z(0..11){$x=0;$x|=1<<($%=(($_^p)*1.6+/#/-/b/+$z+$z+1.61*ord)%12),$%or$o=$_
for@F;$x-/\d+_?/-$_*4||push@r,$o.$' for
qw(36M 34m 68aug 18dim 40sus2 33sus4 292_7 290m7 546mmaj7 548maj7 324aug7 146dim7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
Cm

Perl 5: 204 - 100 = 104

#!perl -pa
for$z(0..11){$x=0;$x|=1<<($%=(($_^p)*1.6+/#/-/b/+$z)%12),$%or$o=$_
for@F;$x-/\d+_?/-$_*4||push@r,$o.$' for
qw(36M 34m 68aug 18dim 40sus2 33sus4 292_7 290m7 546mmaj7 548maj7 324aug7 146dim7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
Cm

Perl 5: 202 - 100 = 102

#!perl -pa
for$z(0..11){$x=0;$x|=1<<($%=(/#/-/b/+$z+1.61*ord)%12),$%or$o=$_
for@F;$x-/\d+_?/-$_*4||push@r,$o.$' for
qw(36M 34m 68aug 18dim 40sus2 33sus4 292_7 290m7 546mmaj7 548maj7 324aug7 146dim7)}$_="@r
"if@r

Example:

$ perl chord.pl <<<"C D# G"
Cm
deleted 3 characters in body
Source Link
nutki
  • 3.7k
  • 11
  • 12
Loading
edited body
Source Link
nutki
  • 3.7k
  • 11
  • 12
Loading
deleted 13 characters in body
Source Link
nutki
  • 3.7k
  • 11
  • 12
Loading
Source Link
nutki
  • 3.7k
  • 11
  • 12
Loading