Created
February 12, 2017 20:00
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6.c; | |
| my $input = Q:to /EOH/; | |
| 140 190 1 8 | |
| 5 | |
| 140 150 1 | |
| 150 160 0 | |
| 160 170 7 | |
| 170 180 6 | |
| 180 190 2 | |
| EOH | |
| sub MAIN(){ | |
| # my $input = slurp; | |
| my ($min-x, $max-x, $min-y, $max-y) = $input.lines[0].split(' '); | |
| my $records = $input.lines[1]; | |
| for $max-y … 1 -> $y { | |
| print $y; | |
| for 1 … $records -> $x { | |
| my $data = $input.lines[$x+1].split(' ')[2]; | |
| print " "; | |
| print $data >= $y ?? '*' !! ' '; | |
| } | |
| print "\n"; | |
| LAST { | |
| my @x-labels = $input.lines[2..∞]».split(' '); | |
| say „ “, @x-labels[*;0].join(' '), „ “, @x-labels[*;1][*-1]; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment