This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MatchColumnHeights: function( group, width ) { | |
var tallest = 0, | |
gCount, | |
subGroup, | |
splitGroup, | |
i; | |
splitGroup = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var termCount = 1, | |
termTotal = 1, | |
termIndex = 0; | |
current = 13, | |
discountable = {}; | |
for ( var i = 1; i < 1000000; i++ ) { | |
current = i; | |
if ( ! ( current in discountable ) ) { | |
while ( current != 1 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var numberArray = [ | |
37107287533902102798797998220837590246510135740250, | |
46376937677490009712648124896970078050417018260538, | |
74324986199524741059474233309513058123726617309629, | |
91942213363574161572522430563301811072406154908250, | |
23067588207539346171171980310421047513778063246676, | |
89261670696623633820136378418383684178734361726757, | |
28112879812849979408065481931592621691275889832738, | |
44274228917432520321923589422876796487670272189318, | |
47451445736001306439091167216856844588711603153276, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = 0, | |
i, | |
j; | |
for ( i = 1; i <= 20; i++ ) { | |
result = 1; | |
for ( j = (2*i) - i + 1; j <= (2*i); j++) { | |
result *= j; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result = 0, | |
count = 0; | |
result = bigInt(2).pow( 1000 ).toString(); | |
for (var i = result.length - 1; i >= 0; i--) { | |
count += parseInt( result[ i ] ); | |
} | |
document.write( count ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nameNumber( count ) { | |
var ones = [ '', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen' ], | |
tens = [ 'zero', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety' ]; | |
// Thousands | |
if ( count === 1000 ) { | |
return 'one thousand'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var date, | |
counter = 0; | |
for (var i = 1901; i <= 2000; i++) { | |
for (var j = 1; j <= 12; j++) { | |
date = new Date( i + '-' + pad( j ) + '-01' ); | |
if ( date.getDay() === 0 ) { | |
counter++; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function factorial( n ) { | |
var product = bigInt(1); | |
for (var i = n; i > 0; i--) { | |
product = product.multiply( i ); | |
} | |
return product.toString(); | |
} | |
var number = factorial( 100 ), | |
result = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var results = [], | |
a, | |
b; | |
function divisors( a ) { | |
var divisor = []; | |
for (var i = 1; i <= a / 2; i++) { | |
if ( a % i === 0 ) { | |
divisor.push( i ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var names = names.sort(), | |
alpha = { | |
A: 1, | |
B: 2, | |
C: 3, | |
D: 4, | |
E: 5, | |
F: 6, | |
G: 7, | |
H: 8, |