#!/usr/bin/perl ## Author: Dan Jacobson https://www.jidanni.org/ ## Copyright: https://www.gnu.org/licenses/gpl.html ## Created: 2026-02-17T23:09:20+0000 ## Last-Updated: 2026-02-27T05:47:22+0000 ## Update #: 88 use strict; use warnings FATAL => q(all); my $Z = 1000; my $V = qq{viewBox="0 0 $Z $Z"}; print qq{\n}; ## my @xmarks = ( ## "沿著馬路號碼增加方向 → ", ## "Direction of increasing numbers as we travel along the road →" ## ); ## for ( 60, 30 ) { #X axis markings ## printf ## qq! %s\n!, ## coor( $Z / 2, $_ ), 28, "middle", shift @xmarks; ## } for ( 0 .. ( $Z / 100 ) - 1 ) { #Y axis markings printf qq! %d%s\n!, coor( 40, 100 * $_ ), 28, "middle", 100 * $_, "號"; } my @d = ( { color => "red", oe => "雙號 Even" }, { color => "blue", oe => "單號 Odd" }, ); for ( 0, 1 ) { printf #ODD EVEN notice qq! %s\n!, coor( $Z / 2, $Z - 100 - 50 * !$_ ), 34, "middle", $d[$_]{color}, $d[$_]{oe}; ##The actual points open( my $fh, "<", shift @ARGV ) or die "$!"; my @points; while ( my $line = readline($fh) ) { next unless $line =~ /\d/; my @F = split /,/, $line; push @points, join ",", coor(@F); printf qq{ \n}, coor(@F), $d[$_]{color}; } print qq{ \n}; close $fh; } print "\n"; sub coor { # flip axis for SGV return $_[0], $Z - $_[1]; }