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

331 active golfers, 1113 entries

Leaderboard (lowest score wins):
18
#241 - Андрей Куренков (Arey) / @Arey_65536

09/19/2023 at 01:55PM

18
#242 - Rafael G. de Paulo / @rafael-g-depaulo

11/09/2023 at 11:45PM

18
#243 - jyrikimari / @jyrikimari

11/17/2023 at 10:59AM

18
#244 - Kristóf Cserpes / @KriCse

02/25/2024 at 02:21PM

18
#245 - iNaKoll / @iNaKoll

02/27/2024 at 05:10PM

19
#246 - しそじろう / @shisoziro

08/06/2023 at 01:57PM

19
#247 - Михаил Зайцев / @mishazayts

09/07/2023 at 08:36AM

19
#248 - 정채훈 / @mrchjung

10/02/2023 at 02:43PM

19
#249 - Hugo O Rivera / @roguh

12/29/2023 at 05:39AM

19
#250 - bstadlbauer / @bstadlbauer

01/08/2024 at 04:43PM

20
#251 - 𝐸𝓃𝓌𝒽𝓎 𝒟𝒹 / @enwhydd

07/31/2023 at 01:59AM

20
#252 - John Khoo / @jtacktf

08/04/2023 at 10:11AM

20
#253 - 성기정 / @qijeong

08/24/2023 at 09:16AM

20
#254 - Alex / @ravsii

04/07/2024 at 08:17PM

20
#255 - gpfl0712 / @gpfl0712

04/14/2024 at 12:35PM

21
#256 - ace / @PercyLixc

07/29/2023 at 03:25PM

21
#257 - LandR / @ListenAndR

10/12/2023 at 04:23AM

22
#258 - zmf_tim / @zmf_tim

07/06/2023 at 09:06AM

22
#259 - 咸糖🎯 / @GIA917229015

07/07/2023 at 05:49PM

22
#260 - みずの/RUNTEQ43期 / @nozumi_program

07/22/2023 at 01:27PM

22
#261 - Heiss / @Heisstea

08/19/2023 at 04:21PM

22
#262 - ubaldot / @ubaldot

03/28/2024 at 09:03AM

23
#263 - ᕦ( ͡° ͜ʖ ͡°)ᕤ / @eduardoarandah

08/10/2023 at 07:21PM

23
#264 - josh-pius / @josh-pius

12/17/2023 at 02:53PM

23
#265 - Mikhail Chugunkov / @poslegm

03/03/2024 at 08:12PM

24
#266 - jonas-grobe / @jonas-grobe

02/02/2024 at 10:07AM

25
#267 - Arne / @arnkaes

07/08/2023 at 12:10AM

26
#268 - مرجان / @IEnfantTerribIe

08/03/2023 at 08:10AM

27
#269 - 捣蛋鬼 / @NeikeShi

07/19/2023 at 05:37PM

27
#270 - Ross Sederburg / @RossSederb75470

08/14/2023 at 05:31PM