Last active
December 18, 2015 03:49
-
-
Save othree/5720967 to your computer and use it in GitHub Desktop.
cos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun! Coscup() | |
let w = winwidth(0) - 5 | |
let h = winheight(0) - 1 | |
let rowstr = repeat(' ', w/2) . '|' . repeat(' ', w/2) | |
let rowstr0 = repeat('-', w/2) . '+' . repeat('-', w/2) | |
exe "normal ggdG" | |
exe "normal i" . rowstr | |
for i in range(1, h) | |
let i = i + 1 | |
exe "normal o" | |
if i == h/2 | |
exe "normal i" . rowstr0 | |
else | |
exe "normal i" . rowstr | |
endif | |
endfor | |
for x in range(1, w) | |
let x1 = x * 12.0 / w - 6.0 | |
let y1 = cos(x1) | |
let y = y1 / 3.0 * h | |
let y = h/2 - float2nr(round(y)) | |
cal setpos('.', [0, y, x, 0]) | |
exe "normal rx" | |
let x = x + 1 | |
endfor | |
endf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment