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 35 remaining solutions by signing in and submitting your own entry
#36 dvorak4tzx / @dvorak4tzx4 - Score: 163 - 12/28/20 @ 17:08
j4yyGo<CR>fn value_in_cents(coin: Coin) -> u32 {<CR><C-C><C-C>pkdd<C-V>jjjICoin::<Esc>ko<Tab>match coin {<CR><C-C><C-C>ddqa<S-Tab><Tab><C-C><C-C>i<Tab><C-C><C-C>$i => 1,<BS><C-C><C-C>jq@a>>A<C-C><C-C>i => 5<C-C><C-C>j>>$i => 10<C-C><C-C>j>>$i => 25<C-C><C-C>o}<C-C><C-C><<yyp<<:wq<CR>

0 comments


Created by: @pykJzzzsmAzloZl

36 active golfers, 135 entries

Leaderboard (lowest score wins):
84
#1 - Roman Privalov / @RomanPrivalov

09/03/2021 at 02:07PM

85
#2 - chocolate / @chocola81394123

01/08/2021 at 04:28AM

85
#3 - John Braxler / @braxler

09/03/2021 at 06:02PM

86
#4 - Nicolas Pagny / @NicolasPagny

01/08/2021 at 10:25AM

87
#5 - 김도현 / @pykJzzzsmAzloZl

12/23/2020 at 04:00AM

88
#6 - nicosierra / @nicosierra84

12/21/2020 at 08:46PM

88
#7 - roudens / @roudens2

12/27/2020 at 12:08PM

90
#8 - quemeraisc / @quemeraisc

08/21/2021 at 05:27PM

91
#9 - Saki Gw / @Sakigw

12/21/2020 at 08:29AM

93
#10 - Smylers / @Smylers2

12/21/2020 at 10:26PM

93
#11 - 영훈 / @odjfnrtm

12/22/2020 at 07:14AM

93
#12 - Dmitry Antonyuk / @AntonyukDmitry

08/24/2021 at 04:23PM

95
#13 - Daniel Andersson / @AnderssonDanzig

01/30/2021 at 07:12PM

96
#14 - der tanzbaer / @der_tanzbaer

03/10/2021 at 11:27PM

100
#15 - Ray Dennis / @raysden

02/09/2021 at 02:49PM

103
#16 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 05:01PM

104
#17 - Rick de chez Gnous / @GnousRick

07/08/2021 at 07:05PM

105
#18 - nigaslivesmatter / @nigaslivesmatt1

12/27/2020 at 05:05PM

105
#19 - pikjes / @pikjes2

03/21/2021 at 01:41PM

105
#20 - sap / @sap38838304

07/03/2021 at 05:31AM

106
#21 - Hourann Lin / @HourannLin

08/05/2021 at 02:50PM

108
#22 - Niko Steinhoff / @niko_steinhoff

12/22/2020 at 05:58AM

110
#23 - fff / @fff51460170

01/13/2021 at 04:13AM

111
#24 - Jung Yeon Park / @park_jungy

12/31/2020 at 06:34PM

111
#25 - Andreas Siegrist / @andreaszwei

01/22/2021 at 09:19PM

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

06/19/2021 at 11:38AM

115
#27 - justinhj / @justinhj

12/24/2020 at 07:04PM

116
#28 - TheSemicolon / @the_semicolon_

12/21/2020 at 02:54PM

127
#29 - maxtong / @maxtong1987

03/19/2021 at 10:38AM

130
#30 - Sebastien Spoon / @SebastienSpoon

12/28/2020 at 07:47AM