import random

from turtle import Turtle

from turtle import Screen

stickers = Turtle ( )

stickers. speed ( 0 )

screen = Screen ( )

#sticker variables

red = "red"

blue = "blue"

green = "green"

orange = "orange"

white = "white"

yellow = "yellow"

#variable format (face,height,leftrightormiddle)

#front

ful = red

fum = red

fur = red

fml = red

fmm = red

fmr = red

fdl = red

fdm = red

fdr = red

#back face

bul = orange

bum = orange

bur = orange

bml = orange

bmm = orange

bmr = orange

bdl = orange

bdm = orange

bdr = orange

#right face

rul = green

rum = green

rur = green

rml = green

rmm = green

rmr = green

rdl = green

rdm = green

rdr = green

#left face

lul = blue

lum = blue

lur = blue

lml = blue

lmm = blue

lmr = blue

ldl = blue

ldm = blue

ldr = blue

#top face

uul = yellow

uum = yellow

uur = yellow

uml = yellow

umm = yellow

umr = yellow

udl = yellow

udm = yellow

udr = yellow

#bottom face

dul = white

dum = white

dur = white

dml = white

dmm = white

dmr = white

ddl = white

ddm = white

ddr = white

def drawcube ( ) :

screen. tracer ( 0 , 0 )

#black base

stickers. setpos ( 0 , 0 )

stickers. color ( "black" )

stickers. backward ( 10 )

stickers. begin_fill ( )

stickers. forward ( 115 )

stickers. right ( 90 )

stickers. forward ( 115 )

stickers. right ( 90 )

stickers. forward ( 115 )

stickers. right ( 90 )

stickers. forward ( 115 )

stickers. right ( 180 )

stickers. end_fill ( )

stickers. left ( 90 )

#black base left side

stickers. begin_fill ( )

stickers. left ( 135 )

stickers. forward ( 57.5 )

stickers. left ( 135 )

stickers. forward ( 115 )

stickers. left ( 45 )

stickers. forward ( 57.5 )

stickers. end_fill ( )

#black base top

stickers. left ( 135 )

stickers. forward ( 115 )

stickers. left ( 45 )

stickers. begin_fill ( )

stickers. forward ( 57.5 )

stickers. right ( 135 )

stickers. forward ( 115 )

stickers. right ( 45 )

stickers. forward ( 57.5 )

stickers. right ( 135 )

stickers. forward ( 115 )

stickers. end_fill ( )

stickers. left ( 90 )

stickers. forward ( 35 )

stickers. left ( 90 )

stickers. forward ( 10 )

#sticker creation

#front face

stickers. color ( ful )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( fum )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( fur )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

#down a layer

stickers. penup ( )

stickers. left ( 180 )

stickers. forward ( 105 )

stickers. left ( 90 )

stickers. forward ( 35 )

stickers. left ( 90 )

stickers. pendown ( )

stickers. color ( fml )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( fmm )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( fmr )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

#down a layer

stickers. penup ( )

stickers. left ( 180 )

stickers. forward ( 105 )

stickers. left ( 90 )

stickers. forward ( 35 )

stickers. left ( 90 )

stickers. pendown ( )

stickers. color ( fdl )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( fdm )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( fdr )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. forward ( 25 )

stickers. left ( 90 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 35 )

stickers. right ( 180 )

stickers. forward ( 105 )

stickers. right ( 90 )

stickers. forward ( 105 )

stickers. right ( 90 )

stickers. pendown ( )

#left face stickers

stickers. penup ( )

stickers. backward ( 10 )

stickers. right ( 90 )

stickers. forward ( 10 )

stickers. left ( 90 )

stickers. left ( 135 )

stickers. forward ( 7 )

stickers. pendown ( )

stickers. color ( lur )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 5 )

stickers. pendown ( )

stickers. color ( lum )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 3.3333 )

stickers. pendown ( )

stickers. color ( lul )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

#down layer

stickers. penup ( )

stickers. backward ( 52.8333 )

stickers. left ( 135 )

stickers. forward ( 35 )

stickers. right ( 135 )

stickers. forward ( 7 )

stickers. pendown ( )

stickers. color ( lmr )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 5 )

stickers. pendown ( )

stickers. color ( lmm )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 3.3333 )

stickers. pendown ( )

stickers. color ( lml )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

#down layer

stickers. penup ( )

stickers. backward ( 52.8333 )

stickers. left ( 135 )

stickers. forward ( 35 )

stickers. right ( 135 )

stickers. forward ( 7 )

stickers. pendown ( )

stickers. color ( ldr )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 5 )

stickers. pendown ( )

stickers. color ( ldm )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 3.3333 )

stickers. pendown ( )

stickers. color ( ldl )

stickers. begin_fill ( )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. left ( 135 )

stickers. forward ( 25 )

stickers. left ( 45 )

stickers. forward ( 12.5 )

stickers. end_fill ( )

#return to start position

stickers. penup ( )

stickers. backward ( 52.8333 )

stickers. right ( 45 )

stickers. forward ( 80 )

stickers. right ( 90 )

stickers. pendown ( )

#top face stickers

stickers. penup ( )

stickers. left ( 135 )

stickers. forward ( 5 )

stickers. right ( 135 )

stickers. forward ( 10 )

stickers. pendown ( )

stickers. color ( udl )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 15.625 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 15.625 )

stickers. left ( 45 )

stickers. end_fill ( )

#move forward

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( udm )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 15.625 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 15.625 )

stickers. left ( 45 )

stickers. end_fill ( )

#move forward

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( udr )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 15.625 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 15.625 )

stickers. left ( 45 )

stickers. end_fill ( )

#up a layer

stickers. penup ( )

stickers. right ( 180 )

stickers. forward ( 70 )

stickers. right ( 45 )

stickers. forward ( 20.625 )

stickers. right ( 135 )

stickers. pendown ( )

stickers. color ( uml )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 10.416667 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 10.416667 )

stickers. left ( 45 )

stickers. end_fill ( )

#move forward

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( umm )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 10.416667 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 10.416667 )

stickers. left ( 45 )

stickers. end_fill ( )

#move forward

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( umr )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 10.416667 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 10.416667 )

stickers. left ( 45 )

stickers. end_fill ( )

#up a layer

stickers. penup ( )

stickers. right ( 180 )

stickers. forward ( 70 )

stickers. right ( 45 )

stickers. forward ( 13.416667 )

stickers. right ( 135 )

stickers. pendown ( )

stickers. color ( uul )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 9.94444 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 9.94444 )

stickers. left ( 45 )

stickers. end_fill ( )

#move forward

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( uum )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 9.94444 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 9.94444 )

stickers. left ( 45 )

stickers. end_fill ( )

#move forward

stickers. penup ( )

stickers. forward ( 35 )

stickers. pendown ( )

stickers. color ( uur )

stickers. begin_fill ( )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 9.94444 )

stickers. left ( 45 )

stickers. forward ( 25 )

stickers. left ( 135 )

stickers. forward ( 9.94444 )

stickers. left ( 45 )

stickers. end_fill ( )

#start turns

stickers. speed ( 0 )

stickers. penup ( )

stickers. right ( 180 )

stickers. forward ( 70 )

stickers. left ( 135 )

stickers. forward ( 9.94444 + 10.416667 + 19.625 )

stickers. left ( 45 )

stickers. pendown ( )

screen. update ( )

def draw2x2 ( ) :

stickers. clear ( )

screen. tracer ( 0 , 0 )

stickers. speed ( 0 )

stickers. color ( "black" )

stickers. penup ( )

stickers. backward ( 50 )

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 100 )

stickers. left ( 90 )

stickers. forward ( 100 )

stickers. left ( 90 )

stickers. forward ( 100 )

stickers. left ( 90 )

stickers. forward ( 100 )

stickers. end_fill ( )

stickers. setpos ( 0 , 0 )

stickers. penup ( )

stickers. left ( 90 )

stickers. backward ( 50 )

stickers. pendown ( )

stickers. begin_fill ( )

stickers. left ( 135 )

stickers. forward ( 44 )

stickers. right ( 45 )

stickers. forward ( 100 )

stickers. right ( 135 )

stickers. forward ( 44 )

stickers. end_fill ( )

stickers. left ( 180 )

stickers. begin_fill ( )

stickers. forward ( 44 )

stickers. right ( 135 )

stickers. forward ( 100 )

stickers. right ( 45 )

stickers. forward ( 44 )

stickers. end_fill ( )

stickers. penup ( )

#stickers

#front

stickers. left ( 45 )

stickers. setpos ( - 50 , 100 )

stickers. right ( 90 )

stickers. forward ( 10 )

stickers. left ( 90 )

stickers. forward ( 10 )

def stickersfront ( ) :

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 35 )

stickers. right ( 90 )

stickers. forward ( 35 )

stickers. right ( 90 )

stickers. forward ( 35 )

stickers. right ( 90 )

stickers. forward ( 35 )

stickers. right ( 90 )

stickers. forward ( 35 )

stickers. end_fill ( )

stickers. penup ( )

stickers. forward ( 10 )

stickers. color ( ful )

stickersfront ( )

stickers. color ( fur )

stickersfront ( )

stickers. setpos ( - 40 , 45 )

stickers. color ( fdl )

stickersfront ( )

stickers. color ( fdr )

stickersfront ( )

#stickersleft

stickers. setpos ( - 52.5 , 90 )

stickers. left ( 180 )

stickers. right ( 45 )

def stickersleft ( ) :

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 17.5 )

stickers. left ( 135 )

stickers. forward ( 35 )

stickers. left ( 45 )

stickers. forward ( 17.5 )

stickers. left ( 135 )

stickers. forward ( 35 )

stickers. end_fill ( )

stickers. penup ( )

stickers. left ( 45 )

stickers. forward ( 20 )

stickers. color ( lur )

stickersleft ( )

stickers. color ( lul )

stickersleft ( )

stickers. setpos ( - 52.5 , 45 )

stickers. color ( ldr )

stickersleft ( )

stickers. color ( ldl )

stickersleft ( )

#top face

stickers. setpos ( - 45 , 103 )

stickers. right ( 135 )

def stickerstop ( ) :

stickers. color ( udl )

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 17.5 )

stickers. left ( 45 )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 17.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. left ( 180 )

stickers. forward ( 20.5 )

stickers. right ( 135 )

stickers. penup ( )

stickers. color ( uul )

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 14.5 )

stickers. left ( 45 )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 14.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. left ( 180 )

stickers. forward ( 20.5 )

stickers. right ( 135 )

stickers. penup ( )

stickers. setpos ( 0 , 103 )

stickers. color ( udr )

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 17.5 )

stickers. left ( 45 )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 17.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. left ( 180 )

stickers. forward ( 20.5 )

stickers. right ( 135 )

stickers. penup ( )

stickers. color ( uur )

stickers. pendown ( )

stickers. begin_fill ( )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 14.5 )

stickers. left ( 45 )

stickers. forward ( 35 )

stickers. left ( 135 )

stickers. forward ( 14.5 )

stickers. end_fill ( )

stickers. penup ( )

stickers. left ( 180 )

stickers. forward ( 20.5 )

stickers. right ( 135 )

stickerstop ( )

stickers. setpos ( 0 , 0 )

screen. update ( )

cubeselect = 1

while cubeselect == 1 :

cube = input ( "What cube would you like? " )

if cube == "3x3" :

#variable format (face,height,leftrightormiddle)

#front

ful = red

fum = red

fur = red

fml = red

fmm = red

fmr = red

fdl = red

fdm = red

fdr = red

#back face

bul = orange

bum = orange

bur = orange

bml = orange

bmm = orange

bmr = orange

bdl = orange

bdm = orange

bdr = orange

#right face

rul = green

rum = green

rur = green

rml = green

rmm = green

rmr = green

rdl = green

rdm = green

rdr = green

#left face

lul = blue

lum = blue

lur = blue

lml = blue

lmm = blue

lmr = blue

ldl = blue

ldm = blue

ldr = blue

#top face

uul = yellow

uum = yellow

uur = yellow

uml = yellow

umm = yellow

umr = yellow

udl = yellow

udm = yellow

udr = yellow

#bottom face

dul = white

dum = white

dur = white

dml = white

dmm = white

dmr = white

ddl = white

ddm = white

ddr = white

stickers. clear ( )

drawcube ( )

print ( "Type a move you would like to make then hit enter and put in the next move you would like to make" )

print ( "type commands for a list of commands you can enter" )

stall = 1

while stall == 1 :

pause = input ( "Move:" )

pause = pause. lower ( )

stickers. clear ( )

if pause == "f" :

#front face

#corners

temp = ful

ful = fdl

fdl = fdr

fdr = fur

fur = temp

#edges

temp = fum

fum = fml

fml = fdm

fdm = fmr

fmr = temp

#ring around

#corners

temp = udl

udl = ldr

ldr = dur

dur = rul

rul = temp

temp2 = udr

udr = lur

lur = dul

dul = rdl

rdl = temp2

#edges

temp = udm

udm = lmr

lmr = dum

dum = rml

rml = temp

elif pause == "f'" :

#front face

#corners

temp = ful

ful = fur

fur = fdr

fdr = fdl

fdl = temp

#edges

temp2 = fum

fum = fmr

fmr = fdm

fdm = fml

fml = temp2

#ring around front face

#corners

temp = lur

temp2 = ldr

lur = udr

ldr = udl

udr = rdl

udl = rul

rdl = dul

rul = dur

dul = temp

dur = temp2

#edges

temp = lmr

lmr = udm

udm = rml

rml = dum

dum = temp

elif pause == "u" :

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

elif pause == "u'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

elif pause == "r" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

elif pause == "r'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

elif pause == "l" :

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

elif pause == "l'" :

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif pause == "d" :

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif pause == "d'" :

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

elif pause == "b" :

#back face

#corners

temp = bul

bul = bur

bur = bdr

bdr = bdl

bdl = temp

#edges

temp = bum

bum = bmr

bmr = bdm

bdm = bml

bml = temp

#ring around layer

temp = uul

uul = rur

rur = ddr

ddr = ldl

ldl = temp

temp2 = uur

uur = rdr

rdr = ddl

ddl = lul

lul = temp2

#edges

temp = uum

uum = rmr

rmr = ddm

ddm = lml

lml = temp

elif pause == "b'" :

#back face

#corners

temp = bul

bul = bdl

bdl = bdr

bdr = bur

bur = temp

#edges

temp = bum

bum = bml

bml = bdm

bdm = bmr

bmr = temp

#ring around layer

#corners

temp = uul

uul = ldl

ldl = ddr

ddr = rur

rur = temp

temp2 = uur

uur = lul

lul = ddl

ddl = rdr

rdr = temp2

#edges

temp = uum

uum = lml

lml = ddm

ddm = rmr

rmr = temp

elif pause == "solve" :

ful = red

fum = red

fur = red

fml = red

fmm = red

fmr = red

fdl = red

fdm = red

fdr = red

#back face

bul = orange

bum = orange

bur = orange

bml = orange

bmm = orange

bmr = orange

bdl = orange

bdm = orange

bdr = orange

#right face

rul = green

rum = green

rur = green

rml = green

rmm = green

rmr = green

rdl = green

rdm = green

rdr = green

#left face

lul = blue

lum = blue

lur = blue

lml = blue

lmm = blue

lmr = blue

ldl = blue

ldm = blue

ldr = blue

#top face

uul = yellow

uum = yellow

