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

355 active golfers, 1169 entries

Leaderboard (lowest score wins):
15
#211 - Andy / @andyfoster

04/16/2024 at 11:20AM

15
#212 - Jelani Felix / @Jelanife

04/21/2024 at 05:54PM

15
#213 - bonettimrc / @bonettimrc

04/24/2024 at 05:06PM

15
#214 - constap / @constap

04/25/2024 at 04:07AM

15
#215 - Lennart / @lennartack

04/27/2024 at 12:07PM

15
#216 - x03n046 / @x03n046

05/02/2024 at 06:41AM

15
#217 - detachment1008 / @detachment1008

05/06/2024 at 12:23AM

15
#218 - Irakli Chigvaria / @tchigvaria

05/11/2024 at 11:03AM

15
#219 - kbrashem / @kbrashem

05/17/2024 at 10:25PM

15
#220 - Thermospore / @Thermospore

05/21/2024 at 06:40AM

15
#221 - nerfed / @nerfed

06/04/2024 at 01:34PM

15
#222 - ahenches / @ahenches

06/05/2024 at 10:29AM

16
#223 - vimgolf_trumpetrespas / @trumpetres63786

07/06/2023 at 04:44PM

16
#224 - Ганц / @mishagantz

07/08/2023 at 03:56AM

16
#225 - あべべ / @abebe123000

07/08/2023 at 05:40AM

16
#226 - b1gz / @_b1gz

07/09/2023 at 01:39AM

16
#227 - Lukas Pichlmann / @PichlmannLukas

08/01/2023 at 06:25PM

16
#228 - ohwell / @KiranClose

08/03/2023 at 05:21PM

16
#229 - weekendgolfer / @weekendgola

08/17/2023 at 07:40AM

16
#230 - xiang / @xiang56002997

08/27/2023 at 10:45PM

16
#231 - John Xu / @xzzhiao

09/01/2023 at 06:15AM

16
#232 - xiaoao1024 / @xiaoao1024

12/20/2023 at 02:19AM

16
#233 - Aiden Yang / @yangxnn

12/20/2023 at 11:43AM

16
#234 - MikkelDitlevOlsen1 / @MikkelDitlevOlsen1

12/28/2023 at 03:43PM

16
#235 - Stephen / @szhanggg

01/07/2024 at 07:16PM

16
#236 - Adrien Pasquereau / @AdrienPasquereau

03/03/2024 at 09:34PM

16
#237 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

03/08/2024 at 12:44PM

16
#238 - Elvis Byounghoon Lee / @lbspresley

04/18/2024 at 02:42AM

17
#239 - Mat / @matpbo

07/07/2023 at 08:26PM

17
#240 - Brandon / @Brandon10678836

07/17/2023 at 07:42PM