#Rotating the alphabet the three letters
@letters = ('A' .. 'Z');
for ($i = 1; $i <= 3; $i++) {
unshift(@letters, pop(@letters));
}
print @letters, "\n";
#rotating the alphabet in the opposite direction
@letters = ('A' .. 'Z');
for ($i = 1; $i <= 3; $i++) {
push(@letters, shift(@letters));
}
print @letters, "\n";
@letters = ('A' .. 'Z');
for ($i = 1; $i <= 3; $i++) {
unshift(@letters, pop(@letters));
}
print @letters, "\n";
#rotating the alphabet in the opposite direction
@letters = ('A' .. 'Z');
for ($i = 1; $i <= 3; $i++) {
push(@letters, shift(@letters));
}
print @letters, "\n";
No comments:
Post a Comment