The only purpose of this code is for the learning ability, in patching up a syntax error, and getting a code letter out of it (from a series of programs, a certain code will be found for something else). This program (I patched the error so no one will point it out ;)) will generate the letter "u".
Now I know there is alot of useless garbage in the program, but that is the point -- I don't want the person to just look at a statement like 'print "u";', but throw something in there to make it look 'bigger' than it actually is... and yes, I know there is a commented line reguarding a random call -- that was on purpose.
Anyway, as I said, this is for the purpose of finding an error in a piece of code, fixing it, and running it to obtain something. Here is the final result that is being used:
#!/usr/bin/perl
use strict;
use warnings;
my @a = 'a'..'z';
my $b = $a[19];
&blah();
srand('5' ^ my $blah1);
my @c=split(/ */, "abcdefghijklmnopqrstuvwxyz");
my $a = $c[20];
for(my $i = 0) {
@c = $c[20];#!/\^s/[int(rand(20))]/\^s/;
print "Good job!\n\nCode Letter: @c";
}
sub blah {
my $blah = "a c e g i k m o q s u w y";
my @blah = split(/ /, $blah);
my $i = -1;
foreach $blah(@blah) {
$i++;
delete $blah[$i] unless $i eq 2 || $i eq 4 || $i eq 6;
}
$blah = join('', $b,$blah[4],$blah[6],$blah[2]);
@blah = $blah;
$blah1 = @blah;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.