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 545baafb7974800002353443

Replace Parameter with Explicit Methods

Implementing the methods of a Java Interface

Start file
import ch.xyz.Logger;

public class LoggerImpl implements Logger {

	private void log(LogLevel lvl, String str) {
		/* Code */
	}

	@Override
	public void emerge(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void alert(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void critical(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void warning(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void notice(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void info(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override
	public void debug(String str) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

}
End file
import ch.xyz.Logger;

public class LoggerImpl implements Logger {

	private void log(LogLevel lvl, String str) {
		/* Code */
	}

	@Override
	public void emerge(String str) {
		log(LogLevel.EMERGE, str);
	}

	@Override
	public void alert(String str) {
		log(LogLevel.ALERT, str);
	}

	@Override
	public void critical(String str) {
		log(LogLevel.CRITICAL, str);
	}

	@Override
	public void warning(String str) {
		log(LogLevel.WARNING, str);
	}

	@Override
	public void notice(String str) {
		log(LogLevel.NOTICE, str);
	}

	@Override
	public void info(String str) {
		log(LogLevel.INFO, str);
	}

	@Override
	public void debug(String str) {
		log(LogLevel.DEBUG, str);
	}

}

View Diff

11c11
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.EMERGE, str);
16c16
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.ALERT, str);
21c21
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.CRITICAL, str);
26c26
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.WARNING, str);
31c31
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.NOTICE, str);
36c36
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.INFO, str);
41c41
< 		throw new UnsupportedOperationException("Not supported yet.");
---
> 		log(LogLevel.DEBUG, str);

Solutions by @morrizon:

Unlock 6 remaining solutions by signing in and submitting your own entry
Created by: @etifiux

27 active golfers, 76 entries

Solutions by @morrizon:
35
#7 - Carlos López / @morrizon

11/20/2014 at 10:58AM

38
#>11 - Carlos López / @morrizon

11/20/2014 at 10:08AM

40
#>12 - Carlos López / @morrizon

11/20/2014 at 10:06AM

41
#>13 - Carlos López / @morrizon

11/20/2014 at 10:01AM

42
#>15 - Carlos López / @morrizon

11/20/2014 at 10:00AM

46
#>19 - Carlos López / @morrizon

11/20/2014 at 09:54AM