Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d1a5275a860b74472000110

Sort and add attributes

Sort the states and add the attribute country to each record.

Start file
State.new(:name => "Ohio")
State.new(:name => "Wisconsin")
State.new(:name => "Iowa")
State.new(:name => "Virginia")
State.new(:name => "Utah")
State.new(:name => "Arizona")
State.new(:name => "Mississippi")
State.new(:name => "Michigan")
State.new(:name => "Virgin Islands")
State.new(:name => "Delaware")
State.new(:name => "North Carolina")
State.new(:name => "Montana")
State.new(:name => "Vermont")
State.new(:name => "New Jersey")
State.new(:name => "Illinois")
State.new(:name => "New Hampshire")
State.new(:name => "Kansas")
State.new(:name => "Texas")
State.new(:name => "Alabama")
State.new(:name => "Pennsylvania")
State.new(:name => "Louisiana")
State.new(:name => "Washington")
State.new(:name => "North Dakota")
State.new(:name => "Indiana")
State.new(:name => "South Carolina")
State.new(:name => "Hawaii")
State.new(:name => "Idaho")
State.new(:name => "Nebraska")
State.new(:name => "Tennessee")
State.new(:name => "Wyoming")
State.new(:name => "Colorado")
State.new(:name => "Rhode Island")
State.new(:name => "Connecticut")
State.new(:name => "Maryland")
State.new(:name => "Alaska")
State.new(:name => "Minnesota")
State.new(:name => "West Virginia")
State.new(:name => "Oklahoma")
State.new(:name => "Arkansas")
State.new(:name => "New Mexico")
State.new(:name => "Missouri")
State.new(:name => "Guam")
State.new(:name => "Maine")
State.new(:name => "New York")
State.new(:name => "Florida")
State.new(:name => "South Dakota")
State.new(:name => "Georgia")
State.new(:name => "Kentucky")
State.new(:name => "Oregon")
State.new(:name => "Nevada")
State.new(:name => "Massachusetts")
State.new(:name => "California")
End file
State.new(:name => "Alabama", :country => "USA")
State.new(:name => "Alaska", :country => "USA")
State.new(:name => "Arizona", :country => "USA")
State.new(:name => "Arkansas", :country => "USA")
State.new(:name => "California", :country => "USA")
State.new(:name => "Colorado", :country => "USA")
State.new(:name => "Connecticut", :country => "USA")
State.new(:name => "Delaware", :country => "USA")
State.new(:name => "Florida", :country => "USA")
State.new(:name => "Georgia", :country => "USA")
State.new(:name => "Guam", :country => "USA")
State.new(:name => "Hawaii", :country => "USA")
State.new(:name => "Idaho", :country => "USA")
State.new(:name => "Illinois", :country => "USA")
State.new(:name => "Indiana", :country => "USA")
State.new(:name => "Iowa", :country => "USA")
State.new(:name => "Kansas", :country => "USA")
State.new(:name => "Kentucky", :country => "USA")
State.new(:name => "Louisiana", :country => "USA")
State.new(:name => "Maine", :country => "USA")
State.new(:name => "Maryland", :country => "USA")
State.new(:name => "Massachusetts", :country => "USA")
State.new(:name => "Michigan", :country => "USA")
State.new(:name => "Minnesota", :country => "USA")
State.new(:name => "Mississippi", :country => "USA")
State.new(:name => "Missouri", :country => "USA")
State.new(:name => "Montana", :country => "USA")
State.new(:name => "Nebraska", :country => "USA")
State.new(:name => "Nevada", :country => "USA")
State.new(:name => "New Hampshire", :country => "USA")
State.new(:name => "New Jersey", :country => "USA")
State.new(:name => "New Mexico", :country => "USA")
State.new(:name => "New York", :country => "USA")
State.new(:name => "North Carolina", :country => "USA")
State.new(:name => "North Dakota", :country => "USA")
State.new(:name => "Ohio", :country => "USA")
State.new(:name => "Oklahoma", :country => "USA")
State.new(:name => "Oregon", :country => "USA")
State.new(:name => "Pennsylvania", :country => "USA")
State.new(:name => "Rhode Island", :country => "USA")
State.new(:name => "South Carolina", :country => "USA")
State.new(:name => "South Dakota", :country => "USA")
State.new(:name => "Tennessee", :country => "USA")
State.new(:name => "Texas", :country => "USA")
State.new(:name => "Utah", :country => "USA")
State.new(:name => "Vermont", :country => "USA")
State.new(:name => "Virgin Islands", :country => "USA")
State.new(:name => "Virginia", :country => "USA")
State.new(:name => "Washington", :country => "USA")
State.new(:name => "West Virginia", :country => "USA")
State.new(:name => "Wisconsin", :country => "USA")
State.new(:name => "Wyoming", :country => "USA")

