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

418 active golfers, 1408 entries

Leaderboard (lowest score wins):
16
#271 - MikkelDitlevOlsen1 / @MikkelDitlevOlsen1

12/28/2023 at 03:43PM

16
#272 - Stephen / @szhanggg

01/07/2024 at 07:16PM

16
#273 - Adrien Pasquereau / @AdrienPasquereau

03/03/2024 at 09:34PM

16
#274 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

03/08/2024 at 12:44PM

16
#275 - Elvis Byounghoon Lee / @lbspresley

04/18/2024 at 02:42AM

16
#276 - Jin Hao / @hongjinhao

07/31/2024 at 08:18AM

16
#277 - Emil Miler / @realcharmer

08/05/2024 at 10:48AM

16
#278 - Jan Scholz / @radikalliberal

10/17/2024 at 08:54PM

16
#279 - Benjamin Lerner / @bensenberner

10/23/2024 at 01:47AM

16
#280 - demouo / @demouo

10/23/2024 at 05:10AM

16
#281 - 3enji / @3enji

10/30/2024 at 12:48PM

16
#282 - Swaraj Dash / @swarajdash

12/25/2024 at 03:59PM

16
#283 - Geon Woo Lee / @mystlee

03/30/2025 at 04:08PM

17
#284 - Mat / @matpbo

07/07/2023 at 08:26PM

17
#285 - Brandon / @Brandon10678836

07/17/2023 at 07:42PM

17
#286 - Hemram / @8Hemram

07/30/2023 at 09:28AM

17
#287 - Tom / @iRNobody1

08/15/2023 at 10:37AM

17
#288 - かぼす / @umesawanokabosu

10/06/2023 at 10:54AM

17
#289 - Seok Hwan Kim / @gworldkim

10/16/2023 at 06:30AM

17
#290 - Vincent Giroux / @20100g

11/12/2023 at 04:44PM

17
#291 - bastien batardier / @supercamarche

11/14/2023 at 08:21PM

17
#292 - armandfavrot / @armandfavrot

11/14/2023 at 08:27PM

17
#293 - SangYeop, Ha / @ssayebee

11/16/2023 at 09:07AM

17
#294 - Ricardau / @Ricardaux

12/01/2023 at 04:15PM

17
#295 - Daniel Niemczyk / @Adentalis

12/10/2023 at 11:53AM

17
#296 - Pavel Víšek / @PavelVek312907

01/10/2024 at 02:06PM

17
#297 - Euro20179 / @Euro20179

01/17/2024 at 05:27PM

17
#298 - Fellow-fiend / @Fellow-fiend

05/20/2024 at 01:06AM

17
#299 - Diwakar Singh Parmar / @parmardiwakar150

08/26/2024 at 06:39PM

17
#300 - TomoProg / @TomoProg

12/12/2024 at 02:46AM