Merge pull request #1 from tessi/add_top_score

add top score
This commit is contained in:
mattn 2014-07-23 17:40:57 +09:00
commit 33d5f71664

View File

@ -9,6 +9,8 @@ let s:STATE_FINISH = 3
let s:t_ve = &t_ve let s:t_ve = &t_ve
let s:top_score = 0
let s:seed = 0 let s:seed = 0
function! s:srand(seed) abort function! s:srand(seed) abort
let s:seed = a:seed let s:seed = a:seed
@ -87,7 +89,8 @@ function! s:loop()
call s:srand(localtime()) call s:srand(localtime())
call setline(sh + 2, printf(" SCORE: %6d", 0)) call setline(sh + 2, printf(" SCORE: %10d", 0))
call setline(sh + 3, printf(" TOP SCORE: %6d", s:top_score))
let pause = 0 let pause = 0
let retry = 0 let retry = 0
@ -137,7 +140,11 @@ function! s:loop()
if getline(sh)[jx-2: jx-1] == '* ' if getline(sh)[jx-2: jx-1] == '* '
let sc += 1 let sc += 1
call setline(sh + 2, printf(" SCORE: %6d", sc)) call setline(sh + 2, printf(" SCORE: %10d", sc))
if sc > s:top_score
let s:top_score = sc
call setline(sh + 3, printf(" TOP SCORE: %6d", s:top_score))
endif
endif endif
endif endif