Skip to content

Instantly share code, notes, and snippets.

@lv7777
Last active November 5, 2016 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lv7777/88a0bee98da74c71fbf8332642530e0c to your computer and use it in GitHub Desktop.
Save lv7777/88a0bee98da74c71fbf8332642530e0c to your computer and use it in GitHub Desktop.
ppapを出力するネタスクリプト。https://gist.github.com/je6bmq/f010704a03176aaed8cfad126758e73d リスペクト。一日遅れたけどVIM君10周年おめでとう!
function! HappyBirthdayVIM(ppap)
if(has('reltime'))
"echon "reltimeありますねえ!"
else
throw "まずいですよ!"
return 114514
endif
"echo "a:ppap"
"echo a:ppap
if a:ppap == "PPAP"
echo "ペン↑パイナッポー↑アッポーペン↓"
return 0
elseif a:ppap == "PPP"
echo "ポイント↑ツーポイント↑プロトコル↓"
endif
let l:match_end=matchend(reltimestr(reltime()),'\d\+\.') + 1
let l:rand=reltimestr(reltime())[l:match_end : ] % (2+1)
if rand
echon "P"
" 4文字以上なら最後尾から数えて3文字を次の再帰に渡す
if strlen(a:ppap) >= 4
let localPPAP = a:ppap[-3:]
call HappyBirthdayVIM(l:localPPAP . "P")
else
call HappyBirthdayVIM(a:ppap . "P")
endif
else
echon "A"
if strlen(a:ppap) >= 4
let l:localPPTP = a:ppap[-3:]
call HappyBirthdayVIM(l:localPPTP . "A")
else
call HappyBirthdayVIM(a:ppap . "A")
endif
endif
endif
endfunction
command! HBVIM call HappyBirthdayVIM("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment