Skip to content

Commit

Permalink
git hub pages attermp
Browse files Browse the repository at this point in the history
  • Loading branch information
t03jam8 committed Dec 23, 2017
1 parent 2edcc63 commit 2c08762
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
56 changes: 56 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"homepage": "https://t03jam8.github.io/nRooksAndnQueens/",
"name": "nqueens",
"version": "0.1.0",
"private": true,
Expand All @@ -14,6 +15,7 @@
"eject": "react-scripts eject"
},
"devDependencies": {
"babel": "^6.23.0"
"babel": "^6.23.0",
"gh-pages": "^1.1.0"
}
}
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

1 change: 1 addition & 0 deletions src/noun_760119_cc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/position.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// / calculates the number of required tiles

exports.tileNumber = (lng, lat, nTiles) => {
const xlength = Math.sqrt(nTiles / 2) * 2;
const dim = 180 / Math.sqrt(nTiles / 2);
const posLng = 180 + lng;
const posLat = 90 + lat;
return nTiles - (xlength - 1 - Math.floor(posLng / dim) + Math.floor(posLat / dim) * xlength);
};

// console.log(tileNumber(-83, 9.2, 512));

0 comments on commit 2c08762

Please sign in to comment.