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 6019f1c4642668000cee11e8

Generate a very basic Python constructor

I actually needed to do this myself, so I look forward to learning how.

Start file
def __init__(self, x, y, z, rotation, color, bounciness, walking_speed, running_speed, health, defense, age, type1, type2):
End file
def __init__(self, x, y, z, rotation, color, bounciness, walking_speed, running_speed, health, defense, age, type1, type2):
    self.x = x
    self.y = y
    self.z = z
    self.rotation = rotation
    self.color = color
    self.bounciness = bounciness
    self.walking_speed = walking_speed 
    self.running_speed = running_speed
    self.health = health
    self.defense = defense
    self.age = age 
    self.type1 = type1
    self.type2 = type2

View Diff

1a2,14
>     self.x = x
>     self.y = y
>     self.z = z
>     self.rotation = rotation
>     self.color = color
>     self.bounciness = bounciness
>     self.walking_speed = walking_speed 
>     self.running_speed = running_speed
>     self.health = health
>     self.defense = defense
>     self.age = age 
>     self.type1 = type1
>     self.type2 = type2

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 96 remaining solutions by signing in and submitting your own entry
#97 วทททท / @uhTOWreLzQy0JN5 - Score: 351 - 03/02/22 @ 14:18
o<BS>    self.<Esc>yy12p<CR>$<Up><Up>i<Right>x = x<Down>y = y<Down>z = z<Down>rotation<Esc>yiw$i <BS><Right> = <Esc>p<Down>i<Right>color = oo<BS><BS>color<Down>bounciness<Esc>yiw$i<Right> = <Esc>p<Down>i<Right>walking_speed <BS><Esc>yiw$i<Right> = <Esc>p<Down>i<Right>running_speed <BS> = <BS><BS><BS><Esc>yiw$i =<BS><BS><Right> =<Esc>i<Right> <Esc>pi<Up><Right> <Down><Down>health<Esc>yiw$i<Right> = <Esc>p<Down>i<Right>defenc<BS>se<Esc>yiw$i<Right> = `<Esc>pbi<BS><Down>age=<BS> = age <Down>type1 = type1<Down>type2 = type2<Esc>cccccbbjeuetgrgluehidbfnutdfujvcfnilfnubhigb<CR>dd<BS><BS><Esc>ddddoself.type2 = type2<Esc>:wq<CR>

0 comments


#98 nickGPT / @nickandbro - Score: 351 - 08/24/24 @ 03:08
o<BS>    self.<Esc>yy12p<CR>$<Up><Up>i<Right>x = x<Down>y = y<Down>z = z<Down>rotation<Esc>yiw$i <BS><Right> = <Esc>p<Down>i<Right>color = oo<BS><BS>color<Down>bounciness<Esc>yiw$i<Right> = <Esc>p<Down>i<Right>walking_speed <BS><Esc>yiw$i<Right> = <Esc>p<Down>i<Right>running_speed <BS> = <BS><BS><BS><Esc>yiw$i =<BS><BS><Right> =<Esc>i<Right> <Esc>pi<Up><Right> <Down><Down>health<Esc>yiw$i<Right> = <Esc>p<Down>i<Right>defenc<BS>se<Esc>yiw$i<Right> = `<Esc>pbi<BS><Down>age=<BS> = age <Down>type1 = type1<Down>type2 = type2<Esc>cccccbbjeuetgrgluehidbfnutdfujvcfnilfnubhigb<CR>dd<BS><BS><Esc>ddddoself.type2 = type2<Esc>:wq<CR>

0 comments


Created by: @BiddulphCaleb

98 active golfers, 316 entries

Leaderboard (lowest score wins):
38
#1 - Jon Krause / @jkrause314

02/04/2021 at 08:18PM

38
#2 - A A A / @37fatos

02/04/2021 at 08:40PM

38
#3 - John Braxler / @braxler

02/05/2021 at 03:54PM

38
#4 - Duncan / @Duncan31503119

02/07/2021 at 03:19AM

38
#5 - hamb / @hamb88140219

02/25/2021 at 08:11PM

38
#6 - der tanzbaer / @der_tanzbaer

03/10/2021 at 10:47PM

38
#7 - Ray Dennis / @raysden

05/19/2021 at 01:18PM

38
#8 - Arya Kumar / @SusSquirrel

05/22/2021 at 07:52PM

38
#9 - Kyle / @Kyle98675198

05/30/2021 at 12:12AM

38
#10 - Miłosz Łakomy / @foobar01123

06/20/2021 at 10:05AM

38
#11 - Georg Bökman / @BokmanGeorg

07/03/2021 at 12:02AM

38
#12 - sap / @sap38838304

07/03/2021 at 04:51AM

38
#13 - 悟史 / @A1OBJTxN5fTg5EJ

07/12/2021 at 04:48PM

38
#14 - ゆに / @lededex

07/13/2021 at 07:36PM

38
#15 - Roman Privalov / @RomanPrivalov

08/29/2021 at 09:58PM

38
#16 - Tanzeel Kazi / @tanzeelkazi

10/14/2021 at 05:38PM

38
#17 - Brendan Maginnis / @brendan_m6s

11/17/2021 at 11:33AM

38
#18 - José Medrano / @happylilmexican

12/09/2021 at 08:29PM

38
#19 - Humbaba / @humbabu

01/03/2022 at 08:28PM

38
#20 - Brett Bender / @brttbndr

02/25/2022 at 04:40AM

38
#21 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

07/24/2022 at 09:41PM

38
#22 - Aly Thobani / @alythobani

05/29/2024 at 10:41AM

38
#23 - Peppa Pig / @PeppaPi95550250

05/31/2024 at 04:12AM

39
#24 - roudens / @roudens2

05/22/2021 at 02:02PM

39
#25 - mevmev / @mevmev8

10/06/2021 at 04:32PM

39
#26 - Jean George / @JeanGeo20504212

11/26/2021 at 03:46PM

39
#27 - quemeraisc / @quemeraisc

08/23/2022 at 02:39PM

40
#28 - 0xf00ff00f / @0xf00ff00f

10/19/2023 at 07:26PM

42
#29 - Luoyb / @Luoyb

10/24/2023 at 06:13AM

43
#30 - Calarasanu Andrei / @_fanfani4_

05/18/2021 at 07:43PM