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

409 active golfers, 1392 entries

Leaderboard (lowest score wins):
14
#31 - Felipe J. O. Ribeiro / @FelipeJORibeir1

10/15/2023 at 11:34PM

14
#32 - scpchicken / @scpchick

10/18/2023 at 06:44AM

14
#33 - Luoyb / @Luoyb

10/18/2023 at 08:08AM

14
#34 - Marco Meinardi / @Kee__no

10/19/2023 at 09:15AM

14
#35 - 7733865@qq.com / @tjxwg

10/19/2023 at 12:20PM

14
#36 - tien / @tien40766111

10/19/2023 at 02:26PM

14
#37 - proz / @programmerz26

10/19/2023 at 04:24PM

14
#38 - Stefan Krist / @nerdyness_sk

10/24/2023 at 09:26PM

14
#39 - Sergej Karavajnij / @basyanya_sk

11/01/2023 at 07:29PM

14
#40 - snkkid / @snkkid

11/06/2023 at 02:14PM

14
#41 - Henrique Malheiro / @rike09

11/09/2023 at 03:43PM

14
#42 - FilipRazek / @FilipRazek

11/11/2023 at 09:09AM

14
#43 - Blake Wingard / @Bats6789

11/16/2023 at 03:13PM

14
#44 - x𝕏θ₯Ώεœ’寺やきしゃも𝕏x / @y_saionji_tech

11/20/2023 at 06:27AM

14
#45 - Newdriver / @Newdriver10

11/21/2023 at 01:58AM

14
#46 - MonkieeBoi / @MonkieeBoi

11/22/2023 at 05:37AM

14
#47 - bpking1 / @bpking1

11/24/2023 at 12:31PM

14
#48 - ζ‚Ÿε² / @A1OBJTxN5fTg5EJ

11/28/2023 at 03:43PM

14
#49 - levioneyh / @levioneyh

12/12/2023 at 11:22PM

14
#50 - Qing Liu / @poeminlash

12/14/2023 at 04:10AM

14
#51 - Laughing Cavalier / @jovial_cavalier

12/21/2023 at 05:32PM

14
#52 - jeffreymrussell / @jeffreymrussell

01/05/2024 at 02:31PM

14
#53 - paranoid-bunny / @paranoid-bunny

01/08/2024 at 11:07AM

14
#54 - epsilonshnepsilon / @epsilonshnepsilon

01/15/2024 at 06:27PM

14
#55 - nat / @hellotostars

01/22/2024 at 08:42AM

14
#56 - shikitanrei / @shikitanrei

01/27/2024 at 11:30PM

14
#57 - Caesar 🏴󠁧󠁒󠁷󠁬󠁳󠁿 / @NotRexButCaesar

01/28/2024 at 10:40PM

14
#58 - Alex Curtis / @alexandercurtis

01/31/2024 at 10:16PM

14
#59 - RiskyDissonance / @riskydissonance

02/22/2024 at 07:26PM

14
#60 - Seungho Lee / @llistnr

03/20/2024 at 04:42AM