Skip to content

Instantly share code, notes, and snippets.

@rbtnn
Last active October 15, 2016 12:35
Show Gist options
  • Save rbtnn/3de8c4d3170c4f3f5c97040b79c1652a to your computer and use it in GitHub Desktop.
Save rbtnn/3de8c4d3170c4f3f5c97040b79c1652a to your computer and use it in GitHub Desktop.
function! s:main() abort
let s = '中華料理画像うpよろしく'
let cs = split(s, '\zs')
let i = 0
while i < len(cs)
if i == 0
echomsg s
elseif i == len(cs) - 1
echomsg join(reverse(cs), '')
else
echomsg cs[i] . repeat('@', len(cs) - 2) . cs[-i - 1]
endif
let i = i + 1
endwhile
endfunction
call s:main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment