... und noch weiter ...
Strukturelle
Das Kuckuckseiprinzip
Code
...
# Chordtypen aus Hash in Array einlesenforeach ( keys %chordtypes ) { push @chordtypes, $_}## Kuckuksei "geändertes Chordtypen-Array" dem Programm unterjubelnmy $chordtypes_new_ref = chordtypes_change(\@chordtypes);@chordtypes = @$chordtypes_new_ref;...# Subroutine Chordtypes-Array transformieren ( Kuckuckseiprinzip )sub chordtypes_change { print "\nSubroutine chordtypes_change!\n\n"; my $chordtypes_ref = shift; my @chordtypes = @$chordtypes_ref; my @chordtypes_new; foreach ( @chordtypes ) { my $chordtype = $_; print "Chordtyp: $chordtype\n"; } my %chordtypes_prefered = ('Dur' => 1,'Moll' => 1,'DurMaj7' => 1,'Moll7' => 1); foreach ( @chordtypes ) { my $chordtype = $_; if ( exists $chordtypes_prefered{$chordtype} ) { print "Es handelt sich um einen der preferierten Akkorde! Es ist der $chordtype.\n"; map { push @chordtypes_new, $chordtype } 1..11; } else { push @chordtypes_new, $chordtype } } return \@chordtypes_new}
...
Und schon haben wir wieder zwei neue Monster in Tongestalt:
...
Ein bisschen entspannter klingt es nun. Aber immer noch ein bissi zu chronisch-verspannt,
Kommentare
Kommentar veröffentlichen