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

348 active golfers, 1155 entries

Leaderboard (lowest score wins):
15
#121 - James / @Dronak

08/22/2023 at 08:06PM

15
#122 - Nolen Royalty / @NolenRoyalty

08/23/2023 at 04:27AM

15
#123 - Melker Fläskberg / @Mawkler

08/24/2023 at 11:01AM

15
#124 - Simon Niederberger / @saemeon_

08/24/2023 at 08:20PM

15
#125 - Gabriel Reed / @gabetrotro

08/25/2023 at 06:41AM

15
#126 - kongreif / @kongreifamk

08/25/2023 at 12:06PM

15
#127 - Jamie / @jamiegibneyuk

08/25/2023 at 02:49PM

15
#128 - Tim / @KapJ1coH

08/28/2023 at 09:44PM

15
#129 - Jens Blawatt / @jblawatt

08/30/2023 at 01:36PM

15
#130 - Shwe Aye / @shweaye810

08/30/2023 at 07:16PM

15
#131 - Victor Phan / @Victor_Phan

08/31/2023 at 12:42AM

15
#132 - Pretend it's Beef / @EthanMcQuarrie

08/31/2023 at 05:07AM

15
#133 - Pablo Cárdenas / @pablo_cardenasb

09/01/2023 at 10:39PM

15
#134 - Jakub Parapura / @JakubParapura

09/04/2023 at 09:10AM

15
#135 - Andrew Pritchard / @pilotInPyjamas

09/04/2023 at 11:38AM

15
#136 - noot_noot / @nootnoot_2_doot

09/05/2023 at 05:36AM

15
#137 - Lazarescu Andrei / @lazandrei19

09/15/2023 at 11:23AM

15
#138 - Alex Pepper / @pepper18608

09/15/2023 at 02:51PM

15
#139 - Ernest Gupik / @ernest_gupik

09/20/2023 at 04:12PM

15
#140 - Monkey Boy / @monkey29089

09/21/2023 at 02:12PM

15
#141 - Badya / @badya_io

09/22/2023 at 11:32AM

15
#142 - Mar_Anboksing / @roei99

09/24/2023 at 10:50AM

15
#143 - Aaron Hunt / @ach5910

09/27/2023 at 06:43PM

15
#144 - Lithrein / @Lithrein

10/01/2023 at 12:07AM

15
#145 - 으앙 / @meri2727

10/11/2023 at 11:09AM

15
#146 - Kristian Jagd / @Jagdos

10/18/2023 at 12:54PM

15
#147 - NDavis / @D1727374757

10/18/2023 at 07:26PM

15
#148 - Pavel Savin / @PavelSavine

10/23/2023 at 09:36AM

15
#149 - Maurice Schmicking / @m_schmicking

10/29/2023 at 12:13PM

15
#150 - The Deng Excreted by the Cultural Revolution / @saamnudaam

10/30/2023 at 10:21PM