Alic
Alic

Reputation: 648

How do you debug in codeworld?

In http://codeworld.info/, you can only draw/print/display data in types of Text and Number (and you need Show to convert Number to Text). So what can I do to let codeworld draw something that is neither a Text or Number?

Upvotes: 1

Views: 218

Answers (1)

luqui
luqui

Reputation: 60463

Chris recently added the ability to import the Haskell base library into CodeWorld, so you can do this:

import Prelude hiding (show)
import HaskellPrelude (show)

showT(x) = fromString(show(x))

main = pictureOf(text(showT([1,2,3,4,5])))

Upvotes: 3

Related Questions