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 336 remaining solutions by signing in and submitting your own entry
#337 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

337 active golfers, 1125 entries

Leaderboard (lowest score wins):
40
#301 - Zachary Peterson / @zpeterson16

01/15/2024 at 03:00PM

42
#302 - ATW / @viveremedices

09/11/2023 at 08:30PM

42
#303 - The Venereal Bede / @TheVenerealBede

03/20/2024 at 09:16PM

47
#304 - Jeffrey Chen / @Jeff_Chenster

09/09/2023 at 08:05PM

47
#305 - jferina / @jferina

03/29/2024 at 01:21AM

48
#306 - Teh Shin Yin / @teh_yin

08/28/2023 at 05:52AM

49
#307 - Grow Together / @growtechies

08/11/2023 at 01:32AM

52
#308 - Keveno123 / @Keveno123

07/31/2023 at 10:22PM

54
#309 - 황현 / @ghkdgus29

09/02/2023 at 04:40AM

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

07/22/2023 at 11:56AM

60
#311 - Rodney Visser / @_Radnus

04/02/2024 at 03:48AM

62
#312 - wuwubean / @wuwubean

04/18/2024 at 06:48PM

64
#313 - James Reeder / @TheRealBreemer

08/20/2023 at 03:42PM

66
#314 - jack2023xxx / @jack2023xxx

08/21/2023 at 07:00AM

66
#315 - Swapnil Sharma / @mradul_swapnil

09/02/2023 at 10:47PM

69
#316 - Monty / @grdmnt

07/28/2023 at 02:55AM

70
#317 - tch1001 / @tch1001

07/18/2023 at 05:30PM

71
#318 - Jake Shomer / @jake_shomer

03/11/2024 at 03:23PM

73
#319 - Jake Shomer / @ShomerJake

08/07/2023 at 06:54PM

73
#320 - Pancho Cordero / @panchocorderos

11/30/2023 at 06:29PM

74
#321 - Kerry Wang / @kerrywang369

07/21/2023 at 08:58PM

75
#322 - Glen Curtis / @GlenCurtis2023

07/21/2023 at 12:38PM

78
#323 - Zhe Li / @ZheLi99

07/23/2023 at 12:20PM

82
#324 - ibrahim koz / @Ibrahmkoz

08/09/2023 at 04:38PM

83
#325 - Matt Shen / @mattshen

01/22/2024 at 08:39AM

85
#326 - PER / @ChenHua91464801

08/28/2023 at 04:07PM

86
#327 - LatteCafeGirl / @moithena

07/18/2023 at 08:20AM

101
#328 - aaalllthrowaway2 / @aaalllthro59419

08/24/2023 at 02:36PM

109
#329 - REEEhor / @reeehorwastaken

08/12/2023 at 12:30PM

114
#330 - Stephen Westhead / @CraziCrow

08/20/2023 at 03:35PM