Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuanyu90221/fortune-lib
https://github.com/yuanyu90221/fortune-lib
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/yuanyu90221/fortune-lib
- Owner: yuanyu90221
- Created: 2019-10-07T09:41:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-19T17:33:21.000Z (7 months ago)
- Last Synced: 2024-06-20T06:04:05.659Z (7 months ago)
- Language: JavaScript
- Size: 15.4 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fortune-lib
## 套件介紹
+ 一個用typescript 撰寫的 排掛 library
## 安裝環境
`npm i`
## 執行測試
`npm run test ${執行名稱}`
## 重新編譯
`npm run rebuild`
## 使用方式
```code
import {getFortuneResult, FaceSymbol, CoinSet} from 'fortune-lib/lib';
import * as moment from 'moment';
let coSet6 = new CoinSet([FaceSymbol.FaceUp, FaceSymbol.FaceDown, FaceSymbol.FaceDown]);
let coSet5 = new CoinSet([FaceSymbol.FaceDown, FaceSymbol.FaceUp, FaceSymbol.FaceUp]);
let coSet4 = new CoinSet([FaceSymbol.FaceUp, FaceSymbol.FaceUp, FaceSymbol.FaceDown]);
let upbsSet = [coSet6, coSet5, coSet4];
let coSet3 = new CoinSet([FaceSymbol.FaceUp, FaceSymbol.FaceDown, FaceSymbol.FaceDown]);
let coSet2 = new CoinSet([FaceSymbol.FaceUp, FaceSymbol.FaceUp, FaceSymbol.FaceUp]);
let coSet1 = new CoinSet([FaceSymbol.FaceUp, FaceSymbol.FaceUp, FaceSymbol.FaceDown]);
let bsSet = [coSet3, coSet2, coSet1];let result: object = getFortuneResult([upbsSet, bsSet], moment().unix()*1000);
console.log(JSON.stringify(result));```