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 5e2786a9ee9d370009f72c0a

Hogwarts Email Sorting

Given a list of emails, get the students full name and their associated house.

Start file
james.potter@gryffindor.hogwarts.edu
sirius.black@gryffindor.hogwarts.edu
lily.potter@gryffindor.hogwarts.edu
draco.malfoy@slytherin.hogwarts.edu
harry.potter@gryffindor.hogwarts.edu
susan.bones@hufflepuff.hogwarts.edu
luna.lovegood@ravenclaw.hogwarts.edu
pansy.parkinson@slytherin.hogwarts.edu
cedric.diggory@hufflepuff.hogwarts.edu
cho.chang@hufflepuff.hogwarts.edu
End file
James Potter Gryffindor
Sirius Black Gryffindor
Lily Potter Gryffindor
Draco Malfoy Slytherin
Harry Potter Gryffindor
Susan Bones Hufflepuff
Luna Lovegood Ravenclaw
Pansy Parkinson Slytherin
Cedric Diggory Hufflepuff
Cho Chang Hufflepuff

View Diff

1,10c1,10
< james.potter@gryffindor.hogwarts.edu
< sirius.black@gryffindor.hogwarts.edu
< lily.potter@gryffindor.hogwarts.edu
< draco.malfoy@slytherin.hogwarts.edu
< harry.potter@gryffindor.hogwarts.edu
< susan.bones@hufflepuff.hogwarts.edu
< luna.lovegood@ravenclaw.hogwarts.edu
< pansy.parkinson@slytherin.hogwarts.edu
< cedric.diggory@hufflepuff.hogwarts.edu
< cho.chang@hufflepuff.hogwarts.edu
---
> James Potter Gryffindor
> Sirius Black Gryffindor
> Lily Potter Gryffindor
> Draco Malfoy Slytherin
> Harry Potter Gryffindor
> Susan Bones Hufflepuff
> Luna Lovegood Ravenclaw
> Pansy Parkinson Slytherin
> Cedric Diggory Hufflepuff
> Cho Chang Hufflepuff

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 154 remaining solutions by signing in and submitting your own entry
#155 Christophe Kafrouni / @KafrouniChris - Score: 590 - 04/29/20 @ 16:06
:%s<CR>:%s/\([<50-53>vimgolf put 5e2786a9ee9d370009f72c0a<Esc>[201~<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><50-53>[a-z]*\<Esc>[201~<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~uuuu<50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~<50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~uuuu:<50-53>:%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<CR>:wq!<CR><Esc>[201~<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><CR>:<50-53>%s/\([a-z]*\)[.]\([a-z]*\)[@]\([a-z]*\).*/\u\1 \u\2 \u\3/g<Esc>[201~<CR>:<50-53>:wq<Esc>[201~<CR>

0 comments


Created by: @ujwalnarayan

155 active golfers, 561 entries

Leaderboard (lowest score wins):
20
#31 - 于吉星 / @fishermryn

05/25/2020 at 09:00AM

20
#32 - Robberechts Arne / @ArneRobberechts

06/14/2020 at 07:30PM

21
#33 - garry quested / @GQuested

01/23/2020 at 10:02AM

21
#34 - Noisome Possum / @NoisomePossum

01/23/2020 at 04:54PM

21
#35 - Scott Smith / @Scottaino

01/25/2020 at 12:06AM

21
#36 - Quentin Plazar / @QuentinPlazar

01/27/2020 at 07:40AM

21
#37 - TimMcGuire / @mcguire

02/03/2020 at 07:33PM

21
#38 - Emil / @emilklindt

02/04/2020 at 07:50PM

21
#39 - Robber Toe / @robbertoe

02/09/2020 at 03:06AM

21
#40 - stretchy / @stretch11013132

02/16/2020 at 03:09PM

21
#41 - KingYames / @JamesZeHunter

02/17/2020 at 05:19AM

21
#42 - Rollo Jenkins / @rollo_jenkins

02/18/2020 at 05:04PM

21
#43 - golferN / @golferN3

02/25/2020 at 08:38PM

21
#44 - Johnny John / @JohnnyJ74406671

02/28/2020 at 09:12AM

21
#45 - floyd / @floyd10086

03/01/2020 at 04:22PM

21
#46 - Alexander Bessonov / @nonsleepr

03/02/2020 at 02:15PM

21
#47 - Matt Drover / @mdrover25

03/05/2020 at 06:28PM

21
#48 - Paul Parker / @PaulDesmoParker

03/06/2020 at 11:10PM

21
#49 - Adam Hartz / @awareofnow

03/09/2020 at 06:35PM

21
#50 - 薛浩滎 / @iTPChbTeI4ZW9s3

03/17/2020 at 04:59AM

21
#51 - vvaannaa3 / @vvaannaa3

03/21/2020 at 10:11PM

21
#52 - BnnGolfer / @BnnGolfer

03/22/2020 at 09:45PM

21
#53 - Seve / @__Seve__

04/09/2020 at 03:26PM

21
#54 - Roger Stoltz / @rogsto1

04/23/2020 at 10:00PM

21
#55 - Quentin Leroy / @qnleroy

05/14/2020 at 06:30PM

21
#56 - Rob Pilling / @bobrippling

05/19/2020 at 05:00PM

21
#57 - LCY / @Chooneh

06/05/2020 at 10:04AM

21
#58 - otfsenter / @otfsenter

06/06/2020 at 11:15AM

21
#59 - mocihan / @mocihan

07/01/2020 at 12:33PM

22
#60 - Derek Schrock / @derekschrock

01/21/2020 at 11:34PM