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.
I will take part in this when the solutions are displayed. All the fun is in the solutions. So for me, hiding them kills the whole point of the project. Otherwise it would be lots of fun. Im a long time vim user and love it.
I think Project Euler has a good compromise - you can see (and comment on!) solutions once you've successfully passed some baseline. Then you don't feel like you cheated, but can pick apart their solutions, now that you've already focused on that problem for a while.
I've learned a LOT figuring out how some outstanding PE submissions worked, translating their algorithms to my favorite languages.
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?
I agree that all users rely on plugins for doing real work. However, seeing how much can be accomplished by using just vanilla features can be enlightening.
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::
I'm running an MBP received a clean install of the first Snow Leopard release and has subsequently gone through the normal system updates.
On this system, and the previous one that was running 10.5, I've never managed to get RubyGems updated successfully.. hence, when I try to gem install vimgolf, it tells me that I need rubygems >=1.3.6. I guess I'm just failing as a hacker and missing something obvious. Grr.
Well, I just discovered that I had two different conflicting gem home dirs. was able to set GEM_HOME and do "gem cleanup" and things seem to be a bit better now. Yay!
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?
To be fair, I borrowed from a couple others here, but that was generally the approach I had in mind.
Of course, we aren't genuinely doing what the author intended. The point was not to copy-paste the line, but actually to perform what would be rather typical edits. I also was rather lucky that the file happened to be structured such that "3j" put the cursor in the right place each time.
It's also not clear whether or not the three times SHIFT must be pressed ("JD" = push and hold SHIFT = one press) should be counted as additional keystrokes.
The contest would have been better with a "tee" file and a "hole" file, stipulating that edits should be performed on the former in order to produce the latter.
Agreed. I'm surprised by all the "qa"s I'm seeing. I've always used "qq" for quick macros and kind of assumed everyone else did as well. It's especially convenient considering that @ and q are right next to each other on a qwerty layout.
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.