Skip to content

Instantly share code, notes, and snippets.

View Ayiko's full-sized avatar

Ayiko

  • Belgium
View GitHub Profile
@Ayiko
Ayiko / gist:5547016
Last active December 17, 2015 03:59
# Turning a poorly formated matrix into a proper double entry array
# see https://gist.github.com/grondilu/5510686
use v6;
my ($t, @r) = q:to{END}.lines; #: titles, rest
A C D E F G H I K L M N P Q R S T V W Y
A 4 0 -2 -1 -2 0 -2 -1 -1 -1 -1 -2 -1 99 -1 1 0 0 -3 -2
C 0 9 -3 -4 -2 -3 -3 -1 -3 -1 -1 -3 -3 -3 -3 -1 -1 -1 -2 -2
D -2 -3 6 2 -3 -1 -1 -3 -1 -4 -3 1 -1 0 -2 0 -1 -3 -4 -3
E -1 -4 2 5 -3 -2 0 -3 1 -3 -2 0 -1 2 0 0 -1 -2 -3 -2
F -2 -2 -3 -3 6 -3 -1 0 -3 0 0 -3 -4 -3 -3 -2 -2 -1 1 3