Fix the shell script!
Fix the shell script with the fewest keystrokes!
Start file
#!/bin/bash a = 5 b = 10 sum = $a + $b echo $sum mul = $a * $b echo $mul
End file
#!/bin/bash a=5 b=10 sum=$((a + b)) echo $sum mul=$((a * b)) echo $mul
View Diff
2,4c2,4 < a = 5 < b = 10 < sum = $a + $b --- > a=5 > b=10 > sum=$((a + b)) 7c7 < mul = $a * $b --- > mul=$((a * b))
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 588 remaining solutions by signing in and submitting your own entry
#589 陈石峰 / @lazycode1226 - Score: 246 - 10/10/22 @ 06:45
jjkkjjkkjo<Esc>dujkkjuujjkjjjjk:s<BS>ss<BS><BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>%s/s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>=<BS> = =<BS>/s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>=/g<CR>:4,7s<BS>s<BS>s<BS>s/s<BS>s<BS>s<BS>s<BS>s<BS>s<BS>$a/s<BS>s<BS>((<BS><BS>\<BS>((/g<BS><BS>a/g<CR>:<Up><Left><Left><Left><Left><Left><Left><BS>b<Right><Right><Right><Right><Right><Right><Left><Left><Left><BS><BS><Right><BS>b))<CR>:.<BS>s<BS>s<BS><Up><Left><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>s<BS>s<BS>s/((<BS>/<BS>/<BS><BS>/<BS>(<Left>\<Right>/<BS><BS><BS>(/<BS>(/$((/g<CR>qq<Esc><0xef><0xbc><0x9a><0xef><0xbc><0x9a><Esc>sk<Esc>ukjZZ
0 comments