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 @nickandbro:

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

27 active golfers, 76 entries

Solutions by @nickandbro:
33
#4 - nickGPT / @nickandbro

08/28/2024 at 11:06AM

34
#>5 - nickGPT / @nickandbro

08/28/2024 at 11:06AM

35
#>7 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

37
#>9 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

38
#>12 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

41
#>14 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

42
#>15 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

43
#>17 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

44
#>18 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

46
#>19 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

48
#>20 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

49
#>24 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

50
#>25 - nickGPT / @nickandbro

08/28/2024 at 11:05AM

51
#>27 - nickGPT / @nickandbro

08/28/2024 at 11:05AM