A non exhaustive list of gcc compiler options.
$ gcc myprog.c -o myprog -Wall -Wextra -pedantic -std=c11 [...]
| // queens: column numbers of queen in each row : 0-7 | |
| var isValid = function (queens) { | |
| return queens.every(function (cur, index) { | |
| for (var i = index + 1; i < queens.length; i++) { | |
| if (cur === queens[i]) return false; // as same column | |
| if (cur + index === queens[i] + i) return false; // as 07=16=25=... | |
| if (cur - index === queens[i] - i) return false; // as 00=11=22=... | |
| } | |
| return true; | |
| }) |
| function permutations(list) | |
| { | |
| // Empty list has one permutation | |
| if (list.length == 0) | |
| return [[]]; | |
| var result = []; | |
| for (var i=0; i<list.length; i++) |
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |