Does anybody know how to generate a grid in Haskell?

后端 未结 1 843
南方客
南方客 2021-01-24 12:09

Instead of having a 2D list like:

[[1,2],[3,4]]

I was wondering if there is any way that you can have:

[1, 2]
[3, 4] 
相关标签:
1条回答
  • 2021-01-24 12:57

    There are many ways to do this, but if you're currently doing

    print grid
    

    try replacing it with

    mapM_ print grid
    

    to print each row separately.

    0 讨论(0)
提交回复
热议问题