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

292 active golfers, 1000 entries

Leaderboard (lowest score wins):
15
#151 - Ludovic Schwartz / @ludovicschwartz

11/24/2023 at 01:33PM

15
#152 - mathetesxristou / @mathetesxristou

11/24/2023 at 07:07PM

15
#153 - Sando Itchi / @sando_itchi

11/24/2023 at 08:18PM

15
#154 - 185264646 / @185264646

11/26/2023 at 11:56AM

15
#155 - Lukasz Sroka / @louqash

12/04/2023 at 01:49PM

15
#156 - Frédéric Heulin / @talineo

12/04/2023 at 06:23PM

15
#157 - Remus Dalrymple / @bornintheflames

12/06/2023 at 11:56PM

15
#158 - gvnnn / @gvnnn

12/08/2023 at 09:40AM

15
#159 - jpggpj / @jpggpj

12/10/2023 at 09:30PM

15
#160 - Adrián Fidalgo-Díaz / @adrianFD22

12/15/2023 at 06:13PM

15
#161 - Kushal Nagwanshi / @Kushal-Nagwanshi

12/16/2023 at 03:30PM

15
#162 - masatosis / @masatosis

12/18/2023 at 07:42AM

15
#163 - Joachim Wedin / @joachimwedin

12/18/2023 at 09:50PM

15
#164 - Eric Dobson / @ericdobson

12/20/2023 at 06:50PM

15
#165 - Matt DB / @MattDB12

12/22/2023 at 07:46PM

15
#166 - hatena / @rotwm

12/24/2023 at 06:17PM

15
#167 - Markus Ditlev Olsen / @markusOlsen1

12/28/2023 at 03:45PM

15
#168 - Jasper v. B. / @jazzpi

12/30/2023 at 01:01PM

15
#169 - Matt Zhang / @MattUnderscoreZhang

01/03/2024 at 09:09PM

15
#170 - João Britto / @joaobrittoneto

01/04/2024 at 08:11AM

15
#171 - egitto / @egitto

01/04/2024 at 06:27PM

15
#172 - Yordan Boikov / @yboikov

01/07/2024 at 03:34PM

15
#173 - cykirk / @cykirk

01/15/2024 at 03:43AM

15
#174 - Sami Tabet / @sfluor

01/18/2024 at 01:27PM

15
#175 - anranlee99 / @anranlee99

01/22/2024 at 08:42AM

15
#176 - diwa / @LuoDi-Nate

02/02/2024 at 08:10AM

15
#177 - 221300034gzx / @221300034gzx

02/03/2024 at 02:44PM

15
#178 - Ben Gadbois / @bengadbois

02/04/2024 at 01:07AM

15
#179 - ydbB / @ydbB

02/04/2024 at 04:29PM

15
#180 - omgwei / @omgwei

02/06/2024 at 07:13PM