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 5675405ac5936f0ba3000002

Create bison tokens

Create tokens for bison out of a known list of words

Start file
call real integer write read while end do if then else program var begin return include
End file
call {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Call;
}
real {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Real;
}
integer {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Integer;
}
write {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Write;
}
read {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Read;
}
while {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return While;
}
end {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return End;
}
do {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Do;
}
if {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return If;
}
then {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Then;
}
else {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Else;
}
program {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Program;
}
var {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Var;
}
begin {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Begin;
}
return {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Return;
}
include {
	yylval.type = strdup("res");
	yylval.value = strdup(yytext);
	return Include;
}

View Diff

1c1,80
< call real integer write read while end do if then else program var begin return include
---
> call {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Call;
> }
> real {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Real;
> }
> integer {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Integer;
> }
> write {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Write;
> }
> read {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Read;
> }
> while {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return While;
> }
> end {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return End;
> }
> do {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Do;
> }
> if {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return If;
> }
> then {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Then;
> }
> else {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Else;
> }
> program {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Program;
> }
> var {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Var;
> }
> begin {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Begin;
> }
> return {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Return;
> }
> include {
> 	yylval.type = strdup("res");
> 	yylval.value = strdup(yytext);
> 	return Include;
> }

Solutions by @jkrause314:

Unlock 5 remaining solutions by signing in and submitting your own entry
Created by: @BotticelliAlex

16 active golfers, 34 entries

Solutions by @jkrause314:
86
#4 - Jon Krause / @jkrause314

12/21/2015 at 06:51PM

87
#>5 - Jon Krause / @jkrause314

12/21/2015 at 06:47PM

91
#>7 - Jon Krause / @jkrause314

12/19/2015 at 08:02PM

95
#>8 - Jon Krause / @jkrause314

12/19/2015 at 07:54PM

100
#>9 - Jon Krause / @jkrause314

12/19/2015 at 07:39PM