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):
15
#91 - Khoa A. Nguyen / @dakennguyen

07/09/2023 at 12:04AM

15
#92 - Christian / @vimEagle

07/09/2023 at 08:37AM

15
#93 - Gs Abl / @gs_abl

07/09/2023 at 01:46PM

15
#94 - Nobody / @Nobody58608634

07/10/2023 at 05:50AM

15
#95 - Aaffo / @aaffo2

07/10/2023 at 11:54AM

15
#96 - Μάρκος Στεφανίδης / @MrkosSteph58877

07/10/2023 at 08:12PM

15
#97 - Andreas Faschang-Gschwendt / @AGschwendt81317

07/11/2023 at 01:37PM

15
#98 - Abdelrahman Madkour / @A3Madkour

07/11/2023 at 07:06PM

15
#99 - わーお / @lwgZVRoOQ8Nf6VG

07/12/2023 at 04:33PM

15
#100 - Tyler Carson / @tylerccarson

07/12/2023 at 11:56PM

15
#101 - someone / @IKvacenok

07/14/2023 at 11:27AM

15
#102 - "Smylers" / @Smylers2

07/15/2023 at 06:19AM

15
#103 - kn95 / @phyque_zz

07/15/2023 at 08:29AM

15
#104 - Kha Nguyen / @__ngtrongkha

07/16/2023 at 02:48PM

15
#105 - Afonso Sousa / @afonsobts

07/17/2023 at 12:53PM

15
#106 - Anonymous English Learner / @HoffmanDevs

07/18/2023 at 10:26AM

15
#107 - Alex / @AlexanderHeatl2

07/18/2023 at 05:50PM

15
#108 - Anshul Kamath / @anshul_kamath

07/20/2023 at 04:08PM

15
#109 - DocsSorted / @DocsSorted

07/21/2023 at 10:18PM

15
#110 - phastasmn / @phastasmn

07/22/2023 at 09:35AM

15
#111 - jinx balotchnik / @balotchnik

07/22/2023 at 06:01PM

15
#112 - PoltyPoltou / @PoltyP

07/22/2023 at 07:18PM

15
#113 - 선무 김 / @smKim9348279

07/23/2023 at 08:32AM

15
#114 - clark / @clark05358812

07/25/2023 at 01:39AM

15
#115 - Godek Dominik / @dominik27182818

07/25/2023 at 08:00PM

15
#116 - A. L. / @lnchk

07/26/2023 at 05:44PM

15
#117 - sap / @sap38838304

07/28/2023 at 05:27AM

15
#118 - Initness / @Initness1

07/29/2023 at 07:23AM

15
#119 - naka / @nak38223985244

07/30/2023 at 02:15AM

15
#120 - Casey O'Donnell / @CaseyOD15519082

08/04/2023 at 03:05PM