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 9v0060b0a374000000000206

Lowercase first characters

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

Start file
R1009,U263,L517,U449,L805,D78,L798,D883,L777,D562,R652,D348,R999,D767,L959,U493,R59
L1003,D960,L10,D57,R294,U538,R867,D426,L524,D441,R775,U308,R577,D785,R495,U847,R643
End file
wires([r-1009,u-263,l-517,u-449,l-805,d-78,l-798,d-883,l-777,d-562,r-652,d-348,r-999,d-767,l-959,u-493,r-59],[l-1003,d-960,l-10,d-57,r-294,u-538,r-867,d-426,l-524,d-441,r-775,u-308,r-577,d-785,r-495,u-847,r-643]).

View Diff

1,2c1
< R1009,U263,L517,U449,L805,D78,L798,D883,L777,D562,R652,D348,R999,D767,L959,U493,R59
< L1003,D960,L10,D57,R294,U538,R867,D426,L524,D441,R775,U308,R577,D785,R495,U847,R643
---
> wires([r-1009,u-263,l-517,u-449,l-805,d-78,l-798,d-883,l-777,d-562,r-652,d-348,r-999,d-767,l-959,u-493,r-59],[l-1003,d-960,l-10,d-57,r-294,u-538,r-867,d-426,l-524,d-441,r-775,u-308,r-577,d-785,r-495,u-847,r-643]).

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 182 remaining solutions by signing in and submitting your own entry
#183 Darong Mean / @darong_mean - Score: 79 - 05/29/21 @ 03:41
:%s/R/r-/g<CR>:%s/U/u-/g<CR>:%s/L/l-/g<CR>:%s/D/d-/g<CR>kiwires([<Esc>A]<Esc>j.a).<Esc>0i[<Esc><Esc>kJr,hhh:wq<CR>

0 comments


Created by: @salvipeter

183 active golfers, 487 entries

Leaderboard (lowest score wins):
39
#91 - Aliasf / @rammenmaster96

04/02/2023 at 07:16PM

39
#92 - Monkey Boy / @monkey29089

11/21/2023 at 11:18AM

40
#93 - Ceda EI / @ceda_ei

05/28/2021 at 02:48PM

40
#94 - ThatGuyWithAWeirdHat / @Mousakaaa

07/18/2021 at 08:12AM

40
#95 - Robert Verst / @r_verst

09/21/2021 at 01:15PM

40
#96 - Andey / @AndyonZ

12/28/2021 at 03:14AM

41
#97 - Victor Ramirez / @virako

06/02/2021 at 03:56PM

41
#98 - pikjes / @pikjes2

07/14/2021 at 01:33PM

41
#99 - Ivan Trepakov / @liontiger23

08/29/2021 at 10:44AM

41
#100 - Shreeram / @Shrimpraam

09/28/2021 at 07:06PM

41
#101 - z00master / @z00master

07/29/2022 at 09:22PM

42
#102 - Leandro Peralta / @argenkiwi

07/05/2021 at 02:31AM

42
#103 - e1mnos / @e1mnos

08/10/2021 at 11:47AM

42
#104 - David Cherednik / @david_cherednik

10/25/2021 at 08:13PM

42
#105 - Mohamad Abou Harb / @TwoShock

07/26/2023 at 03:15PM

42
#106 - ilyas / @Ahaaah2071

09/22/2023 at 06:06PM

43
#107 - Byron Batteson / @battesonb

05/29/2021 at 03:53PM

43
#108 - neil / @im_needle

06/20/2021 at 11:14AM

43
#109 - Ben Wainwright / @BenWain13547535

06/26/2021 at 10:42AM

43
#110 - Patrick Martin / @PatrickDMartin

06/29/2021 at 01:27PM

43
#111 - Max Mossberg / @mxmossy

06/30/2021 at 07:08PM

43
#112 - tpoeiras / @tpoeirass

08/01/2021 at 02:32AM

43
#113 - Joey Schmoey / @joeshmow80

02/22/2022 at 03:34AM

43
#114 - 梅 / @umetosawara

04/10/2022 at 05:27AM

43
#115 - sdfghjk / @sdfghjk88424595

04/28/2022 at 12:57AM

43
#116 - e_e / @eleloi

02/12/2023 at 05:41PM

43
#117 - Vinay Sridhar / @kewllip

03/31/2023 at 03:41PM

43
#118 - Olivier Bégassat / @zk_evm

06/11/2023 at 10:41AM

43
#119 - jason songhurst / @spirozh

04/09/2024 at 04:34PM

44
#120 - Ravi S Sinha / @ambidextrousTx

06/01/2021 at 12:52AM