View Diff

1,52c1,52
< State.new(:name => "Ohio")
< State.new(:name => "Wisconsin")
< State.new(:name => "Iowa")
< State.new(:name => "Virginia")
< State.new(:name => "Utah")
< State.new(:name => "Arizona")
< State.new(:name => "Mississippi")
< State.new(:name => "Michigan")
< State.new(:name => "Virgin Islands")
< State.new(:name => "Delaware")
< State.new(:name => "North Carolina")
< State.new(:name => "Montana")
< State.new(:name => "Vermont")
< State.new(:name => "New Jersey")
< State.new(:name => "Illinois")
< State.new(:name => "New Hampshire")
< State.new(:name => "Kansas")
< State.new(:name => "Texas")
< State.new(:name => "Alabama")
< State.new(:name => "Pennsylvania")
< State.new(:name => "Louisiana")
< State.new(:name => "Washington")
< State.new(:name => "North Dakota")
< State.new(:name => "Indiana")
< State.new(:name => "South Carolina")
< State.new(:name => "Hawaii")
< State.new(:name => "Idaho")
< State.new(:name => "Nebraska")
< State.new(:name => "Tennessee")
< State.new(:name => "Wyoming")
< State.new(:name => "Colorado")
< State.new(:name => "Rhode Island")
< State.new(:name => "Connecticut")
< State.new(:name => "Maryland")
< State.new(:name => "Alaska")
< State.new(:name => "Minnesota")
< State.new(:name => "West Virginia")
< State.new(:name => "Oklahoma")
< State.new(:name => "Arkansas")
< State.new(:name => "New Mexico")
< State.new(:name => "Missouri")
< State.new(:name => "Guam")
< State.new(:name => "Maine")
< State.new(:name => "New York")
< State.new(:name => "Florida")
< State.new(:name => "South Dakota")
< State.new(:name => "Georgia")
< State.new(:name => "Kentucky")
< State.new(:name => "Oregon")
< State.new(:name => "Nevada")
< State.new(:name => "Massachusetts")
< State.new(:name => "California")
---
> State.new(:name => "Alabama", :country => "USA")
> State.new(:name => "Alaska", :country => "USA")
> State.new(:name => "Arizona", :country => "USA")
> State.new(:name => "Arkansas", :country => "USA")
> State.new(:name => "California", :country => "USA")
> State.new(:name => "Colorado", :country => "USA")
> State.new(:name => "Connecticut", :country => "USA")
> State.new(:name => "Delaware", :country => "USA")
> State.new(:name => "Florida", :country => "USA")
> State.new(:name => "Georgia", :country => "USA")
> State.new(:name => "Guam", :country => "USA")
> State.new(:name => "Hawaii", :country => "USA")
> State.new(:name => "Idaho", :country => "USA")
> State.new(:name => "Illinois", :country => "USA")
> State.new(:name => "Indiana", :country => "USA")
> State.new(:name => "Iowa", :country => "USA")
> State.new(:name => "Kansas", :country => "USA")
> State.new(:name => "Kentucky", :country => "USA")
> State.new(:name => "Louisiana", :country => "USA")
> State.new(:name => "Maine", :country => "USA")
> State.new(:name => "Maryland", :country => "USA")
> State.new(:name => "Massachusetts", :country => "USA")
> State.new(:name => "Michigan", :country => "USA")
> State.new(:name => "Minnesota", :country => "USA")
> State.new(:name => "Mississippi", :country => "USA")
> State.new(:name => "Missouri", :country => "USA")
> State.new(:name => "Montana", :country => "USA")
> State.new(:name => "Nebraska", :country => "USA")
> State.new(:name => "Nevada", :country => "USA")
> State.new(:name => "New Hampshire", :country => "USA")
> State.new(:name => "New Jersey", :country => "USA")
> State.new(:name => "New Mexico", :country => "USA")
> State.new(:name => "New York", :country => "USA")
> State.new(:name => "North Carolina", :country => "USA")
> State.new(:name => "North Dakota", :country => "USA")
> State.new(:name => "Ohio", :country => "USA")
> State.new(:name => "Oklahoma", :country => "USA")
> State.new(:name => "Oregon", :country => "USA")
> State.new(:name => "Pennsylvania", :country => "USA")
> State.new(:name => "Rhode Island", :country => "USA")
> State.new(:name => "South Carolina", :country => "USA")
> State.new(:name => "South Dakota", :country => "USA")
> State.new(:name => "Tennessee", :country => "USA")
> State.new(:name => "Texas", :country => "USA")
> State.new(:name => "Utah", :country => "USA")
> State.new(:name => "Vermont", :country => "USA")
> State.new(:name => "Virgin Islands", :country => "USA")
> State.new(:name => "Virginia", :country => "USA")
> State.new(:name => "Washington", :country => "USA")
> State.new(:name => "West Virginia", :country => "USA")
> State.new(:name => "Wisconsin", :country => "USA")
> State.new(:name => "Wyoming", :country => "USA")

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 550 remaining solutions by signing in and submitting your own entry
#551 lujianmei / @lujianmei - Score: 80 - 09/05/17 @ 09:14
:sort<CR>:%s/)/,:country => ""<C-B><C-E><C-B><C-E><Left>USA<C-F><Esc><CR>uuu:sort<CR>:%s/)/, :country => "USA:<BS>")/g<CR>ZZ

