棋盘代码_Mathematica绘制棋盘

这篇博客展示了如何用Mathematica编程语言构建一个中国象棋棋盘的详细过程,包括绘制棋盘、设定楚河汉界的标记以及棋盘上的线条。通过这段代码,读者可以了解到Mathematica在图形绘制方面的应用。
摘要由CSDN通过智能技术生成

045e88dd971bbdd66b69e480c6883641.png

主要用mathematica做了一个象棋棋盘,代码如下

Graphics[{Thick, White, Rectangle[{0, 0}, {9, 10}],
  Red, Line[Table[{{1, i}, {9, i}}, {i, 1, 5}]],
  Red, Line[Table[{{i, 1}, {i, 5}}, {i, 1, 9}]],
  Table[Circle[{i, j}, 0.2], {i, 1, 9}, {j, 1, 10}],
  Red, Line[{{4, 1}, {6, 3}}],
  Red, Line[{{4, 3}, {6, 1}}],
  Red, Line[Table[{{1, i}, {9, i}}, {i, 6, 10}]],
  Red, Line[Table[{{i, 6}, {i, 10}}, {i, 1, 9}]],
  Red, Line[{{4, 8}, {6, 10}}],
  Red, Line[{{4, 10}, {6, 8}}],
  Red, Line[{{1, 5}, {1, 6}}],
  Red, Line[{{9, 5}, {9, 6}}],
  Red, Rotate[Text[Style["楚", Larger, Bold], {3, 5.5}], 90 Degree],
  Red, Rotate[Text[Style["河", Larger, Bold], {4, 5.5}], 90 Degree],
  Red, Rotate[Text[Style["汉", Larger, Bold], {7, 5.5}], -90 Degree],
  Red, Rotate[Text[Style["界", Larger, Bold], {6, 5.5}], -90 Degree]
  }]

93644e3def8d8036dc07a32d99a68284.png
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值