ragulbalaji / MachineLearnsTicTacToe

Neural Network That Crowdsources Strategies for TicTacToe!
MIT License
8 stars 7 forks source link

[Hacktoberfest] Simple JS Code Clean Up! #1

Open ragulbalaji opened 8 years ago

ragulbalaji commented 8 years ago

This was written in a hurry, it would be great if some professional adds some structure to this!

0x1211 commented 8 years ago

Hello ! Going for a small chunk ;-)

ragulbalaji commented 8 years ago

@thecuriousnoob Go ahead I'm excited to see other people's input!

lkwatson commented 8 years ago

Going in as well!

ragulbalaji commented 8 years ago

@lkwatson welcome to the partyyyy

0x1211 commented 8 years ago

Dude, did you ever run your project ? 😄

ragulbalaji commented 8 years ago

@thecuriousnoob nope I havent ran it today since all yall made changes, probably doesnt work but I dont really care for now.

0x1211 commented 8 years ago

Okay I'd recommend you for any other project to merge changes into another branch so you can ensure that build requirements and any tests can pass before merging them into master. This workflow wouldn't be blocking your project ;-)

0x1211 commented 8 years ago

It would be great if you had time to document your code and the scripts you wrote so we could split this cleanup into issues (cause there's a lot of work here). Then it would be easier for any contributor to grab an issue and submit a PR. This is actually doable independently from current changes brought to your master branch and would help a lot of contributors to come ! :-)

lkwatson commented 8 years ago

I definitely second @thecuriousnoob, a little more documentation would go a long way.

But cool project, I like it.

piq9117 commented 8 years ago
for (var i = 0; i < data.length; i++) {
  for (var j = 0; j <= i; j++) {
    if (i === j) {
      unique.push(data[i])
    }
    if (j < i && comparator(data[i], data[j])) {
      console.log('duplicate found')
      break
    }
  }
}

did you want to check the elements of input and output are equal or not? How did you generate the data? its saying I have the wrong json format.

klanmiko commented 8 years ago

No I'm taking the input and extracting all the unique values, then saving it back into trainingdata.json.

Data is generated through gameplay.