0 comments


Created by: @cloudsplitter

551 active golfers, 1418 entries

Leaderboard (lowest score wins):
41
#511 - Nathanael Kane / @nathanaelkane

12/28/2010 at 11:08PM

41
#512 - Peter Stuifzand / @pstuifzand

12/28/2010 at 11:18PM

41
#513 - David Wolever / @wolever

12/29/2010 at 01:13AM

41
#514 - Dhruva Sagar / @dhruvasagar

12/29/2010 at 02:42AM

41
#515 - Micheal Wells / @michealwwells

08/04/2022 at 05:38PM

41
#516 - Daniel / @Daniel55042385

02/06/2023 at 07:34AM

41
#517 - Olivier Bégassat / @zk_evm

06/16/2023 at 01:23AM

42
#518 - Dan Wanek / @zentourist

12/28/2010 at 09:46PM

42
#519 - claytron / @claytron

12/28/2010 at 10:25PM

42
#520 - Tommy Stanton / @tommystanton

12/29/2010 at 12:11AM

42
#521 - Cartney McLennon / @mepsi_pax

12/29/2010 at 01:12AM

42
#522 - Bartek Ciszkowski / @bartekci

12/29/2010 at 03:42AM

42
#523 - caseyvega / @caseyvega

12/29/2010 at 04:33AM

42
#524 - Michael Lustfield / @Profarius

12/29/2010 at 06:46AM

42
#525 - Jan B. / @bracki

12/29/2010 at 09:31AM

42
#526 - Do Trong Thanh / @DoTrongThanh4

10/16/2023 at 06:15AM

43
#527 - Cap / @cappy_haddock

12/29/2010 at 08:37AM

43
#528 - DJ Adams / @qmacro

12/29/2010 at 05:49PM

43
#529 - Kudryavtsev Alexandr / @kudryav_a

12/16/2012 at 07:07PM

43
#530 - wilddog64 / @chengkai318

12/17/2013 at 09:15PM

44
#531 - Soliman Sylvain / @sylvain_soliman

12/28/2010 at 09:50PM

44
#532 - moh ayaya / @AyayaMoh

03/02/2024 at 01:30PM

45
#533 - Drew Neil / @nelstrom

12/28/2010 at 10:09PM

45
#534 - jonbell17 / @jonbell17

12/28/2010 at 10:27PM

46
#535 - Eric Budd / @clam_tea

12/28/2010 at 09:49PM

46
#536 - luffy / @raxcoi

06/07/2015 at 09:05PM

47
#537 - Paul Tarjan / @ptarjan

12/28/2010 at 09:19PM

47
#538 - Lee Marlow / @lmarlow

12/28/2010 at 10:02PM

47
#539 - Simon Zimmermann / @simonz05

12/28/2010 at 10:50PM

47
#540 - Rasmus P / @rasmup

12/29/2010 at 05:43PM