uur = yellow

uml = yellow

umm = yellow

umr = yellow

udl = yellow

udm = yellow

udr = yellow

#bottom face

dul = white

dum = white

dur = white

dml = white

dmm = white

dmr = white

ddl = white

ddm = white

ddr = white

drawcube ( )

elif pause == "y" :

#bottom rotation

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

#top rotation

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

#middle layer rotation

temp = fml

fml = rml

rml = bmr

bmr = lml

lml = temp

temp = fmm

fmm = rmm

rmm = bmm

bmm = lmm

lmm = temp

temp = fmr

fmr = rmr

rmr = bml

bml = lmr

lmr = temp

elif pause == "y'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

#middle

#centers

temp = fmm

fmm = lmm

lmm = bmm

bmm = rmm

rmm = temp

#edges

temp = fml

fml = lml

lml = bmr

bmr = rml

rml = temp

temp = fmr

fmr = lmr

lmr = bml

bml = rmr

rmr = temp

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif pause == "x" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

#middle

#centers

temp = dmm

dmm = bmm

bmm = umm

umm = fmm

fmm = temp

#edges

temp = dum

dum = bdm

bdm = uum

uum = fum

fum = temp

temp = ddm

ddm = bum

bum = udm

udm = fdm

fdm = temp

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif pause == "x'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

#middle

#centers

temp = fmm

fmm = umm

umm = bmm

bmm = dmm

dmm = temp

#edges

temp = fum

fum = uum

uum = bdm

bdm = dum

dum = temp

temp = fdm

fdm = udm

udm = bum

bum = ddm

ddm = temp

elif pause == "m" :

#middle

#centers

temp = fmm

fmm = umm

umm = bmm

bmm = dmm

dmm = temp

#edges

temp = fum

fum = uum

uum = bdm

bdm = dum

dum = temp

temp = fdm

fdm = udm

udm = bum

bum = ddm

ddm = temp

elif pause == "m'" :

#middle

#centers

temp = dmm

dmm = bmm

bmm = umm

umm = fmm

fmm = temp

#edges

temp = dum

dum = bdm

bdm = uum

uum = fum

fum = temp

temp = ddm

ddm = bum

bum = udm

udm = fdm

fdm = temp

elif pause == "commands" :

print ( "These are the commands you can use on the cube:" )

print ( "f/f': turns the front face of the cube" )

print ( "b/b': turn the back face of the cube" )

print ( "u/u': turns the top face of the cube" )

print ( "d/d': turns the bottom face of the cube" )

print ( "r/r': turns the right face of the cube" )

print ( "l/l': turns the left face of the cube" )

print ( "y/y': rotates the entire cube like a U/U' turn" )

print ( "x/x': rotates the entire cube like an R/R' turn" )

print ( "m/m': turns the middle layer like abd L/L' turn" )

print ( "scramble: scrambles the cube" )

print ( "solve: solves the cube" )

print ( "back: goes back to cube selection" )

elif pause == "scramble" :

moves = [ "f" , "f'" , "u" , "u'" , "r" , "r'" , "l" , "l'" , "d" , "d'" , "b" , "b'" ]

scrambling = 0

while scrambling != 40 :

scramblemove = random . choice ( moves )

scrambling = scrambling + 1

print ( scramblemove )

stickers. clear ( )

if scramblemove == "f" :

#front face

#corners

temp = ful

ful = fdl

fdl = fdr

fdr = fur

fur = temp

#edges

temp = fum

fum = fml

fml = fdm

fdm = fmr

fmr = temp

#ring around

#corners

temp = udl

udl = ldr

ldr = dur

dur = rul

rul = temp

temp2 = udr

udr = lur

lur = dul

dul = rdl

rdl = temp2

#edges

temp = udm

udm = lmr

lmr = dum

dum = rml

rml = temp

elif scramblemove == "f'" :

#front face

#corners

temp = ful

ful = fur

fur = fdr

fdr = fdl

fdl = temp

#edges

temp2 = fum

fum = fmr

fmr = fdm

fdm = fml

fml = temp2

#ring around front face

#corners

temp = lur

temp2 = ldr

lur = udr

ldr = udl

udr = rdl

udl = rul

rdl = dul

rul = dur

dul = temp

dur = temp2

#edges

temp = lmr

lmr = udm

udm = rml

rml = dum

dum = temp

elif scramblemove == "u" :

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

elif scramblemove == "u'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

elif scramblemove == "r" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

elif scramblemove == "r'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

elif scramblemove == "l" :

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

elif scramblemove == "l'" :

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif scramblemove == "d" :

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif scramblemove == "d'" :

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

elif scramblemove == "b" :

#back face

#corners

temp = bul

bul = bur

bur = bdr

bdr = bdl

bdl = temp

#edges

temp = bum

bum = bmr

bmr = bdm

bdm = bml

bml = temp

#ring around layer

temp = uul

uul = rur

rur = ddr

ddr = ldl

ldl = temp

temp2 = uur

uur = rdr

rdr = ddl

ddl = lul

lul = temp2

#edges

temp = uum

uum = rmr

rmr = ddm

ddm = lml

lml = temp

elif scramblemove == "b'" :

#back face

#corners

temp = bul

bul = bdl

bdl = bdr

