forked from jackdclark/five
-
Notifications
You must be signed in to change notification settings - Fork 0
/
five.js
executable file
·117 lines (101 loc) · 4.14 KB
/
five.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
(function () {
var five = function() { return 5; };
five.upHigh = function() { return '⁵'; };
five.downLow = function() { return '₅'; };
five.roman = function() { return 'V'; };
five.convertTo = function(anotherNumber) {
// If you need other numbers I'd strongly suggest you call
// this function when your app starts up and cache the result.
var oneFifthOfFive = five() / five();
while(anotherNumber < oneFifthOfFive) {
anotherNumber += oneFifthOfFive;
}
return anotherNumber;
};
five.arabic = function() { return 'خمسة'; };
five.azerbaijani = function() { return 'beş'; };
five.basque = function() { return 'bost'; };
five.bosnian = function() { return 'pet'; };
five.bulgarian = function() { return 'пет'; };
five.catalan = function() { return 'cinc'; };
five.chinese = function() { return '五'; };
five.choctaw = function() { return 'tahlapi'; };
five.croatian = function() { return 'pet'; };
five.czech = function() { return 'pět'; };
five.dovah = function() { return 'hen'; };
five.dutch = function() { return 'vijf'; };
five.elvish = function() { return 'lempe'; };
five.english = function() { return 'five'; };
five.finnish = function() { return 'viisi'; };
five.french = function() { return 'cinq'; };
five.german = function() { return 'fünf'; };
five.hebrew = function() { return 'חמש'; };
five.hindi = function() { return 'पांच'; };
five.hungarian = function() { return 'öt'; };
five.indonesian = function() { return 'lima'; };
five.irish = function() { return 'cúig'; };
five.italian = function() { return 'cinque'; };
five.japanese = function() { return '五'; };
five.kannada = function() { return 'ಐದು'; };
five.klingon = function() { return 'vagh'; };
five.korean = function() { return '오'; };
five.latin = function() { return 'quinque'; };
five.latvian = function() { return 'pieci'; };
five.mongolian = function() { return 'таван'; };
five.norwegian = function() { return 'fem'; };
five.persian = function() { return 'پنج'; };
five.piglatin = function() { return 'ivefay'; };
five.polish = function() { return 'pięć'; };
five.portuguese = function () { return 'cinco'; };
five.romanian = function() { return 'cinci'; };
five.russian = function() { return 'пять'; };
five.serbian = function() { return 'pet'; };
five.slovakian = function() { return 'päť'; };
five.slovenian = function() { return 'pet'; };
five.spanish = function() { return 'cinco'; };
five.swedish = function() { return 'fem'; };
five.tamil = function() { return 'ஐந்து'; };
five.telugu = function() { return 'ఐదు'; };
five.turkish = function() { return 'beş'; };
five.thai = function() { return 'ห้า'; };
five.ukrainian = function() { return 'п’ять'; };
five.welsh = function() { return 'pump'; };
five.morseCode = function() { return 'di-di-di-di-dit'; };
five.binary = function() { return '101'; };
five.octal = function() { return '5'; };
five.hex = function() { return '5'; };
five.negative = function() { return -5; };
five.loud = function() { return 'FIVE'; };
five.smooth = function() { return 'S'; };
five.tooSlow = function() {
var returnIn = new Date(new Date().valueOf() + 555);
do {} while(new Date() < returnIn);
return five();
};
five.map = function(array) { return array.map(five); };
five.reduce = function(array) { return array.reduce(five); };
five.fab = function() {
return ['Juwan Howard','Ray Jackson','Jimmy King','Jalen Rose','Chris Webber'];
};
five.rot = function(word) {
if(typeof(word) != 'string') {
return word;
}
function replaceLetter(z) {
if('0' <= z && z <= '9') {
return ((parseInt(z)+5)%10).toString();
}
var aLetter = (z <= 'Z' ? 'A': 'a').charCodeAt(0);
var x = 5 + z.charCodeAt(0) - aLetter;
x %= 26;
return String.fromCharCode(x+aLetter);
}
return word.replace(/[a-zA-Z0-9]/g, replaceLetter);
};
five.valueOf = five;
if(typeof module !== 'undefined' && module.exports) {
module.exports = five;
} else if (window) {
window.five = five;
}
}());