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 9v0064a68333000000000254

Find fix point of cos

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

Start file
from math import cos


def find_cos_fix_point(j):
    a = 12.216
    for i in range(j):
        a = cos(a)

    print(a)


find_cos_fix_point(1)
End file
from math import cos


def find_cos_fix_point(j):
    a = 12.216
    for i in range(j):
        a = cos(a)

    print(a)


find_cos_fix_point(1)
find_cos_fix_point(10)
find_cos_fix_point(100)
find_cos_fix_point(1000)
find_cos_fix_point(10000)
find_cos_fix_point(100000)
find_cos_fix_point(1000000)
find_cos_fix_point(10000000)
find_cos_fix_point(100000000)

View Diff

12a13,20
> find_cos_fix_point(10)
> find_cos_fix_point(100)
> find_cos_fix_point(1000)
> find_cos_fix_point(10000)
> find_cos_fix_point(100000)
> find_cos_fix_point(1000000)
> find_cos_fix_point(10000000)
> find_cos_fix_point(100000000)

Solutions by @iLoveNachos69:

Unlock 8 remaining solutions by signing in and submitting your own entry
Created by: @zmf_tim

365 active golfers, 1204 entries

Solutions by @iLoveNachos69:
14
#2 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 01:26PM

15
#>89 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 01:22PM

16
#>232 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 01:19PM

17
#>245 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 01:16PM

18
#>261 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 01:14PM

19
#>270 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 12:35PM

21
#>281 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 12:32PM

107
#>356 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 12:22PM