bdr = bur

bur = temp

#edges

temp = bum

bum = bml

bml = bdm

bdm = bmr

bmr = temp

#ring around layer

#corners

temp = uul

uul = ldl

ldl = ddr

ddr = rur

rur = temp

temp2 = uur

uur = lul

lul = ddl

ddl = rdr

rdr = temp2

#edges

temp = uum

uum = lml

lml = ddm

ddm = rmr

rmr = temp

drawcube ( )

elif pause == "solve the long way" :

scrambling = 0

if ful == red:

if fum == red:

if fur == red:

if fml == red:

if fmm == red:

if fmr == red:

if fdl == red:

if fdm == red:

if fdr == red:

#back face

if bul == orange:

if bum == orange:

if bur == orange:

if bml == orange:

if bmm == orange:

if bmr == orange:

if bdl == orange:

if bdm == orange:

if bdr == orange:

#right face

if rul == green:

if rum == green:

if rur == green:

if rml == green:

if rmm == green:

if rmr == green:

if rdl == green:

if rdm == green:

if rdr == green:

#left face

if lul == blue:

if lum == blue:

if lur == blue:

if lml == blue:

if lmm == blue:

if lmr == blue:

if ldl == blue:

if ldm == blue:

if ldr == blue:

#top face

if uul == yellow:

if uum == yellow:

if uur == yellow:

if uml == yellow:

if umm == yellow:

if umr == yellow:

if udl == yellow:

if udm == yellow:

if udr == yellow:

#bottom face

if dul == white:

if dum == white:

if dur == white:

if dml == white:

if dmm == white:

if dmr == white:

if ddl == white:

if ddm == white:

if ddr == white:

scrambling = scrambling + 1

print ( "solved" )

drawcube ( )

else :

moves = [ "f" , "f'" , "u" , "u'" , "r" , "r'" , "l" , "l'" , "d" , "d'" , "b" , "b'" ]

while scrambling != 1 :

scramblemove = random . choice ( moves )

stickers. clear ( )

if scramblemove == "f" :

#front face

#corners

temp = ful

ful = fdl

fdl = fdr

fdr = fur

fur = temp

#edges

temp = fum

fum = fml

fml = fdm

fdm = fmr

fmr = temp

#ring around

#corners

temp = udl

udl = ldr

ldr = dur

dur = rul

rul = temp

temp2 = udr

udr = lur

lur = dul

dul = rdl

rdl = temp2

#edges

temp = udm

udm = lmr

lmr = dum

dum = rml

rml = temp

elif scramblemove == "f'" :

#front face

#corners

temp = ful

ful = fur

fur = fdr

fdr = fdl

fdl = temp

#edges

temp2 = fum

fum = fmr

fmr = fdm

fdm = fml

fml = temp2

#ring around front face

#corners

temp = lur

temp2 = ldr

lur = udr

ldr = udl

udr = rdl

udl = rul

rdl = dul

rul = dur

dul = temp

dur = temp2

#edges

temp = lmr

lmr = udm

udm = rml

rml = dum

dum = temp

elif scramblemove == "u" :

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

elif scramblemove == "u'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

elif scramblemove == "r" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

elif scramblemove == "r'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

elif scramblemove == "l" :

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

elif scramblemove == "l'" :

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif scramblemove == "d" :

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif scramblemove == "d'" :

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

elif scramblemove == "b" :

#back face

#corners

temp = bul

bul = bur

bur = bdr

bdr = bdl

bdl = temp

#edges

temp = bum

bum = bmr

bmr = bdm

bdm = bml

bml = temp

#ring around layer

temp = uul

uul = rur

rur = ddr

ddr = ldl

ldl = temp

temp2 = uur

uur = rdr

rdr = ddl

ddl = lul

lul = temp2

#edges

temp = uum

uum = rmr

rmr = ddm

ddm = lml

lml = temp

elif scramblemove == "b'" :

#back face

#corners

temp = bul

bul = bdl

bdl = bdr

bdr = bur

bur = temp

#edges

temp = bum

bum = bml

bml = bdm

bdm = bmr

bmr = temp

#ring around layer

#corners

temp = uul

uul = ldl

ldl = ddr

ddr = rur

rur = temp

temp2 = uur

uur = lul

lul = ddl

ddl = rdr

rdr = temp2

#edges

temp = uum

uum = lml

lml = ddm

ddm = rmr

rmr = temp

elif pause == "back" :

stall = 0

elif pause == "move" :

drawcube ( )

drawcube ( )

elif cube == "2x2" :

#variable format (face,height,leftrightormiddle)

#front

ful = red

fum = red

fur = red

fml = red

fmm = red

fmr = red

fdl = red

fdm = red

fdr = red

#back face

bul = orange

bum = orange

bur = orange

bml = orange

bmm = orange

bmr = orange

bdl = orange

bdm = orange

bdr = orange

#right face

rul = green

rum = green

rur = green

rml = green

rmm = green

rmr = green

rdl = green

rdm = green

rdr = green

#left face

lul = blue

lum = blue

lur = blue

lml = blue

lmm = blue

lmr = blue

ldl = blue

ldm = blue

ldr = blue

#top face

uul = yellow

uum = yellow

uur = yellow

uml = yellow

umm = yellow

