Where are the solutions? That's the fun thing about Perl golf is seeing how people did it in X characters. Without solutions...well, I don't see the point.
This awesomeness unexpectedly sucked away half my afternoon. Not really sure whether to be upset about it our not. :)
Only thing is that the key counting doesn't seem to be consistent. :\ Using the command history seems to really, really screw with the counts. I thought it counted up all the characters in the submitted command, but this doesn't seem to be the case. I submitted an 18 for the "Sort and add attributes" challenge, then realized that the text for the new key is longer than that. :\
I'm not really clear on what "counts" as a keypress (shift key? colon for commands? Paste commands? Esc?) and I haven't been able to get any of my "scores" to match up with the count in my head.
All that aside, this is a barrel of fun, and I'm sure these kinks will get worked out.
DJ Hero has a great feature where after you beat a song, you can "Challenge a friend" and it sends a message to them that says something along the lines of "Steve just scored 200,000 points on $SONG_NAME. Can you do better? OK/CANCEL/ABORT"
This is one of the most wonderfully geeky things I have ever seen. The analogy to golf is exceptionally well-drawn, too! It might be entertaining if you developed the parallel even more, perhaps by adapting some of The Rules of Golf to your project.
My emacs-fu is pretty stale, but I'm sure it has the hooks to track what you need. Although, Emacs isn't all about keystrokes, it's more about interactive coding and an integrated development environment.
Maybe you could do something more along the lines of Perl golf, where you achieve certain things in as little code as possible.
You could check keystrokes used with C-h l (or M-x view-lossage), but Emacs's whole design is based on extensibility rather than terse, orthogonal, and (usually) single-key commands. Don't find a clever way to knock it down to 30 keystrokes (or whatever) - when you notice a common operation, script it, name it, bind it, now it's two or three keystrokes.
I held the title on "Brackets or Braces?" [0] for a good seven minutes with a 44 character solution [1], only to be ousted by @ryanmusicman with 42. Can anyone see an obvious way to improve mine?
Ugh.. wanted to play with it, but after three years, there still isn't a simple way to get Ruby and Gems working nicely with modern Ruby apps on OSX. Searching for ways to update show a variety of hacks, each uglier than the last. Of course, I could always build it from source.. ::sigh::
Ha, I just started working on the same exact project a few weeks ago. Great minds think alike, I guess. I'm taking a different approach, so I'll still launch it to see what people think.
I brought up this idea in a "gamification of software development" talk I gave last April.
Until somebody can come up with at least some method of restricting vim scripting, the results are useless(one can easily only use 4 key strokes by key mapping as you can see). But, on the other hand, you can't just disable vim from loading scripts, because there's no point in mastering the plain old vim without any plugins, custom key mappings and such.
You should really make some challenges that require the users to pass multiple tests with the same script. Sure, you can solve the reformat/refactor challenge by
jd2jVjj=f(ci)*a^]jcfda.join(',')^]
but it wont generalize anywhere. Having a full script though that will detect and do that automagically, now there's the fun part.
Yeah, how does this prevent somebody from making a macro that does the entire file, then "completing" the file with the two* keystrokes it takes to fire off that macro?
Is there anything to stop people form just writing a macro beforehand that does each task? I'm guessing that's how the guy who 4 keystrokes on Simple Text Editing accomplished that.
[+] [-] SwellJoe|15 years ago|reply
[+] [-] igrigorik|15 years ago|reply
If anyone is up for it, would love some help with the client/parser: https://github.com/igrigorik/vimgolf
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] Calamitous|15 years ago|reply
Only thing is that the key counting doesn't seem to be consistent. :\ Using the command history seems to really, really screw with the counts. I thought it counted up all the characters in the submitted command, but this doesn't seem to be the case. I submitted an 18 for the "Sort and add attributes" challenge, then realized that the text for the new key is longer than that. :\
I'm not really clear on what "counts" as a keypress (shift key? colon for commands? Paste commands? Esc?) and I haven't been able to get any of my "scores" to match up with the count in my head.
All that aside, this is a barrel of fun, and I'm sure these kinks will get worked out.
[+] [-] Calamitous|15 years ago|reply
[+] [-] luigi|15 years ago|reply
[+] [-] steveklabnik|15 years ago|reply
[+] [-] bradendouglass|15 years ago|reply
[+] [-] gfodor|15 years ago|reply
[+] [-] gfodor|15 years ago|reply
[+] [-] duck|15 years ago|reply
[+] [-] Bud|15 years ago|reply
[+] [-] rbxbx|15 years ago|reply
http://en.wikipedia.org/wiki/Perl#Perl_golf
'Golfing' different languages has been around for some time.
No discredit to the site though, certainly happy to have Vim golfing join the ranks.
[+] [-] devin|15 years ago|reply
Anyone have any ideas on how you'd implement this with emacs?
[+] [-] jlongster|15 years ago|reply
Maybe you could do something more along the lines of Perl golf, where you achieve certain things in as little code as possible.
[+] [-] silentbicycle|15 years ago|reply
[+] [-] aerique|15 years ago|reply
[+] [-] lelele|15 years ago|reply
[+] [-] callahad|15 years ago|reply
[0]: http://vimgolf.com/challenges/4d1a522ea860b7447200010b
[1]: https://gist.github.com/757767
[+] [-] clvv|15 years ago|reply
[+] [-] DEinspanjer|15 years ago|reply
[+] [-] luigi|15 years ago|reply
[+] [-] exogen|15 years ago|reply
I brought up this idea in a "gamification of software development" talk I gave last April.
[+] [-] jjcm|15 years ago|reply
[+] [-] clvv|15 years ago|reply
[+] [-] askedrelic|15 years ago|reply
I love this idea and love the challenge, but would love to make it less hackable as well.
[+] [-] jjcm|15 years ago|reply
[+] [-] jjcm|15 years ago|reply
edit: switch the first three letters to j3D, as 4JD seems to work differently between my two machines.
[+] [-] DEinspanjer|15 years ago|reply
[+] [-] BrandonM|15 years ago|reply
[+] [-] jjcm|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] jh3|15 years ago|reply
I was trying to do this:
However, that causes a to be before b for some reason.So I ended up doing:
Anyone know why appending j! joins everything correctly except a and b?[+] [-] eterps|15 years ago|reply
I have scored 38 with:
:sor<ENTER>:%s/)/, :country => "USA")/<ENTER>
[+] [-] birken|15 years ago|reply
This shaves off a few chars: a) combining the commands b) leaving off the last / in the search/replace
[+] [-] clvv|15 years ago|reply
[+] [-] Symmetry|15 years ago|reply
[+] [-] burgerbrain|15 years ago|reply
Or one, mapping space to @q is convenient :)
[+] [-] BrandonM|15 years ago|reply
13
Edit: I can trim one more off, to make it 12:
qq3jYpJDq2@q
[+] [-] Complete|15 years ago|reply
16 :P
[+] [-] meastham|15 years ago|reply
Edit: Still a very cool project though
[+] [-] seles|15 years ago|reply
[+] [-] jjcm|15 years ago|reply
[+] [-] meastham|15 years ago|reply