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

Python challenge

Change the types of the variables in the list from str to float, while keeping the truncation.

Start file
a = ['%.3f' % 3.5313423, '%.1f' % 35.66]
b = ['%.3f' % 3.90022, '%.1f' % 95.501033]
c = ['%.5f' % self.numbers[2]]
End file
a = [round(3.5313423, 3), round(35.66, 1)]
b = [round(3.90022, 3), round(95.501033, 1)]
c = [round(self.numbers[2], 5)]

View Diff

1,3c1,3
< a = ['%.3f' % 3.5313423, '%.1f' % 35.66]
< b = ['%.3f' % 3.90022, '%.1f' % 95.501033]
< c = ['%.5f' % self.numbers[2]]
---
> a = [round(3.5313423, 3), round(35.66, 1)]
> b = [round(3.90022, 3), round(95.501033, 1)]
> c = [round(self.numbers[2], 5)]

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 38 remaining solutions by signing in and submitting your own entry
#39 Dany Alexander Caro Saavedra / @DanyAlexanderC7 - Score: 138 - 12/28/18 @ 21:03
f'qa2dWiround(W<C-H><Esc>W3<Esc>i3)q<C-H><Esc>ql@axhxkllllllllllllllllllllllll hi <Esc>lllllllllllli, 1)<Esc>j^f'@aa,<Esc>kla,<Esc>jh@a<C-H><C-H>jkFri <Esc>2f3a, 1)<Esc>j^xx?<Esc><Esc>f'@ai<C-H><Esc>a, 5<Esc>ZZ

0 comments


Created by: @rax0m

39 active golfers, 128 entries

Leaderboard (lowest score wins):
59
#31 - pankaj singh / @pankajsingh013

01/10/2019 at 10:45AM

62
#32 - Nikos Koukis / @bergercookie12

01/03/2019 at 10:49AM

63
#33 - Marc Päpper / @mpaepper

01/28/2019 at 07:29AM

64
#34 - Melvin Cheung / @MelvinCheung

11/13/2019 at 02:14AM

73
#35 - Daniel K. / @lan4k

12/29/2018 at 02:04PM

87
#36 - Kyle Safran / @kylesafran

01/19/2019 at 03:34AM

107
#37 - Jose Villalta 👨‍💻 / @PhilosoGeekDad

01/03/2019 at 11:23PM

126
#38 - 默罕默德 / @Rt6RjEAJ987Woes

02/19/2019 at 10:36AM

138
#39 - Dany Alexander Caro Saavedra / @DanyAlexanderC7

12/28/2018 at 09:03PM