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):
84
#1 - Roman Privalov / @RomanPrivalov

09/03/2021 at 02:07PM

84
#2 - Peppa Pig / @PeppaPigSg

07/02/2024 at 05:39AM

85
#3 - chocolate / @chocola81394123

01/08/2021 at 04:28AM

85
#4 - John Braxler / @braxler

09/03/2021 at 06:02PM

86
#5 - Nicolas Pagny / @NicolasPagny

01/08/2021 at 10:25AM

87
#6 - 김도현 / @pykJzzzsmAzloZl

12/23/2020 at 04:00AM

88
#7 - nicosierra / @nicosierra84

12/21/2020 at 08:46PM

88
#8 - roudens / @roudens2

12/27/2020 at 12:08PM

88
#9 - Luoyb / @Luoyb

10/25/2023 at 12:19AM

90
#10 - quemeraisc / @quemeraisc

08/21/2021 at 05:27PM

91
#11 - Saki Gw / @Sakigw

12/21/2020 at 08:29AM

91
#12 - Иван / @wansmer

04/25/2023 at 08:22PM

93
#13 - "Smylers" / @Smylers2

12/21/2020 at 10:26PM

93
#14 - 영훈 / @odjfnrtm

12/22/2020 at 07:14AM

93
#15 - Dmitry Antonyuk / @dm_antonyuk

08/24/2021 at 04:23PM

94
#16 - Austin Willliams / @GuitarMusash616

11/12/2022 at 08:03PM

95
#17 - Daniel Andersson / @AnderssonDanzig

01/30/2021 at 07:12PM

96
#18 - der tanzbaer / @der_tanzbaer

03/10/2021 at 11:27PM

96
#19 - Aly Thobani / @alythobani

05/29/2024 at 08:55AM

100
#20 - Ray Dennis / @raysden

02/09/2021 at 02:49PM

102
#21 - Yāsky / @Yaasky

01/17/2023 at 07:34PM

103
#22 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 05:01PM

103
#23 - Vimgolf User / @VimgolfU

11/14/2023 at 06:48PM

104
#24 - Rick de chez Gnous / @GnousRick

07/08/2021 at 07:05PM

105
#25 - nigaslivesmatter / @nigaslivesmatt1

12/27/2020 at 05:05PM

105
#26 - pikjes / @pikjes2

03/21/2021 at 01:41PM

105
#27 - sap / @sap38838304

07/03/2021 at 05:31AM

106
#28 - Hourann Lin / @HourannLin

08/05/2021 at 02:50PM

107
#29 - Giacomo Sansone / @pcineverdies

07/05/2024 at 07:45PM

108
#30 - Niko Steinhoff / @niko_steinhoff

12/22/2020 at 05:58AM