Skip to content

Commit

Permalink
result4 の作成部分を修正(その1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jun68ykt committed Aug 9, 2019
1 parent b8749b0 commit 462b418
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions main.js
Expand Up @@ -18,26 +18,7 @@ document.addEventListener('DOMContentLoaded', function() {
line => line.split(/\s+/).slice(0, 5)
);

Array.prototype.divide = function(n){
var ary = this;
var idx = 0;
var results = [];
var length = ary.length;

while (idx + n < length){
var result = ary.slice(idx,idx+n)
results.push(result);
idx = idx + n
}
var rest = ary.slice(idx,length+1)
results.push(rest)
return results;
}

result4=[];
for (var i = 0; i<result3.length; i++) {
result4.push(result3[i].divide(1));
}
var result4 = result3.map(ary => ary.map(e => [e]));

for (var i = 0; i<result4.length; i++) {
if(result4[i][4][0].indexOf("x") >= 0){
Expand Down

0 comments on commit 462b418

Please sign in to comment.