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

create board #49

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open

create board #49

wants to merge 2 commits into from

Conversation

clenclen
Copy link

created board that is clickable.
unable to figure out how to randomize spans.

created board that is clickable.
unable to figure out how to randomize spans.
shuffle function and more
var self = this
this.div.click(function(){
self.handleClick();
})
Copy link
Member

Choose a reason for hiding this comment

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

FYI, you could also write this as this.div.click(this.handleClick.bind(this)).

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I sort of remember talking about this in class. I also just watched a tutorial about factory functions and how to avoid using "this", so trying to process that too, hehe.

@afeld
Copy link
Member

afeld commented Mar 5, 2016

Looks good overall! Take a look at the warnings, as it makes some good suggestions. In particular, using semicolons or not is fine (I would recommend the former), but please be consistent about it!

@clenclen
Copy link
Author

clenclen commented Mar 6, 2016

I still have a little confusion as to when to use other classes vs subclasses. With the "shuffle" and "removeAndPrintElements" functions, should that they been put into its own class or somehow included in the Tile class?

@afeld
Copy link
Member

afeld commented Mar 8, 2016

A subclass makes sense when you have a more specialized version of a thing, e.g. if this game were to have a concept of Tile and JackpotTile or something. I would probably put those two functions on an arrayHelpers object or something, just to keep them grouped.

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