Question: Why not use the numbers that correspond directly to the OS color codes? Then you won't have to do any sort of translation. For example, 10 is blue, 11 is red, 12 is black, and so on.
I just picked those randomly, but I've already done enough code it's either too late to fix it or it would take a while to fix it. I should've used 10, 11, 12, etc, you're right.

I will post the code/upload a beta as work goes on. As of right now it just sets up the variables.
*BUMP* Well, I've managed to get some stuff done! Here is what I have so far:
SourceCoder 3 (RUBIKEMU) wrote:
::"33333333333333333222238888355553322223888835555332222388883555533222238888355553333333333333333336666322223BBBB336666322223BBBB336666322223BBBB336666322223BBBB33333333333333333366663AAAA311113366663AAAA311113366663AAAA311113366663AAAA3111133333333333333333
:// 222
:// 222
:// 222
://555333444666
://555333444666
://555333444666
:// 111
:// 111
:// 111
://red(1) 0 248 orange(2) 32 253 yellow(3) 224 255 green(4) 0 4 blue(5) 31 0 white(6) 255 255
://123
://456
://789
://det(12,FG_LO,FG_HI,BG_LO,BG_HI
:ClrHome
:1->S
:69->dim(|LRUBIK)
:{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,2,2,2,2,2,2,2,2,2,0,3,3,3,3,3,3,3,3,3,0,4,4,4,4,4,4,4,4,4,0,5,5,5,5,5,5,5,5,5,0,6,6,6,6,6,6,6,6,6}->|LRUBIK
:Lbl A
:If S=0
:6->S
:If S=7
:1->S
:If S=1
:Goto 1
:If S=2
:Goto 2
:If S=3
:Goto 3
:If S=4
:Goto 4
:If S=5
:Goto 5
:If S=6
:Goto 6
:Lbl 1
:|LRUBIK(11)->A
:|LRUBIK(12)->B
:|LRUBIK(13)->C
:|LRUBIK(14)->D
:|LRUBIK(15)->E
:|LRUBIK(16)->F
:|LRUBIK(17)->G
:|LRUBIK(18)->H
:|LRUBIK(19)->I
:Goto 7
:Lbl 2
:|LRUBIK(21)->A
:|LRUBIK(22)->B
:|LRUBIK(23)->C
:|LRUBIK(24)->D
:|LRUBIK(25)->E
:|LRUBIK(26)->F
:|LRUBIK(27)->G
:|LRUBIK(28)->H
:|LRUBIK(29)->I
:Goto 7
:Lbl 3
:|LRUBIK(31)->A
:|LRUBIK(32)->B
:|LRUBIK(33)->C
:|LRUBIK(34)->D
:|LRUBIK(35)->E
:|LRUBIK(36)->F
:|LRUBIK(37)->G
:|LRUBIK(38)->H
:|LRUBIK(39)->I
:Goto 7
:Lbl 4
:|LRUBIK(41)->A
:|LRUBIK(42)->B
:|LRUBIK(43)->C
:|LRUBIK(44)->D
:|LRUBIK(45)->E
:|LRUBIK(46)->F
:|LRUBIK(47)->G
:|LRUBIK(48)->H
:|LRUBIK(49)->I
:Goto 7
:Lbl 5
:|LRUBIK(51)->A
:|LRUBIK(52)->B
:|LRUBIK(53)->C
:|LRUBIK(54)->D
:|LRUBIK(55)->E
:|LRUBIK(56)->F
:|LRUBIK(57)->G
:|LRUBIK(58)->H
:|LRUBIK(59)->I
:Goto 7
:Lbl 6
:|LRUBIK(61)->A
:|LRUBIK(62)->B
:|LRUBIK(63)->C
:|LRUBIK(64)->D
:|LRUBIK(65)->E
:|LRUBIK(66)->F
:|LRUBIK(67)->G
:|LRUBIK(68)->H
:|LRUBIK(69)->I
:Lbl 7
:If A=1
:Then
:0->J
:248->K
:End
:If A=2
:Then
:32->J
:253->K
:End
:If A=3
:Then
:224->J
:255->K
:End
:If A=4
:Then
:0->J
:4->K
:End
:If A=5
:Then
:31->J
:0->K
:End
:If A=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(1,1,"*
:If B=1
:Then
:0->J
:248->K
:End
:If B=2
:Then
:32->J
:253->K
:End
:If B=3
:Then
:224->J
:255->K
:End
:If B=4
:Then
:0->J
:4->K
:End
:If B=5
:Then
:31->J
:0->K
:End
:If B=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(1,2,"*
:If C=1
:Then
:0->J
:248->K
:End
:If C=2
:Then
:32->J
:253->K
:End
:If C=3
:Then
:224->J
:255->K
:End
:If C=4
:Then
:0->J
:4->K
:End
:If C=5
:Then
:31->J
:0->K
:End
:If C=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(1,3,"*
:If D=1
:Then
:0->J
:248->K
:End
:If D=2
:Then
:32->J
:253->K
:End
:If D=3
:Then
:224->J
:255->K
:End
:If D=4
:Then
:0->J
:4->K
:End
:If D=5
:Then
:31->J
:0->K
:End
:If D=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(2,1,"*
:If E=1
:Then
:0->J
:248->K
:End
:If E=2
:Then
:32->J
:253->K
:End
:If E=3
:Then
:224->J
:255->K
:End
:If E=4
:Then
:0->J
:4->K
:End
:If E=5
:Then
:31->J
:0->K
:End
:If E=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(2,2,"*
:If F=1
:Then
:0->J
:248->K
:End
:If F=2
:Then
:32->J
:253->K
:End
:If F=3
:Then
:224->J
:255->K
:End
:If F=4
:Then
:0->J
:4->K
:End
:If F=5
:Then
:31->J
:0->K
:End
:If F=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(2,3,"*
:If G=1
:Then
:0->J
:248->K
:End
:If G=2
:Then
:32->J
:253->K
:End
:If G=3
:Then
:224->J
:255->K
:End
:If G=4
:Then
:0->J
:4->K
:End
:If G=5
:Then
:31->J
:0->K
:End
:If G=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(3,1,"*
:If H=1
:Then
:0->J
:248->K
:End
:If H=2
:Then
:32->J
:253->K
:End
:If H=3
:Then
:224->J
:255->K
:End
:If H=4
:Then
:0->J
:4->K
:End
:If H=5
:Then
:31->J
:0->K
:End
:If H=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(3,2,"*
:If I=1
:Then
:0->J
:248->K
:End
:If I=2
:Then
:32->J
:253->K
:End
:If I=3
:Then
:224->J
:255->K
:End
:If I=4
:Then
:0->J
:4->K
:End
:If I=5
:Then
:31->J
:0->K
:End
:If I=6
:Then
:255->J
:255->K
:End
:det(12,J,K,255,255
:Output(3,3,"*

TODO:
Add "status bar" that tells user what side they are viewing
Add loops to make program smaller/faster
Add controls to manipulate cube
-----
Suggestions, comments?
*bump*
-----Update!-----
Added status bar
You can view multiple sides of the cube, not just 1
TODO:
Add auto-scrambler?
Add turning of sides
Add save or new game menu
Stopwatch?
-----
Auto scrambler: Might be possible by generating random moves and off-screen manipulating the cube.
-----
Stopwatch: Is there a stopwatch on here or ticalc or do I need to make my own?
-----
Edit: Source code so far: http://pastebin.com/HELDtMgX
Suggestions, comments?
You can use the timer functions that the calculator includes, namely startTmr and checkTmr:


Code:
:ClockOn
:startTmr->T
:// Code to be timed
:Disp checkTmr(T
Why not change:

Code:
{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,2,2,2,2,2,2,2,2,2,0,3,3,3,3,3,3,3,3,3,0,4,4,4,4,4,4,4,4,4,0,5,5,5,5,5,5,5,5,5,0,6,6,6,6,6,6,6,6,6}->|LRUBIK
to


Code:
For(A,0,6
For(B,1,9
A→ʟRUBIK(9(A-1)+B
End:End
Because I do not know how to use For(
Thanks, gaventemples31415.
To let you know, tibasicdev.wikidot.com has a very good index of commands. Here is the page for For(

EDIT: Sorry, that was the wrong link. I just updated it.
For(var,startvalue,endvalue(,increasebyvalue)

For(F,1,5
End

Will count and store to F 1-5

For(F,1,6,2
End

Will count 1,3,5 and store to F for each loop.

If increasebyvalue isn't set, it defaults to 1. And yes, you can default negative values, as well.

Edit:

Also, here are some other things you should do. Instead of having it go to a Lbl and doing all that storing, why not take all that storing bit, and do something like


Code:
:If S=1:Then
:|LRUBIK(11)->A
:|LRUBIK(12)->B
:|LRUBIK(13)->C
:|LRUBIK(14)->D
:|LRUBIK(15)->E
:|LRUBIK(16)->F
:|LRUBIK(17)->G
:|LRUBIK(18)->H
:|LRUBIK(19)->I
:End


This will eliminate all those Gotos and Lbls, you can then get rid of the need for Lbl 7.

The reasoning behind this is, any time Goto is hit, the processor reinitializes the program, which makes it start at the top and scroll down until it finds the correct Lbl. (as per what Kerm said when tracking bugs a while back) Getting rid of the lbl and goto statements will speed your program up significantly.

Another tip: After the If S=#:Then:End bits, simply DelVar J and K, then only store the value to the affected variables as needed. This will shave off considerable 'weight' of the program, and even reduce some of those conditionals to just being If conditionals, instead of being If:Then:End ones.
Thanks for all the help, tifreak8x, gaventemples31415, and KermMartian. I expect this program to be done soon.
-----
Oh no! I lost the location of my CSE ROM, so I have to redownload it. I will do that the next time I have access to a Windows computer (probably at the library) This means I can not do more work on this until I get it. Sorry!
Edit: I found it. Heh heh...
*bump*
So I only have 1 major thing to add: rotating sides. The way I was planning to do this was making a list of the side and rotate it. Is there an easy way to rotate a 3x3 list/matrix? The rest should be easy.
-----
Note to self:
KermM's stopwatch
Menu - If new, add "new" list - If load, no - If scramble, add "new" list then random moves
-----
Suggestions, comments?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement