`shuffle()` is in-place but it did save me one line: var colors = gameColors # gameColors is a const seq[Color] shuffle(colors) colors = colors[0 ..< game.maxColors] Run
It is true that NiGui uses Gtk on Linux, but Gtk is pretty well always on desktop/laptop systems even KDE ones, since there're bound to be apps that depend on it. Nim could certainly do with a really good book -- I'd certainly like to read one. (I've dipped into Nim in Action, but I felt it was too close to the docs, the main examples didn't appeal to me, and it isn't Nim 1.0.) As for writing a Nim book: (1) I'd need to have done a lot more Nim programming -- which I'm in the process of doing; (2) I'd need to have at least one core dev willing to read and give feedback on all the examples _and_ on the text -- over a 12-18 month period; (3) I'd need to interest my -- or another -- publisher; (4) I'd need to feel motivated to spend at least a year working on a book that's likely to sell only a few thousand copies and so be a labor of love rather than economically viable. So I'm hoping someone else does it:-)