Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JLN js-tic-tac-toe #19

Open
wants to merge 21 commits into
base: jln/master
Choose a base branch
from
Open

JLN js-tic-tac-toe #19

wants to merge 21 commits into from

Conversation

noglows
Copy link

@noglows noglows commented Feb 1, 2016

Completed all project requirements and some optional requirements:

  • Number of wins is totaled for players
  • Reset button

Additional work not yet completed:

  • One player mode
  • Refactoring and adjustments to the scoring logic

@shannachau shannachau self-assigned this Feb 9, 2016
self.incrementScore(4, player);
} else if (track_space.substring(2,4) == "c3") {
self.incrementScore(5, player);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clean up these else if statements, you could use JavaScript's switch statement. It's very similar to Ruby's case statement!

http://www.w3schools.com/js/js_switch.asp

@shannachau
Copy link

Your code was very clean and easy to follow, so there was not much for me to comment on! I liked your logic for gameplay. You'll find that there are a lot of similar functions in Javascript and Ruby, like the switch case statement, that you can use to clean up the code a bit. Really awesome job for your first Javascript project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants