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 9v00672c1db90000000005ba

Fix the git merge conflicts

Solve the merge conflicts in the Python file

Start file
<<<<<<< HEAD
def calculate_total(items):
    """Calculate total price of items with 10% discount"""
    total = sum(item['price'] for item in items)
    return total * 0.9  # Apply 10% discount
=======
def calculate_total(items):
    """Calculate total price of items with tax"""
    total = sum(item['price'] for item in items)
    return total * 1.15  # Apply 15% tax
>>>>>>> feature/add-tax

def format_currency(amount):
<<<<<<< HEAD
    """Format amount as USD"""
    return f"${amount:.2f}"
=======
    """Format amount as EUR"""
    return f"€{amount:.2f}"
>>>>>>> feature/currency-update

def process_order(items):
    total = calculate_total(items)
<<<<<<< HEAD
    return {
        'status': 'success',
        'total': format_currency(total),
        'items_count': len(items)
    }
=======
    shipping = 5.99 if total < 50 else 0
    return {
        'status': 'processed',
        'total': format_currency(total + shipping),
        'shipping': shipping
    }
>>>>>>> feature/shipping
End file
def calculate_total(items):
    """Calculate total price of items with tax"""
    total = sum(item['price'] for item in items)
    total = total * 0.9  # Apply 10% discount
    return total * 1.15  # Apply 15% tax

def format_currency(amount):
    """Format amount as EUR"""
    return f"€{amount:.2f}"

def process_order(items):
    total = calculate_total(items)
    shipping = 5.99 if total < 50 else 0
    return {
        'status': 'processed',
        'total': format_currency(total + shipping),
        'items_count': len(items),
        'shipping': shipping
    }

View Diff

1d0
< <<<<<<< HEAD
3,7d1
<     """Calculate total price of items with 10% discount"""
<     total = sum(item['price'] for item in items)
<     return total * 0.9  # Apply 10% discount
< =======
< def calculate_total(items):
9a4
>     total = total * 0.9  # Apply 10% discount
11d5
< >>>>>>> feature/add-tax
14,17d7
< <<<<<<< HEAD
<     """Format amount as USD"""
<     return f"${amount:.2f}"
< =======
20d9
< >>>>>>> feature/currency-update
24,30d12
< <<<<<<< HEAD
<     return {
<         'status': 'success',
<         'total': format_currency(total),
<         'items_count': len(items)
<     }
< =======
34a17
>         'items_count': len(items),
37d19
< >>>>>>> feature/shipping

Solutions by @danilobellini:

Unlock 3 remaining solutions by signing in and submitting your own entry
Created by: @pacuna

19 active golfers, 66 entries

Solutions by @danilobellini:
36
#1 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

11/11/2024 at 06:24PM

37
#>3 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

11/09/2024 at 11:52PM

40
#>4 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

11/09/2024 at 11:33PM