Skip to content

Instantly share code, notes, and snippets.

View wenbolovesnz's full-sized avatar

Wenbolovesnz wenbolovesnz

View GitHub Profile
@wenbolovesnz
wenbolovesnz / gist:3e06410cf959d6452c8d
Last active August 29, 2015 14:15
Generate 1000 unique for digits pin code, ensure no two numbers next to each other are same, and not incremental numbers
function run(){
var numbersArray = [];
var startNumber = 0;
while(numbersArray.length < 1000){
startNumber = Math.floor(Math.random() * (10000 - 1000 + 1)) + 1000;
if(!checkIfHasTwoSame(startNumber) && !checkHasIncremental(startNumber
&& !isExist(numbersArray, startNumber))){