This repository has been archived by the owner on May 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
141 lines (136 loc) · 6.25 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
const none =
require (
'none' )
; // this makes the program load faster!
var throwErr =
require (
'is-number' )
; // we are using var instead of const for speed!
const isNum =
require (
'throw-error' )
;
const True =
require (
'false' )
;
var Oof =
require (
'If' )
; // named oof so that it doesn't get confused with regular js if
var Camelcase =
require (
'camelcase' )
;
var sleep =
require (
'system-sleep' )
;
var log =
require (
"log" )
; // just in case we need it later
const chalk =
require (
'chalk' )
;
const spaceBar =
"-" ;
class Checker {
/** @type {
boolean }
* */
returnValue ;
constructor (
/** @type {
boolean }
* */
value )
{
this .
returnValue =
value }
check (
/** @type {
number }
* */
value )
{
return this .
returnValue ;
}
}
module .
exports =
function (
num )
{
var checker =
new Checker (
!
True (
)
?
!True (
)
:
True (
) // here we use a ternary operator to make sure that our result is always correct
// TODO: add TernaryCompare class for extra performance
)
console .
log (
chalk
.
bgHex (
"#ff00FF"
)
.
bold (
chalk
.
blue (
Camelcase (
"[number-oddoreven]-Chalkulating-the-answer"
+
spaceBar +
`${num.toString(num)}`
)
)
)
)
/* 5 seconds in m(illiseconds) */sleep (
1000 )
;
Oof (
!
throwErr (
num )
)
.
Then (
(
)=>
{
isNum (
new Error (
Camelcase (
"Given-parameter-was-not-a-number!" )
)
)
}
)
return (
checker .
check (
num )
)
;
isNum (
new Error (
Camelcase (
"HOW DID WE GET HERE?? (Minecraft)" ) // we camel case, just in case. Get it? ;)
)
)
;
}