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):
43
#31 - Youngchan Lee / @edwardycl

06/03/2021 at 05:16AM

44
#32 - AAbraxas / @AAbraxas1

02/04/2021 at 08:36PM

44
#33 - Andreas Siegrist / @andreaszwei

06/16/2021 at 03:17PM

45
#34 - Blake Tereau / @BlakeTereau

02/07/2021 at 11:35PM

45
#35 - Martin LOUAZEL / @Zbrahark

02/24/2021 at 08:30AM

45
#36 - Winnie Yeung / @vionwinnie

07/02/2021 at 01:27AM

45
#37 - Hossein Yousefi 💙 / @u_hossein

03/03/2022 at 02:53AM

45
#38 - Alex / @AlexanderHeatl2

07/26/2022 at 09:33PM

46
#39 - Chris Conte / @chriscconte

02/11/2021 at 02:04AM

46
#40 - A White Dwarf / @AWhiteDwarf1

06/28/2021 at 06:09PM

47
#41 - "Smylers" / @Smylers2

02/04/2021 at 09:33AM

47
#42 - Bspammer / @Bspammer

08/15/2021 at 02:39PM

48
#43 - Paul Inc / @hiniol1982

02/05/2021 at 07:42PM

48
#44 - constap / @constap

04/25/2024 at 10:26PM

49
#45 - grsh / @girish_i_am

05/23/2021 at 12:00PM

50
#46 - Daniel Qu / @danielq9871

05/10/2021 at 04:47PM

50
#47 - Vahan / @Vahan00900245

10/06/2021 at 03:17PM

52
#48 - Eric Söderström / @eksoderstrom

03/18/2021 at 02:40PM

53
#49 - philip / @philip5530

03/03/2022 at 02:46AM

53
#50 - James Hayden / @don_jaime

10/22/2022 at 05:34AM

54
#51 - Jonáš Šerých / @serycjon

02/03/2021 at 01:54PM

54
#52 - syuusaku / @GSyuusaku

02/20/2021 at 11:31AM

54
#53 - huscarl / @huscarl6

05/20/2021 at 04:38AM

54
#54 - Arjan Verkerk / @adverkerk

03/30/2022 at 08:47AM

55
#55 - Michael / @triorph

11/10/2021 at 07:38AM

55
#56 - Druhan Shah / @DruhanShah

01/14/2024 at 08:59AM

56
#57 - rappenstein2 / @rappenstein2

01/13/2022 at 10:36PM

56
#58 - JVIM / @JVIM101

02/22/2022 at 12:39PM

57
#59 - idontwantaaccount / @fkURaccounts

11/30/2022 at 05:31PM

58
#60 - simplelife2010 / @simplelife20101

05/13/2021 at 12:26PM