Rendering Go problems
I'm currently learning to play Go/baduk, and I thought that it would be nice to include sections of a Go board on this website. I didn't really want to do it through taking screenshots of OGS. Additionally, as a Vim user, I was determined that I shouldn't have to use a mouse or GUI to share go problems. Instead I've made a Vue component that lets me type a Go board into my markdown files.
// 0 = emtpy
// 1 = black
// 2 = white
const board =
[ [0,0,0,0,0,0]
, [0,2,1,1,0,0]
, [0,1,0,0,0,0]
, [0,1,0,1,0,0]
, [0,0,0,0,0,0]
, [0,0,0,0,0,0]
]
<GoBoard
:board=board
/>
renders as
This was the first time I've written a Vue component, and coming from React it seems deeply strange. Having to use a templating DSL which has loops and if statements written as HTML attributes seems really backwards. I can't see why I would choose Vue over React for any complex project, but maybe I'm missing something. If you can tell me what Vue is good for please get in touch!
ciao.
Want to get updates and new posts via email?