Golf Day 1

Here’s a thread for Kakoune Golf challenges. There is a repo here: https://github.com/mawww/golf.git

To start us off:
Swap values inside brackets
https://www.vimgolf.com/challenges/5b6f0fcba89379000c2328a

Start File:

#Everyday routine... :\ 

amazing_func("Some amazing text", 123, variable) # Kittens

def func():
	return 'Stuff for making movement harder'

def func2(m):
	v = 0
	for i in range(10):
		v += i*m
		print(v, i, m)

very_strange_func(42, foobar, 'Another text') # Dogs

test = func()
func2(len(test))

End File:

#Everyday routine... :\ 

amazing_func(42, foobar, 'Another text') # Kittens

def func():
	return 'Stuff for making movement harder'

def func2(m):
	v = 0
	for i in range(10):
		v += i*m
		print(v, i, m)

very_strange_func("Some amazing text", 123, variable) # Dogs

test = func()
func2(len(test))

(I’ve got 9.)

I’ve got %s_<ret>m<a-(>,q, how do you count the keys? Is S two keys, and <a-S> three?

Wow, @occivink – great way to attack that problem. I wouldn’t have considered it that way.

The way things are counted in mawww’s repo, S is one and <a-S> is one, so that counts as 8. Nice!

Mine was fK;C<a-h>m<a-)>,q.

My repo counts keys the same way vimgolf does (so modifiers are not counted), which to be honest plays a bit in Kakoune’s favor :smiley:

Just press <alt-shift-control-super-meta-hyper-j> – one keystroke!

1 Like