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):
14
#1 - Jean George / @JeanGeo20504212

07/09/2023 at 10:57PM

14
#2 - Leif Eggenfellner / @iLoveNachos69

07/11/2023 at 01:26PM

14
#3 - basedlucas / @basedIucas

07/12/2023 at 02:11PM

14
#4 - Glen Huang / @hihgl

07/14/2023 at 03:03AM

14
#5 - chriskuck / @chriskuck

07/14/2023 at 01:53PM

14
#6 - KensStake / @kentaROyachyuni

07/14/2023 at 04:39PM

14
#7 - Rishabh Palohia / @RPalohia

07/15/2023 at 05:38PM

14
#8 - jroberts / @jroberts_f

07/17/2023 at 06:11AM

14
#9 - indebutecs / @indebutecs

07/17/2023 at 05:01PM

14
#10 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

07/20/2023 at 02:07AM

14
#11 - masato@RUNTEQ43期 / @number3_mlog

07/21/2023 at 02:36AM

14
#12 - Monetashi / @Monetashi_IO

07/27/2023 at 06:37PM

14
#13 - Dany L'Hebreux / @hebreux34582

08/06/2023 at 06:19PM

14
#14 - r4d1um / @r4d1um

08/10/2023 at 08:16PM

14
#15 - Sepehr / @Sepehration

08/11/2023 at 04:33PM

14
#16 - Ayman / @RecommenderTest

08/17/2023 at 04:31AM

14
#17 - Petro Тrouq / @zulolosi

08/19/2023 at 05:16AM

14
#18 - manfred knapp / @fred_pooshka

08/24/2023 at 02:56PM

14
#19 - vaavaav / @_vaavaav

08/24/2023 at 07:31PM

14
#20 - Arūnas Smaliukas / @ArunasSmaliukas

08/26/2023 at 01:21PM

14
#21 - WOET / @WOET15

08/27/2023 at 01:32AM

14
#22 - 李建宏 / @xx19971016

08/28/2023 at 08:22AM

14
#23 - 徐琨閔 / @qwer20108

08/29/2023 at 08:17AM

14
#24 - Justin Llanos / @llanosj427

09/02/2023 at 07:10PM

14
#25 - Milan Blažek / @Somin13

09/05/2023 at 02:12PM

14
#26 - ilyas / @Ahaaah2071

09/11/2023 at 02:13PM

14
#27 - KingSann / @iferkey

09/12/2023 at 01:33PM

14
#28 - Michael Wiedfellner / @wiedfellne94556

09/13/2023 at 03:52PM

14
#29 - Dyson / @DoctorDalek1963

09/15/2023 at 10:52AM

14
#30 - Volker Schukai / @volker_schukai

09/29/2023 at 09:38PM