Skip to content

Adds turn down, left and right functions#5

Open
TheMightyWarPig wants to merge 5 commits intomasterfrom
Caleb's_branch
Open

Adds turn down, left and right functions#5
TheMightyWarPig wants to merge 5 commits intomasterfrom
Caleb's_branch

Conversation

@TheMightyWarPig
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@JCharante JCharante left a comment

Choose a reason for hiding this comment

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

Roasted you

# 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):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please conform to pep8 and have a line break in between methods.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please resolve the conflicts that would occur when merging, as you have a super outdated copy of master in your branch.

@JCharante
Copy link
Copy Markdown
Contributor

I'll approve this pull request once I see test functions written for the new turn functions.

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