umr = yellow

udl = yellow

udm = yellow

udr = yellow

#bottom face

dul = white

dum = white

dur = white

dml = white

dmm = white

dmr = white

ddl = white

ddm = white

ddr = white

stickers. clear ( )

draw2x2 ( )

#2x2 turns

print ( "Type a move you would like to make then hit enter and put in the next move you would like to make" )

print ( "type commands for a list of commands you can enter" )

stall = 1

while stall == 1 :

pause = input ( "Move:" )

pause = pause. lower ( )

stickers. clear ( )

if pause == "f" :

#front face

#corners

temp = ful

ful = fdl

fdl = fdr

fdr = fur

fur = temp

#edges

temp = fum

fum = fml

fml = fdm

fdm = fmr

fmr = temp

#ring around

#corners

temp = udl

udl = ldr

ldr = dur

dur = rul

rul = temp

temp2 = udr

udr = lur

lur = dul

dul = rdl

rdl = temp2

#edges

temp = udm

udm = lmr

lmr = dum

dum = rml

rml = temp

elif pause == "f'" :

#front face

#corners

temp = ful

ful = fur

fur = fdr

fdr = fdl

fdl = temp

#edges

temp2 = fum

fum = fmr

fmr = fdm

fdm = fml

fml = temp2

#ring around front face

#corners

temp = lur

temp2 = ldr

lur = udr

ldr = udl

udr = rdl

udl = rul

rdl = dul

rul = dur

dul = temp

dur = temp2

#edges

temp = lmr

lmr = udm

udm = rml

rml = dum

dum = temp

elif pause == "u" :

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

elif pause == "u'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

elif pause == "r" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

elif pause == "r'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

elif pause == "l" :

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

elif pause == "l'" :

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif pause == "d" :

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif pause == "d'" :

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

elif pause == "b" :

#back face

#corners

temp = bul

bul = bur

bur = bdr

bdr = bdl

bdl = temp

#edges

temp = bum

bum = bmr

bmr = bdm

bdm = bml

bml = temp

#ring around layer

temp = uul

uul = rur

rur = ddr

ddr = ldl

ldl = temp

temp2 = uur

uur = rdr

rdr = ddl

ddl = lul

lul = temp2

#edges

temp = uum

uum = rmr

rmr = ddm

ddm = lml

lml = temp

elif pause == "b'" :

#back face

#corners

temp = bul

bul = bdl

bdl = bdr

bdr = bur

bur = temp

#edges

temp = bum

bum = bml

bml = bdm

bdm = bmr

bmr = temp

#ring around layer

#corners

temp = uul

uul = ldl

ldl = ddr

ddr = rur

rur = temp

temp2 = uur

uur = lul

lul = ddl

ddl = rdr

rdr = temp2

#edges

temp = uum

uum = lml

lml = ddm

ddm = rmr

rmr = temp

elif pause == "solve" :

ful = red

fum = red

fur = red

fml = red

fmm = red

fmr = red

fdl = red

fdm = red

fdr = red

#back face

bul = orange

bum = orange

bur = orange

bml = orange

bmm = orange

bmr = orange

bdl = orange

bdm = orange

bdr = orange

#right face

rul = green

rum = green

rur = green

rml = green

rmm = green

rmr = green

rdl = green

rdm = green

rdr = green

#left face

lul = blue

lum = blue

lur = blue

lml = blue

lmm = blue

lmr = blue

ldl = blue

ldm = blue

ldr = blue

#top face

uul = yellow

uum = yellow

uur = yellow

uml = yellow

umm = yellow

umr = yellow

udl = yellow

udm = yellow

udr = yellow

#bottom face

dul = white

dum = white

dur = white

dml = white

dmm = white

dmr = white

ddl = white

ddm = white

ddr = white

elif pause == "y" :

#bottom rotation

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

#top rotation

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

#middle layer rotation

temp = fml

fml = rml

rml = bmr

bmr = lml

lml = temp

temp = fmm

fmm = rmm

rmm = bmm

bmm = lmm

lmm = temp

temp = fmr

fmr = rmr

rmr = bml

bml = lmr

lmr = temp

elif pause == "y'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

#middle

#centers

temp = fmm

fmm = lmm

lmm = bmm

bmm = rmm

rmm = temp

#edges

temp = fml

fml = lml

lml = bmr

bmr = rml

rml = temp

temp = fmr

fmr = lmr

lmr = bml

bml = rmr

rmr = temp

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif pause == "x" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

#middle

#centers

temp = dmm

dmm = bmm

bmm = umm

umm = fmm

fmm = temp

#edges

temp = dum

dum = bdm

bdm = uum

uum = fum

fum = temp

temp = ddm

ddm = bum

bum = udm

udm = fdm

fdm = temp

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif pause == "x'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

#middle

#centers

temp = fmm

fmm = umm

umm = bmm

bmm = dmm

dmm = temp

#edges

temp = fum

fum = uum

uum = bdm

bdm = dum

dum = temp

temp = fdm

fdm = udm

udm = bum

bum = ddm

ddm = temp

elif pause == "commands" :

print ( "These are the commands you can use on the cube:" )

print ( "move: draws the moves that you have made" )

print ( "f/f': turns the front face of the cube" )

