• Welcome to SpeedSolving.com — the world’s largest puzzle community!

    You’re currently browsing as a guest, which means you have limited access to discussions, resources, member profiles, and community features.

    Join 50,000+ cubers and puzzle enthusiasts from around the world to ask questions, share solves, improve faster, and be part of the community.

    Registration is free, fast, and easy — create your account today.

    Already a member? Log in here to hide this message and start participating.

Python Cube Project

I gave every position a 'sticker' could go a number 1-54
Get used to zero indexing ASAP; it'll save you a lot of pain when using pretty much any mainstream programming language other than Lua.

Instead of: 1 to 54
Try: 0 to 53
 
Oh, this is cool!
Last semester for my python class I made a virtual cube in thonny->tkinter as my final project.
It looks like you already have enough more experienced people helping you out, but I can post my code if you want to look at it. It's kind of really long.
 
Oh, this is cool!
Last semester for my python class I made a virtual cube in thonny->tkinter as my final project.
It looks like you already have enough more experienced people helping you out, but I can post my code if you want to look at it. It's kind of really long.
That would be cool, but I think I'm good for now, I think visuals are a bit beyond my pyhton knowledge.
 
Do you guys think I should change my move format to a list of tuples instead of two lists? Then it might look a little cleaner, and making moves might be easier. Plus in the process I can switch to zero indexing. I think if I keep working at it and I don't hit any really nasty bugs then I should be able to start making AI and taking ideas fairly quickly. (Also @Cubinwitdapizza am I allowed to bump my own threads as a pizzabumper?)
 
Do you guys think I should change my move format to a list of tuples instead of two lists? Then it might look a little cleaner, and making moves might be easier. Plus in the process I can switch to zero indexing. I think if I keep working at it and I don't hit any really nasty bugs then I should be able to start making AI and taking ideas fairly quickly. (Also @Cubinwitdapizza am I allowed to bump my own threads as a pizzabumper?)
Aren't tuples immutable?
 
They can't be changed, but I don't need to change them. I'd just need them to make something like R=Move([list of tuples])
then R would be a constant.
Then wouldn't you have to make a new constant for every move in an alg?
 
Then wouldn't you have to make a new constant for every move in an alg?
Nope. I'm planning to have it as a module, so then I can just do something like:
Code:
import EtotheipiCube as ec
R=ec.R
U=ec.U
sequence1=[R,U,R,U]
sequence2=[U,R,U]
And I only have to make 3 different moves manually, because you can make all moves with just x, y, and R.
 
Won't it make it faster to just manually do all moves?
No. Here's my R code, doing it 10 times over manually wouldn't be all that fun.
Code:
R = Move([3, 6, 9, 21, 24, 27, 12, 15, 18, 43, 40, 37, 28, 30, 36, 34, 29, 33, 35, 31],
         [43, 40, 37, 3, 6, 9, 21, 24, 27, 12, 15, 18, 30, 36, 34, 28, 33, 35, 31, 29])
But with a combination of moves, once I have x, y, and R, I can just say L is y2 R y2. Way easier.
 
No. Here's my R code, doing it 10 times over manually wouldn't be all that fun.
Code:
R = Move([3, 6, 9, 21, 24, 27, 12, 15, 18, 43, 40, 37, 28, 30, 36, 34, 29, 33, 35, 31],
         [43, 40, 37, 3, 6, 9, 21, 24, 27, 12, 15, 18, 30, 36, 34, 28, 33, 35, 31, 29])
But with a combination of moves, once I have x, y, and R, I can just say L is y2 R y2. Way easier.
Sorry I meant it would run faster. Would be a nightmare to code, though
 
Sorry I meant it would run faster. Would be a nightmare to code, though
Ok, I was wondering if you meant that. I don't think it will have that much impact, because I have a function that takes a list of moves, and turns it into a single move object, so I can just have that run on the module startup and it will be the same speed as the other manually coded moves.
 
Update: I have now reprogrammed the move format so its a little bit nicer to manually code in moves, and its nicer to use in general. Basically I merged the pre indices and post indices lists into a single indices list. And while doing so i switched to zero indexing. Ima keep on working at it.
 
Did you switch to tuples?
Yes. It makes it a bit easier to understand, heres my old code for R:
Code:
 R = Move([3, 6, 9, 21, 24, 27, 12, 15, 18, 43, 40, 37, 28, 30, 36, 34, 29, 33, 35, 31],[43, 40, 37, 3, 6, 9, 21, 24, 27, 12, 15, 18, 30, 36, 34, 28, 33, 35, 31, 29])
And heres my new:
Code:
R=Move([(8,36),(5,39),(2,42),(36,17),(39,14),(42,11),(17,26),(14,23),(11,20),(26,8),(23,5),(20,2),(27,29),(29,35),(35,33),(33,27),(28,32),(32,34),(34,30),(30,28)])
 
Back
Top