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

RUST match with enum for Coin

RUST match with enum for Coin rusty practice on vimgolf

Start file
enum Coin {
       
Penny,
       
Nickel,
       
Dime,
       
Quarter,
}
End file
enum Coin {
       
Penny,
       
Nickel,
       
Dime,
       
Quarter,
}

fn value_in_cents
(coin: Coin) -> u32 {
        match coin
{
               
Coin::Penny => 1,
               
Coin::Nickel => 5,
               
Coin::Dime => 10,
               
Coin::Quarter => 25,
       
}
}

View Diff

6a7,15
>
> fn value_in_cents(coin: Coin) -> u32 {
>       match coin {
>               Coin::Penny => 1,
>               Coin::Nickel => 5,
>               Coin::Dime => 10,
>               Coin::Quarter => 25,
>       }
> }

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 52 remaining solutions by signing in and submitting your own entry
#53 Duy nguyễn / @Duycld03 - Score: 188 - 08/11/23 @ 13:55
Go<CR>fn value_in_cents(coin: Coin) -> u23<BS><BS>32 {<CR>}<Esc>komatch u<BS>coin [<BS>{<CR>}<Esc>kod<Esc>ddkkkkkkkkkjqq^yiwjjjjjjjoCoin::<Esc>pa +<BS>=> 1,<Esc>kkkkkkkq3@qGo<Esc>kkkkkkt,jlr5ji0<Esc>jwciw25<Esc>kkkVjjj>Vjjj<kVjjjjj<Vjjjjj>j:wq<CR>

0 comments


Created by: @pykJzzzsmAzloZl

53 active golfers, 183 entries

Leaderboard (lowest score wins):
108
#31 - Desentcare / @ashuyali

08/25/2022 at 07:06AM

109
#32 - Karan / @Karan22350073

10/01/2022 at 03:50PM

110
#33 - fff / @fff51460170

01/13/2021 at 04:13AM

111
#34 - Jung Yeon Park / @park_jungy

12/31/2020 at 06:34PM

111
#35 - Andreas Siegrist / @andreaszwei

01/22/2021 at 09:19PM

111
#36 - Miłosz Łakomy / @foobar01123

06/19/2021 at 11:38AM

115
#37 - justinhj / @justinhj

12/24/2020 at 07:04PM

116
#38 - TheSemicolon / @the_semicolon_

12/21/2020 at 02:54PM

118
#39 - 'ymdarake / @ymdarake

09/04/2022 at 10:26AM

124
#40 - 盧小小 / @VegetaLu

04/02/2022 at 09:55AM

127
#41 - maxtong / @maxtong1987

03/19/2021 at 10:38AM

130
#42 - Sebastien Spoon / @SebastienSpoon

12/28/2020 at 07:47AM

131
#43 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 12:40PM

137
#44 - Scott Atkins / @scottrick49

05/28/2021 at 04:50PM

137
#45 - h / @tgen22334

03/17/2022 at 05:08AM

139
#46 - NOT_FOR_TWEETS / @_NOTIMPLEMENTED

04/24/2023 at 07:38PM

144
#47 - Bharath / @Bharath15952517

05/09/2021 at 06:57AM

151
#48 - noam teyssier / @noamteyssier

06/26/2021 at 08:03PM

156
#49 - Mikołaj / @miko_aj4846

09/03/2023 at 03:17PM

158
#50 - Jan Klatka / @KlatkaJan

05/27/2021 at 01:48PM

163
#51 - dvorak4tzx / @dvorak4tzx4

12/28/2020 at 05:08PM

163
#52 - 梅 / @umetosawara

04/12/2022 at 01:05PM

188
#53 - Duy nguyễn / @Duycld03

08/11/2023 at 01:55PM