up previous next
FoldToListInput --
convert string so it looks like a list of short strings
|
FoldToListInput(S: STRING, W: INT): STRING |
This function transforms a string so that it looks like a list of short
strings (each of length at most
W). Similar to
fold, but the
result is ready to be read by CoCoA.
WARNING: does not handle "funny" characters cleverly.
There is also
FoldToList which returns a list of strings; it is
disappointingly slow (so deliberately not properly documented).
/**/ n := factorial(100);
/**/ FoldToListInput(sprint(n), 60);
["933262154439441526816992388562667004907159682643816214685929",
"638952175999932299156089414639761565182862536979208272237582",
"51185210916864000000000000000000000000"]
|