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

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

404 active golfers, 1382 entries

Solutions by @clark05358812:
15
#113 - clark / @clark05358812

07/25/2023 at 01:39AM

16
#>258 - clark / @clark05358812

07/25/2023 at 01:38AM

22
#>319 - clark / @clark05358812

07/25/2023 at 01:35AM

25
#>326 - clark / @clark05358812

07/25/2023 at 01:33AM

36
#>347 - clark / @clark05358812

07/25/2023 at 01:23AM

40
#>359 - clark / @clark05358812

07/25/2023 at 01:13AM

59
#>375 - clark / @clark05358812

07/25/2023 at 01:08AM

61
#>376 - clark / @clark05358812

07/25/2023 at 01:04AM

65
#>378 - clark / @clark05358812

07/25/2023 at 01:01AM

89
#>393 - clark / @clark05358812

07/25/2023 at 12:54AM