{"action":"created","issue":{"url":"https://api.github.com/repos/adrianliaw/PyCuber/issues/16","repository_url":"https://api.github.com/repos/adrianliaw/PyCuber","labels_url":"https://api.github.com/repos/adrianliaw/PyCuber/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/adrianliaw/PyCuber/issues/16/comments","events_url":"https://api.github.com/repos/adrianliaw/PyCuber/issues/16/events","html_url":"https://github.com/adrianliaw/PyCuber/issues/16","id":168704755,"number":16,"title":"Output from CFOPSolver doesn't actually solve a cube","user":{"login":"agraubert","id":997749,"avatar_url":"https://avatars.githubusercontent.com/u/997749?v=3","gravatar_id":"","url":"https://api.github.com/users/agraubert","html_url":"https://github.com/agraubert","followers_url":"https://api.github.com/users/agraubert/followers","following_url":"https://api.github.com/users/agraubert/following{/other_user}","gists_url":"https://api.github.com/users/agraubert/gists{/gist_id}","starred_url":"https://api.github.com/users/agraubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agraubert/subscriptions","organizations_url":"https://api.github.com/users/agraubert/orgs","repos_url":"https://api.github.com/users/agraubert/repos","events_url":"https://api.github.com/users/agraubert/events{/privacy}","received_events_url":"https://api.github.com/users/agraubert/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-01T18:00:52Z","updated_at":"2016-08-04T10:40:43Z","closed_at":"2016-08-04T10:40:43Z","body":"I was messing around with PyCuber and I found something interesting about the CFOPSolver.  It doesn't always solve a cube back to its original state when a cube differs greatly from the original state (the faces always end up solved, but sometimes the faces are in a reversed order).  Additionally, the output from the solver doesn't actually solve  the cube if done manually.  Here is the output from CFOPSolver after I made 10,000 randomly generated turns:\r\n```\r\nCross: R2 F D F' D R' D'\r\nF2L('green', 'orange'): U F' U F R U R'\r\nF2L('orange', 'blue'): y U R U R' U R U' R'\r\nF2L('blue', 'red'): y R U2 R' F' U2 F U F' U2 F\r\nF2L('red', 'green'): y F' U' F U F' U' F\r\nOLL:  F R U R' U' R U R' U' F'\r\nPLL:  U R' U L' U2 R U' R' U2 L R U'\r\n\r\nFULL: R2 F D F' D R' D' U F' U F R U R' U B U B' U B U' B' L U2 L' B' U2 B U B' U2 B L' U' L U L' U' L2 F U F' U' F U F' U' L' U F' U B' U2 F U' F' U2 B F U'\r\nR2 F D F' D R' D' U F' U F R U R' U B U B' U B U' B' L U2 L' B' U2 B U B' U2 B L' U' L U L' U' L2 F U F' U' F U F' U' L' U F' U B' U2 F U' F' U2 B F U'\r\n```\r\nSpecifically the 'FULL:' sequence does not revert the cube its original solved state (and it doesn't get into that kinda-solved state that I mentioned above, either).\r\n\r\nI attached files to reproduce this issue.  [turnsequence.txt](https://github.com/adrianliaw/PyCuber/files/394436/turnsequence.txt) is a randomly generated 10,000 turn sequence to get the cube from the solved state to a sufficiently random state (and is the exact sequence I used when I discovered this issue).  [inversesequence.txt](https://github.com/adrianliaw/PyCuber/files/394435/inversesequence.txt) is the inverse of that sequence (it directly undoes the first sequence).  Lastly, [cfopsolution.txt](https://github.com/adrianliaw/PyCuber/files/394434/cfopsolution.txt) is the `FULL:` sequence produced by CFOPSolution.\r\n\r\nTwo other steps I did to verify:\r\n* `pycuber.Cube()(turn_sequence)(inverse_seqence)` produces an unmodified, solved cube\r\n* `pycuber.Cube()(turn_sequence)(cfop_solution)` produces an unsolved, and still extensively modified cube\r\n\r\n(pycuber 0.2.1)"},"comment":{"url":"https://api.github.com/repos/adrianliaw/PyCuber/issues/comments/237517850","html_url":"https://github.com/adrianliaw/PyCuber/issues/16#issuecomment-237517850","issue_url":"https://api.github.com/repos/adrianliaw/PyCuber/issues/16","id":237517850,"user":{"login":"adrianliaw","id":2776892,"avatar_url":"https://avatars.githubusercontent.com/u/2776892?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianliaw","html_url":"https://github.com/adrianliaw","followers_url":"https://api.github.com/users/adrianliaw/followers","following_url":"https://api.github.com/users/adrianliaw/following{/other_user}","gists_url":"https://api.github.com/users/adrianliaw/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianliaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianliaw/subscriptions","organizations_url":"https://api.github.com/users/adrianliaw/orgs","repos_url":"https://api.github.com/users/adrianliaw/repos","events_url":"https://api.github.com/users/adrianliaw/events{/privacy}","received_events_url":"https://api.github.com/users/adrianliaw/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T10:40:42Z","updated_at":"2016-08-04T10:40:42Z","body":"Hi @agraubert, it seems like you accidentally put the solution after `FULL:` and the output returned by `CFOPSolver.solve` function (which is the exact same solution) together, resulted into an 120 steps formula that do the solution twice.\r\n\r\nThe `CFOPSolver.solve` function prints out the solution step-by-step, and also prints out the full solution **in one line** after `FULL: `, and finally, return the solution formula. You probably used something like `print(solver.solve())`, so it will also print out the result returned by the function, which confused you.\r\n\r\n```\r\nPrinted in the function -->  FULL: R2 F D F' D R' D' U F' U F R U R' U B U B' U B U' B' L U2 L' B' U2 B U B' U2 B L' U' L U L' U' L2 F U F' U' F U F' U' L' U F' U B' U2 F U' F' U2 B F U'\r\nReturned by solver.solve --> R2 F D F' D R' D' U F' U F R U R' U B U B' U B U' B' L U2 L' B' U2 B U B' U2 B L' U' L U L' U' L2 F U F' U' F U F' U' L' U F' U B' U2 F U' F' U2 B F U'\r\n```\r\n\r\nYou can either not use `print`, or use `solver.solve(suppress_progress_messages=True)`, to avoid confusion."}}
{"actor":{"display_login":"adrianliaw"}}