feat: func_converter 일부 항목 이식
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import bs from 'binary-search';
|
||||
|
||||
const connectMap: [number, string][] = [
|
||||
[50, '안함'],
|
||||
[100, '무관심'],
|
||||
[400, '보통'],
|
||||
[200, '가끔'],
|
||||
[800, '자주'],
|
||||
[1600, '열심'],
|
||||
[3200, '중독'],
|
||||
[6400, '폐인'],
|
||||
[12800, '경고'],
|
||||
]
|
||||
|
||||
export function formatConnectScore(connect: number) {
|
||||
const idx = bs(connectMap, connect, ([key], needle) => key - needle);
|
||||
if(idx >= 0){
|
||||
return connectMap[idx][1]??'?';
|
||||
}
|
||||
return connectMap[-(idx + 1)][1]??'?';
|
||||
}
|
||||
Reference in New Issue
Block a user