jiangyi-boolean
v1.0.5
Published
Type of Random Boolean.
Downloads
4
Readme
jiangyi-boolean
(Chinese: 姜懿布尔型)
Type of Random Boolean.
Introduction
JyBoolean has two status: JyTrue(Chinese: 姜懿真) and JyFalse(Chinese: 姜懿假). These two status will collapse into one by random on calling the Getter bool
Get Started
install jiangyi-boolean by npm.
npm install jiangyi-boolean --save
and use it.
import {JyBoolean} from 'jiangyi-boolean';
var a:JyBoolean = new JyBoolean(2,5);
for(let i = 0;i < 5 ;++i){
console.log(a.bool);
}
one of expected outputs:
true
true
false
true
false
Usage
constructor
of JyBoolean
constructor(a:number = 1,b:number =1,enableAprilFools:boolean = false)
a
andb
: Proportion of probablity to be JyTrue or JyFalse. Default is1:1
.enableAprilFools
: Enable features for April Fool's day.
bool
of JyBoolean
bool:boolean
Get the collapsed status of JyBoolean.
obviouslyIs
of JyBoolean
obviouslyIs(isTrue:boolean|null) => void
Declare what status the JyBoolean
is obviously is.
Something interesting will happen if April Fool's Day feature is enabled.
Copyright
(c) Hyperbola Studio. An open source project under WTFPL license.