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 31 remaining solutions by signing in and submitting your own entry
#32 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

32 active golfers, 109 entries

Leaderboard (lowest score wins):
85
#1 - chocolate / @chocola81394123

01/08/2021 at 04:28AM

86
#2 - John Braxler / @braxler

01/06/2021 at 04:44PM

86
#3 - Nicolas Pagny / @NicolasPagny

01/08/2021 at 10:25AM

87
#4 - 김도현 / @pykJzzzsmAzloZl

12/23/2020 at 04:00AM

88
#5 - nicosierra / @nicosierra84

12/21/2020 at 08:46PM

88
#6 - roudens / @roudens2

12/27/2020 at 12:08PM

91
#7 - Saki Gw / @Sakigw

12/21/2020 at 08:29AM

93
#8 - Smylers / @Smylers2

12/21/2020 at 10:26PM

93
#9 - 영훈 / @odjfnrtm

12/22/2020 at 07:14AM

95
#10 - Daniel Andersson / @AnderssonDanzig

01/30/2021 at 07:12PM

96
#11 - der tanzbaer / @der_tanzbaer

03/10/2021 at 11:27PM

100
#12 - Ray Dennis / @raysden

02/09/2021 at 02:49PM

103
#13 - Björn Struckmeier / @BjrnStruckmeie1

01/04/2021 at 05:01PM

104
#14 - Rick de chez Gnous / @GnousRick

07/08/2021 at 07:05PM

105
#15 - nigaslivesmatter / @nigaslivesmatt1

12/27/2020 at 05:05PM

105
#16 - pikjes / @pikjes2

03/21/2021 at 01:41PM

105
#17 - sap / @sap38838304

07/03/2021 at 05:31AM

108
#18 - Niko Steinhoff / @niko_steinhoff

12/22/2020 at 05:58AM

110
#19 - fff / @fff51460170

01/13/2021 at 04:13AM

111
#20 - Jung Yeon Park / @park_jungy

12/31/2020 at 06:34PM

111
#21 - Andreas Siegrist / @andreaszwei

01/22/2021 at 09:19PM

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

06/19/2021 at 11:38AM

115
#23 - justinhj / @justinhj

12/24/2020 at 07:04PM

116
#24 - TheSemicolon / @the_semicolon_

12/21/2020 at 02:54PM

127
#25 - maxtong / @maxtong1987

03/19/2021 at 10:38AM

130
#26 - Sebastien Spoon / @SebastienSpoon

12/28/2020 at 07:47AM

131
#27 - Kapildev Neupane / @KapildevNeupane

01/01/2021 at 12:40PM

137
#28 - Scott Atkins / @scottrick49

05/28/2021 at 04:50PM

144
#29 - Bharath / @Bharath15952517

05/09/2021 at 06:57AM

151
#30 - noam teyssier / @noamteyssier

06/26/2021 at 08:03PM