I'm trying to print out a board in the right way, like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1. . . . . . . . . . . . . . . . . .
2. . . . . . . . . . . . . . . . . .
3. . . . . . . . . . . . . . . . . .
4. . . . . . . . . . . . . . . . . .
5. . . . . . . . . . . . . . . . . .
6. . . . . . . . . . . . . . . . . .
7. . . . . . . . . . . . . . . . . .
8. . . . . . . . . . . . . . . . . .
9. . . . . . . . . . . . . . . . . .
10. . . . . . . . . . . . . . . . . .
11. . . . . . . . . . . . . . . . . .
12. . . . . . . . . . . . . . . . . .
13. . . . . . . . . . . . . . . . . .
14. . . . . . . . . . . . . . . . . .
15. . . . . . . . . . . . . . . . . .
16. . . . . . . . . . . . . . . . . .
17. . . . . . . . . . . . . . . . . .
18. . . . . . . . . . . . . . . . . .
I have the list comprehension here
((concat [(""++show i)++" " | i <- [1..n], i<10])++"\n")
I can get the 9 first numbers correctly, but the problem comes when i would like to put an else statement in my comprehension. I can't seem to know how to do that. So to make my self extra clear, i would like to do the same thing with the double digits but the only difference will be that i want two spaces instead of three between each double digit.
]` so you can write any valid Haskell regex.
| |
] ?