-
Notifications
You must be signed in to change notification settings - Fork 222
new ch5 wip #163
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
new ch5 wip #163
Conversation
|
Is there a deployment of this that I could be looking at? |
samuelgoto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit hard to read with inconsistent formatting between the files. Can yon run a linter here in all files to make sure all files have a consistent style guide?
I'm mostly interested in unblocking the submission of this CL as quickly as possible, but hoping to get at least some of the low hanging fruits regarding code quality.
| if (largest_value == utillity(RESULT(state, action_list[action]))) { | ||
| return action_list[action]; | ||
| function alphabeta() { | ||
| let cur = abstates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; at end of lines here and elsewhere
| function alphabeta() { | ||
| let cur = abstates | ||
| let scale = 600 | ||
| let div = document.getElementById("alphabetaCanvas") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix indentation, here and elsewhere
| return utillity(state); | ||
| var largest_value = 0; | ||
| var action_list = actions(state); | ||
| for (var action = 0; action < action_list.length; action++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JS has this neat iterator, like for (let action of action_lists) which works really nice. worth using it.
| function reset(tree, depth, opacity) { | ||
| tree.graphic.group.setAttribute('opacity', opacity) | ||
| tree.graphic.message.setAttribute('class', 'board_status') | ||
| if (depth == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd wrap everything around {}s. here and elsewhere
| return 1 | ||
| } | ||
|
|
||
| GetBoardOpacity(id, tile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little awkward that there is no consistency between method name patterns here ... maybe just use camelCaseEverywhere?
This is the WIP concept for a new style.