Adds turn down, left and right functions#5
Conversation
| # Changing other sides | ||
| self.faces['l'][0][0], self.faces['l'][0][1], self.faces['b'][0][0], self.faces['b'][0][1], self.faces['f'][0][0], self.faces['f'][0][1], self.faces['r'][0][0], self.faces['r'][0][1] = self.faces['f'][0][0], self.faces['f'][0][1], self.faces['l'][0][0], self.faces['l'][0][1], self.faces['r'][0][0], self.faces['r'][0][1], self.faces['b'][0][0], self.faces['b'][0][1] | ||
|
|
||
| def turn_l(self): |
There was a problem hiding this comment.
please conform to pep8 and have a line break in between methods.
There was a problem hiding this comment.
Is there a way to generalize these rotations into your own functions so this approaches legibility? You could pass in the starting face and target face so you don't have to self.faces a million times at least. Consider a way where you don't need a giant ugly 1-line assignment.
- Hal
| self.faces['f'][1][0], self.faces['f'][0][0] = self.faces['u'][1][0],self.faces['u'][0][0] | ||
| self.faces['u'][1][0], self.faces['u'][0][0] = self.faces['b'][1][0],self.faces['b'][0][0] | ||
| self.faces['b'][1][0], self.faces['b'][0][0] = self.faces['d'][1][0],self.faces['d'][0][0] | ||
| def turn_r(self): |
There was a problem hiding this comment.
please conform to pep8 and have a line break between methods
2by2.py
Outdated
| self.faces['u'][0][1], self.faces['u'][1][1], self.faces['u'][0][0], self.faces['u'][1][0] = self.faces['u'][0][0], self.faces['u'][0][1], self.faces['u'][1][0], self.faces['u'][1][1] | ||
| # Changing other sides | ||
| self.faces['l'][0][0], self.faces['l'][0][1], self.faces['b'][0][0], self.faces['b'][0][1], self.faces['f'][0][0], self.faces['f'][0][1], self.faces['r'][0][0], self.faces['r'][0][1] = self.faces['f'][0][0], self.faces['f'][0][1], self.faces['l'][0][0], self.faces['l'][0][1], self.faces['r'][0][0], self.faces['r'][0][1], self.faces['b'][0][0], self.faces['b'][0][1] | ||
|
|
There was a problem hiding this comment.
please keep the line break between the class and the following lines
| print(cube.face_to_str('r')) | ||
| print(cube.face_to_str('f')) | ||
| print(cube.face_to_str('b')) No newline at end of file | ||
| print(cube.face_to_str('b')) |
There was a problem hiding this comment.
Please resolve the conflicts that would occur when merging, as you have a super outdated copy of master in your branch.
…the functions added by Caleb M. actually work.
|
I'll approve this pull request once I see test functions written for the new turn functions. |
# Conflicts: # 2by2.py
No description provided.