在http://codeworld.info/中,您只能绘制/打印/显示“文本”和“数字”类型的数据(并且需要执行“显示”才能将“数字”转换为“文本”)。那么,如何使Codeworld绘制既不是文本也不是数字的东西呢?
克里斯最近添加了将Haskell基库导入CodeWorld的功能,因此您可以执行以下操作:
import Prelude hiding (show)
import HaskellPrelude (show)
showT(x) = fromString(show(x))
main = pictureOf(text(showT([1,2,3,4,5])))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句