print ( "b/b': turn the back face of the cube" )

print ( "u/u': turns the top face of the cube" )

print ( "d/d': turns the bottom face of the cube" )

print ( "r/r': turns the right face of the cube" )

print ( "l/l': turns the left face of the cube" )

print ( "y/y': rotates the entire cube like a U/U' turn" )

print ( "x/x': rotates the entire cube like an R/R' turn" )

print ( "scramble: scrambles the cube" )

print ( "solve: solves the cube" )

print ( "back: goes back to cube selection" )

elif pause == "scramble" :

moves = [ "f" , "f'" , "u" , "u'" , "r" , "r'" , "l" , "l'" , "d" , "d'" , "b" , "b'" ]

scrambling = 0

while scrambling != 40 :

scramblemove = random . choice ( moves )

scrambling = scrambling + 1

stickers. clear ( )

draw2x2 ( )

if scramblemove == "f" :

#front face

#corners

temp = ful

ful = fdl

fdl = fdr

fdr = fur

fur = temp

#edges

temp = fum

fum = fml

fml = fdm

fdm = fmr

fmr = temp

#ring around

#corners

temp = udl

udl = ldr

ldr = dur

dur = rul

rul = temp

temp2 = udr

udr = lur

lur = dul

dul = rdl

rdl = temp2

#edges

temp = udm

udm = lmr

lmr = dum

dum = rml

rml = temp

elif scramblemove == "f'" :

#front face

#corners

temp = ful

ful = fur

fur = fdr

fdr = fdl

fdl = temp

#edges

temp2 = fum

fum = fmr

fmr = fdm

fdm = fml

fml = temp2

#ring around front face

#corners

temp = lur

temp2 = ldr

lur = udr

ldr = udl

udr = rdl

udl = rul

rdl = dul

rul = dur

dul = temp

dur = temp2

#edges

temp = lmr

lmr = udm

udm = rml

rml = dum

dum = temp

elif scramblemove == "u" :

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

elif scramblemove == "u'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

elif scramblemove == "r" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

elif scramblemove == "r'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

elif scramblemove == "l" :

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

elif scramblemove == "l'" :

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif scramblemove == "d" :

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif scramblemove == "d'" :

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

elif scramblemove == "b" :

#back face

#corners

temp = bul

bul = bur

bur = bdr

bdr = bdl

bdl = temp

#edges

temp = bum

bum = bmr

bmr = bdm

bdm = bml

bml = temp

#ring around layer

temp = uul

uul = rur

rur = ddr

ddr = ldl

ldl = temp

temp2 = uur

uur = rdr

rdr = ddl

ddl = lul

lul = temp2

#edges

temp = uum

uum = rmr

rmr = ddm

ddm = lml

lml = temp

elif scramblemove == "b'" :

#back face

#corners

temp = bul

bul = bdl

bdl = bdr

bdr = bur

bur = temp

#edges

temp = bum

bum = bml

bml = bdm

bdm = bmr

bmr = temp

#ring around layer

#corners

temp = uul

uul = ldl

ldl = ddr

ddr = rur

rur = temp

temp2 = uur

uur = lul

lul = ddl

ddl = rdr

rdr = temp2

#edges

temp = uum

uum = lml

lml = ddm

ddm = rmr

rmr = temp

elif pause == "solve the long way" :

scrambling = 0

if ful == red:

if fur == red:

if fdl == red:

if fdr == red:

if bul == orange:

if bur == orange:

if bdl == orange:

if bdr == orange:

if rul == green:

if rur == green:

if rdl == green:

if rdr == green:

if lul == blue:

if lur == blue:

if ldl == blue:

if ldr == blue:

if uul == yellow:

if uur == yellow:

if udl == yellow:

if udr == yellow:

if dul == white:

if dur == white:

if ddl == white:

if ddr == white:

scrambling = scrambling + 1

print ( "solved" )

draw2x2 ( )

else :

moves = [ "f" , "f'" , "u" , "u'" , "r" , "r'" , "l" , "l'" , "d" , "d'" , "b" , "b'" ]

while scrambling != 1 :

scramblemove = random . choice ( moves )

turnsmade = 0

turnsmade = turnsmade + 1

draw2x2 ( )

if scramblemove == "f" :

#front face

#corners

temp = ful

ful = fdl

fdl = fdr

fdr = fur

fur = temp

#edges

temp = fum

fum = fml

fml = fdm

fdm = fmr

fmr = temp

#ring around

#corners

temp = udl

udl = ldr

ldr = dur

dur = rul

rul = temp

temp2 = udr

udr = lur

lur = dul

dul = rdl

rdl = temp2

#edges

temp = udm

udm = lmr

lmr = dum

dum = rml

rml = temp

elif scramblemove == "f'" :

#front face

#corners

temp = ful

ful = fur

fur = fdr

fdr = fdl

fdl = temp

#edges

temp2 = fum

fum = fmr

fmr = fdm

fdm = fml

fml = temp2

#ring around front face

#corners

temp = lur

temp2 = ldr

lur = udr

ldr = udl

udr = rdl

udl = rul

rdl = dul

rul = dur

dul = temp

dur = temp2

#edges

temp = lmr

lmr = udm

udm = rml

rml = dum

dum = temp

elif scramblemove == "u" :

