Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    print "Give me a number for the tile and I will tell you the color\n";
    ...
        9 Orange);
    
    print $Number{$a}."\n";
    
  2. or download this
    %Number = (1       =>    'Red',
               2       =>    'Yellow',
               3       =>    'Green');
    
  3. or download this
    @Number = ('Red', 'Yellow', 'Green');
    
    print $Number[$a]."\n";