Skip to content

Commit

Permalink
Made scoring.js, space.js and world.js jshint compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasloisp committed Oct 2, 2016
1 parent c1ce1a8 commit 36b01a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion script/scoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var Score = {
var fullScore = 0;

var factor = [1, 1.5, 1, 2, 2, 3, 3, 2, 2, 2, 2, 1.5, 1,
1, 10, 30, 50, 100, 150, 150, 3, 3, 5, 4]
1, 10, 30, 50, 100, 150, 150, 3, 3, 5, 4];
for(var i = 0; i< factor.length; i++){
fullScore += scoreUnadded[i] * factor[i];
}
Expand Down
4 changes: 2 additions & 2 deletions script/space.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ var Space = {
clearTimeout(Events._eventTimeout);
clearTimeout(Room._fireTimer);
clearTimeout(Room._tempTimer);
for(var k in Room.Craftables) {
Room.Craftables[k].button = null;
for(var j in Room.Craftables) {
Room.Craftables[j].button = null;
}
for(var k in Room.TradeGoods) {
Room.TradeGoods[k].button = null;
Expand Down
12 changes: 6 additions & 6 deletions script/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ var World = {
// Place landmarks
for(var k in World.LANDMARKS) {
var landmark = World.LANDMARKS[k];
for(var i = 0; i < landmark.num; i++) {
for(var l = 0; l < landmark.num; l++) {
var pos = World.placeLandmark(landmark.minRadius, landmark.maxRadius, k, map);
}
}
Expand Down Expand Up @@ -713,7 +713,7 @@ var World = {
targets[index] = {
x : i - World.RADIUS,
y : j - World.RADIUS,
}
};
index++;
if(index === max){
// optimisation: stop the research if maximum number of items has been reached
Expand Down Expand Up @@ -796,8 +796,8 @@ var World = {
}

var list = [];
for(var t in chances) {
list.push(chances[t] + '' + t);
for(var j in chances) {
list.push(chances[j] + '' + j);
}
list.sort(function(a, b) {
var n1 = parseFloat(a.substring(0, a.length - 1));
Expand All @@ -807,8 +807,8 @@ var World = {

var c = 0;
var r = Math.random();
for(var i in list) {
var prob = list[i];
for(var l in list) {
var prob = list[l];
c += parseFloat(prob.substring(0,prob.length - 1));
if(r < c) {
return prob.charAt(prob.length - 1);
Expand Down

0 comments on commit 36b01a7

Please sign in to comment.