#top face turn

#corners

temp = uul

uul = udl

udl = udr

udr = uur

uur = temp

#edges

temp = uml

uml = udm

udm = umr

umr = uum

uum = temp

#ring around top

#corners

temp = lul

lul = ful

ful = rul

rul = bur

bur = temp

temp2 = lur

lur = fur

fur = rur

rur = bul

bul = temp2

#edges

temp = lum

lum = fum

fum = rum

rum = bum

bum = temp

elif scramblemove == "u'" :

#top face

temp = uul

uul = uur

uur = udr

udr = udl

udl = temp

temp = uum

uum = umr

umr = udm

udm = uml

uml = temp

#ring around top

#corners

temp = lul

lul = bur

bur = rul

rul = ful

ful = temp

temp2 = lur

lur = bul

bul = rur

rur = fur

fur = temp2

#edges

temp = lum

lum = bum

bum = rum

rum = fum

fum = temp

elif scramblemove == "r" :

#right face

temp = rul

rul = rdl

rdl = rdr

rdr = rur

rur = temp

temp = rml

rml = rdm

rdm = rmr

rmr = rum

rum = temp

#ring around right face

temp = fur

fur = dur

dur = bdr

bdr = uur

uur = temp

temp2 = fdr

fdr = ddr

ddr = bur

bur = udr

udr = temp2

temp = fmr

fmr = dmr

dmr = bmr

bmr = umr

umr = temp

elif scramblemove == "r'" :

#right face

temp = rul

rul = rur

rur = rdr

rdr = rdl

rdl = temp

temp = rml

rml = rum

rum = rmr

rmr = rdm

rdm = temp

#ring around face

temp = fur

fur = uur

uur = bdr

bdr = dur

dur = temp

temp2 = fdr

fdr = udr

udr = bur

bur = ddr

ddr = temp2

temp = fmr

fmr = umr

umr = bmr

bmr = dmr

dmr = temp

elif scramblemove == "l" :

#left face

#corners

temp = lul

lul = ldl

ldl = ldr

ldr = lur

lur = temp

#edges

temp = lum

lum = lml

lml = ldm

ldm = lmr

lmr = temp

#ring around left side

temp = ful

ful = uul

uul = bdl

bdl = dul

dul = temp

temp2 = fdl

fdl = udl

udl = bul

bul = ddl

ddl = temp2

#edges

temp = fml

fml = uml

uml = bml

bml = dml

dml = temp

elif scramblemove == "l'" :

#left face

#corners

temp = lul

lul = lur

lur = ldr

ldr = ldl

ldl = temp

#edges

temp = lum

lum = lmr

lmr = ldm

ldm = lml

lml = temp

#ring around

#corners

temp = ful

ful = dul

dul = bdl

bdl = uul

uul = temp

temp2 = fdl

fdl = ddl

ddl = bul

bul = udl

udl = temp2

#edges

temp = fml

fml = dml

dml = bml

bml = uml

uml = temp

elif scramblemove == "d" :

#bottom face

#corners

temp = dul

dul = ddl

ddl = ddr

ddr = dur

dur = temp

#edges

temp = dum

dum = dml

dml = ddm

ddm = dmr

dmr = temp

#ring around layer

#corners

temp = fdl

fdl = ldl

ldl = bdr

bdr = rdl

rdl = temp

temp2 = fdr

fdr = ldr

ldr = bdl

bdl = rdr

rdr = temp2

#edges

temp = fdm

fdm = ldm

ldm = bdm

bdm = rdm

rdm = temp

elif scramblemove == "d'" :

#bottom face

#corners

temp = dul

dul = dur

dur = ddr

ddr = ddl

ddl = temp

#edges

temp = dum

dum = dmr

dmr = ddm

ddm = dml

dml = temp

#ring around layer

#corners

temp = fdl

fdl = rdl

rdl = bdr

bdr = ldl

ldl = temp

temp2 = fdr

fdr = rdr

rdr = bdl

bdl = ldr

ldr = temp2

#edges

temp = fdm

fdm = rdm

rdm = bdm

bdm = ldm

ldm = temp

elif scramblemove == "b" :

#back face

#corners

temp = bul

bul = bur

bur = bdr

bdr = bdl

bdl = temp

#edges

temp = bum

bum = bmr

bmr = bdm

bdm = bml

bml = temp

#ring around layer

temp = uul

uul = rur

rur = ddr

ddr = ldl

ldl = temp

temp2 = uur

uur = rdr

rdr = ddl

ddl = lul

lul = temp2

#edges

temp = uum

uum = rmr

rmr = ddm

ddm = lml

lml = temp

elif scramblemove == "b'" :

#back face

#corners

temp = bul

bul = bdl

bdl = bdr

bdr = bur

bur = temp

#edges

temp = bum

bum = bml

bml = bdm

bdm = bmr

bmr = temp

#ring around layer

#corners

temp = uul

uul = ldl

ldl = ddr

ddr = rur

rur = temp

temp2 = uur

uur = lul

lul = ddl

ddl = rdr

rdr = temp2

#edges

temp = uum

uum = lml

lml = ddm

ddm = rmr

rmr = temp

elif pause == "back" :

stall = 0

draw2x2 ( )

draw2x2 ( )