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

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

351 active golfers, 1160 entries

Solutions by @qwer20108:
14
#23 - 徐琨閔 / @qwer20108

08/29/2023 at 08:17AM

15
#>128 - 徐琨閔 / @qwer20108

08/29/2023 at 08:16AM

16
#>227 - 徐琨閔 / @qwer20108

08/29/2023 at 08:16AM

17
#>239 - 徐琨閔 / @qwer20108

08/29/2023 at 08:15AM

21
#>272 - 徐琨閔 / @qwer20108

08/29/2023 at 08:13AM

23
#>279 - 徐琨閔 / @qwer20108

08/29/2023 at 08:13AM

27
#>286 - 徐琨閔 / @qwer20108

08/29/2023 at 08:08AM

28
#>288 - 徐琨閔 / @qwer20108

08/29/2023 at 08:10AM

31
#>293 - 徐琨閔 / @qwer20108

08/29/2023 at 08:07AM

32
#>297 - 徐琨閔 / @qwer20108

08/29/2023 at 08:06AM

34
#>300 - 徐琨閔 / @qwer20108

08/29/2023 at 08:05AM

34
#>300 - 徐琨閔 / @qwer20108

08/29/2023 at 08:06AM

36
#>302 - 徐琨閔 / @qwer20108

08/29/2023 at 08:00AM

50
#>321 - 徐琨閔 / @qwer20108

08/29/2023 at 07:56AM

69
#>330 - 徐琨閔 / @qwer20108

08/29/2023 at 07:47AM

73
#>333 - 徐琨閔 / @qwer20108

08/29/2023 at 07:55AM

76
#>336 - 徐琨閔 / @qwer20108

08/29/2023 at 07:27AM

370
#>351 - 徐琨閔 / @qwer20108

08/29/2023 at 07:41AM