CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
#!/usr/local/bin/perl
#
# Program to convert image text files to GAP matrices. 

$file = '/tmp/im.txt';		# Name the file
open(INFO, $file);		# Open the file
my $line = <INFO>;
@parts = split /(:|,)/, $line;
print("HAPAAA:=[\n ",$parts[2],",",$parts[4],",");
while(<INFO>)		# Read it into an array
{
@parts = split m!(,|:|\(|\))!, $_;
print("[",1+$parts[0],",",1+$parts[2],",",$parts[6]+$parts[8]+$parts[10],"],");
};			# Print the array
print($my,"0];\n");
close(INFO);