Skip to content

Commit

Permalink
Minor code cleanup (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilgoldsmith authored and ldez committed May 19, 2019
1 parent 4a00560 commit 42f04ef
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/solve.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,9 @@ Cube::solveUpright = (maxDepth=22) ->
solution = null

phase1search = (state) ->
depth = 0
for depth in [1..maxDepth]
phase1(state, depth)
break if solution isnt null
depth++

phase1 = (state, depth) ->
if depth is 0
Expand All @@ -646,7 +644,6 @@ Cube::solveUpright = (maxDepth=22) ->
for depth in [1..maxDepth - state.depth]
phase2(state, depth)
break if solution isnt null
depth++

phase2 = (state, depth) ->
if depth is 0
Expand All @@ -665,11 +662,8 @@ Cube::solveUpright = (maxDepth=22) ->
phase1search(state)
freeStates.push(state)

# Trim the trailing space
if solution.length > 0
solution = solution.substring(0, solution.length - 1)

solution
# Trim the trailing space and return
solution.trim()

faceNums =
U: 0
Expand Down

0 comments on commit 42f04ef

Please sign in to comment.