arrays - Postscript 中的二维数组

标签 arrays multidimensional-array postscript

如何在 postscript 中创建二维数组?

我想我需要一个数组,其中每个元素都是一个数组,在这种情况下的数组称为形状。

/shape 2 array def
/shape_length 3 def
shape 0 2 array put
shape 1 2 array put
shape 2 2 array put

% [[null, null, null], [null, null, null], [null, null, null]]

我可以创建一个循环,而不是像这样复制一行 3 次。

我可能不需要 shape_length。

这是执行此操作的好方法还是有更简洁的方法?

最佳答案

创建这样的结构确实可以非常简洁地完成:

[3{3 array}repeat]

交互式地使用 Ghostscript,您可以看到它实际上产生了所需的数组:

GS>[3{3 array}repeat]==
[[null null null] [null null null] [null null null]]

关于arrays - Postscript 中的二维数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17242083/

相关文章:

pdf - 后记 : Reading a file, 写入 pdf

javascript - 遍历数组并将每个索引绑定(bind)到 AngularJS 中的另一个数组

ios - 在 SWIFT 中访问 NSMutableArray 元素

C# 属性数组

arrays - Redim VBA 中的可变维数

python - 找出元素是否存在于python的多维数组中

java - 细胞模型输出未显示

c++ - 在嵌入式平台上以编程方式从 PS 创建 PDF

PDF 到 PostScript 使用 Ghostscript : large files having issues printing

从两个数组创建 Javascript 对象