For those of you who haven't heard of code golf, you should check out http://140byt.es/ The point is more to learn more about the language than to make something practical so come at it in a lighthearted way. In this case, the problem is actually pretty damn hard.
140 Bytes is Jed Schmidt's side project where people compete to make useful functions as small as possible. Jed is kind of a Javascript powerhouse and also happens to be a really nice guy.
You'd have to translate k's entire data model first. It's based on data-parallel, implicit looping over vectors -- like multiplying an entire vector by a constant in linear algebra.
For an open-source implementation of a k-like language, check out Kona (https://github.com/kevinlawler/kona). (Full disclosure, I'm a contributor.) It's still a work in progress, but it's pretty far along.
This won't work for anything but the most basic puzzles. Brute force just constitutes basic gameplay. To solve a moderately advanced Sudoku puzzle you need to compare potential candidates in groups. Then it gets even more advanced with a handful of trial and error techniques.
This is not correct. If a Sudoku puzzle has one and only one solution, brute force can always find it. It is trial-and-error for every single cell and every possible value, which is guaranteed to succeed eventually. Sounds crazy for a human, but a 3 GHz computer microprocessor can rip through that in a second or two.
Well, a few seconds unless someone goes and feeds you a worst-case puzzle like the one in that wikipedia page anyway. (Yes, that is an entirely valid sudoku with a unique solution. In theory it can even be solved by hand quite easily by applying a simple set of rules. I checked both of these, though not manually.)
I like that the OSI raised the WTFPL licence at a 2009 Board Meeting. I feel the outcome, 'Reject', is a loss for open source software - I'd love to see a programme with LICENCE.TXT containing that.
I think most of that syntax isn't so much "advanced" as simply not used in practice--it's too hard too read. Additionally, it uses basic operators which you should know (except maybe for "^" which is bitwise xor).
The best thing to do would be go through the basics of JavaScript and learn exactly how everything behaves. You should be able to answer questions like "is 24&&4 === true?" pretty easily.
If you have a bit of time on your hands, reading the standard will teach you all you need to know.
Of course, from a purely professional stand point, this is probably not the best use of your time (although knowing the language inside-out is important); using code like this in production code is a bad idea--it makes maintenance much more difficult.
140 Bytes is Jed Schmidt's side project where people compete to make useful functions as small as possible. Jed is kind of a Javascript powerhouse and also happens to be a really nice guy.
https://github.com/jed
https://github.com/jed/140bytes/wiki/Byte-saving-techniques
Edited to add.. As a curiosity, Jed might have the most-forked gist on github: https://gist.github.com/962807