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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 415 remaining solutions by signing in and submitting your own entry
#416 Sparrow He / @SparrowHe - Score: 240 - 08/07/23 @ 01:14
<Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down><Down>V<Left><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>ya<Down><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><CR>p<BS><Esc>p<BS><BS><Down><BS><Down>a<BS><Down><Left>0<Right>p<BS><Esc><Right><Right>ppppppa<Right><Up><Up><Up><Up><Up><Up><Down><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>00<Down><Left>000<Down><Left>0000<Down><Left>00000<Up><Down><Down><Left>000000<Down><Left>0000000<Right><Esc><Right>ppa<Up><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Left>00000000<Down><Left><Left><Right>000000000<Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><Esc>:wq<CR>

0 comments


Created by: @zmf_tim

416 active golfers, 1403 entries

Leaderboard (lowest score wins):
36
#361 - Dirli / @Dirli_V

08/18/2023 at 08:29AM

36
#362 - Mikołaj / @miko_aj4846

09/03/2023 at 03:04PM

36
#363 - GE / @GE5943034860462

09/25/2023 at 05:05PM

36
#364 - satake0916 / @satake0916

12/19/2023 at 03:50AM

36
#365 - lejeunel / @lejeunel

04/03/2024 at 12:49PM

37
#366 - dian wu / @Wudian9Wu

07/28/2023 at 04:35AM

38
#367 - erlend / @erlendogerling

07/11/2023 at 12:12PM

38
#368 - techtechtech / @techtechtech12

08/26/2023 at 12:52AM

38
#369 - Clay26 / @Clay26

04/06/2024 at 07:11PM

39
#370 - V / @account_test_k

07/12/2023 at 07:08AM

39
#371 - Jq / @corsac_ua

04/05/2024 at 11:31PM

40
#372 - Sophie Xu / @loveFluffy

12/10/2023 at 10:16PM

40
#373 - Zachary Peterson / @zpeterson16

01/15/2024 at 03:00PM

40
#374 - Radim Mifka / @mifka01

08/05/2024 at 10:15AM

42
#375 - ATW / @viveremedices

09/11/2023 at 08:30PM

42
#376 - The Venereal Bede / @TheVenerealBede

03/20/2024 at 09:16PM

47
#377 - Jeffrey Chen / @Jeff_Chenster

09/09/2023 at 08:05PM

47
#378 - jferina / @jferina

03/29/2024 at 01:21AM

48
#379 - Teh Shin Yin / @teh_yin

08/28/2023 at 05:52AM

48
#380 - dennis / @nagolove

05/03/2024 at 11:44AM

49
#381 - Grow Together / @growtechies

08/11/2023 at 01:32AM

50
#382 - Luis Fernando Rodríguez Vargas / @LuisFerRodVar

06/25/2024 at 09:00PM

52
#383 - Keveno123 / @Keveno123

07/31/2023 at 10:22PM

52
#384 - Volodymyr Brazhnyk / @vovacha

08/15/2024 at 03:24AM

54
#385 - 황현 / @ghkdgus29

09/02/2023 at 04:40AM

58
#386 - Koki / @auk1709

09/15/2024 at 02:04AM

59
#387 - michan@RUNTEQ43期生 / @yuta43RUNTEQ

07/22/2023 at 11:56AM

60
#388 - Rodney Visser / @_Radnus

04/02/2024 at 03:48AM

62
#389 - wuwubean / @wuwubean

04/18/2024 at 06:48PM

64
#390 - James Reeder / @TheRealBreemer

08/20/2023 at 03:42PM