'Program By cvmarus 11-13-18
TextWindow.WriteLine("Virtual Rubix Cube")
Sub savefile
' The following line could be harmful and has been automatically commented.
' File.WriteContents(filename,filedat)
EndSub
Sub loadfile
' The following line could be harmful and has been automatically commented.
' filedat = File.ReadContents(filename)
EndSub
' The following line could be harmful and has been automatically commented.
' If LDFile.Exists(Program.Directory+"/block.obj") = "False" Then
makeblock()
filename = Program.Directory+"/block.obj"
filedat = tmp1
savefile()
EndIf
Sub loadcube
filename = LDDialogs.OpenFile("rbx",Program.Directory)
' The following line could be harmful and has been automatically commented.
' If LDFile.Exists(filename) Then
loadfile()
filedat = LDText.Split(filedat,":")
For cnum = 1 To 27
i = 12*cnum-12
For ii = 1 To 3
pos[ii] = filedat[i+ii]
xaxis[cnum][ii] = filedat[i+ii+3]
yaxis[cnum][ii] = filedat[i+ii+6]
zaxis[cnum][ii] = filedat[i+ii+9]
EndFor
LD3DView.TranslateGeometry(view3d,cube[cnum],pos[1],pos[2],pos[3])
cfn = cnum
axisfind = xaxis[cfn][1]+":"+xaxis[cfn][2]+":"+xaxis[cfn][3]+":"+yaxis[cfn][1]+":"+yaxis[cfn][2]+":"+yaxis[cfn][3]+":"+zaxis[cfn][1]+":"+zaxis[cfn][2]+":"+zaxis[cfn][3]+":"
matchamt = LDArray.Search(cdat,axisfind,match)
skinindex[cfn] = (LDArray.GetValue(match,1)+1)/2
LD3DView.SetCentre(view3d,cube[cfn],-pos[1],-pos[2],-pos[3],"R1R2R3")
LD3DView.TranslateGeometry(view3d,cube[cfn],pos[1],pos[2],pos[3])
LD3DView.ResetMaterial(view3d,cube[cfn],"Black","D")
LD3DView.AddImage(view3d,cube[cfn],"",skin[skinindex[cfn]],"E")
EndFor
EndIf
EndSub
var()
buildskins()
var2()
view3d = LD3DView.AddView(gw,gh,"False")
background()
GraphicsWindow.Title = "Virtual Rubix Cube"
'test
'LD3DView.AutoControl("True","True",100,1)
LD3DView.AddAmbientLight(view3d,"White")
LDTimer.Tick = onldtimer
randtimer = LDTimer.Add()
LDTimer.Interval(randtimer,200)
LDTimer.Pause(randtimer)
playtimer = LDTimer.Add()
LDTimer.Interval(playtimer,400)
LDTimer.Pause(playtimer)
orbittimer = LDTimer.Add()
LDTimer.Interval(orbittimer,15)
LDTimer.Pause(orbittimer)
verttimer = LDTimer.Add()
LDTimer.Interval(verttimer,15)
LDTimer.Pause(verttimer)
LD3DView.TranslationCompleted = ontransdone
LD3DView.RotationCompleted = onrotatedone
GraphicsWindow.KeyUp = onkeyup
Controls.ButtonClicked = onbutton
GraphicsWindow.MouseMove = onmousemove
GraphicsWindow.MouseDown = onmousedown
GraphicsWindow.MouseUp = onmouseup
LDControls.RichTextBoxFontBackground = "PaleGoldenrod"
LDControls.RichTextBoxFontForeground = "Black"
LDControls.RichTextBoxFontSize=16
LDControls.RichTextBoxMargins(40,40,25,25)
helpbox = LDControls.AddRichTextBox(gw*.7,gh*.86)
LDControls.RichTextBoxDefault(helpbox)
Controls.Move(helpbox,gw*.15,gh*.08)
Controls.HideControl(helpbox)
helpdata()
cube = LD3DView.LoadModel(view3d,Program.Directory+"/block.obj")
LD3DView.ResetMaterial(view3d,cube[1],"Black","D")
LD3DView.AddImage(view3d,cube[1],"",skin[24],"E")
LD3DView.TranslateGeometry(view3d,cube[1],2,2,2)
LD3DView.SetCentre(view3d,cube[1],-2,-2,-2,"R1R2R3S")
addcubes()
camtug = LD3DView.AddCube(view3d,.5,"Yellow","D")
camtug2 = LD3DView.CloneObject(view3d,camtug)
LD3DView.TranslateGeometry(view3d,camtug,12,12,12)
LD3DView.TranslateGeometry(view3d,camtug2,100,12,100)
LD3DView.SetCentre(view3d,camtug,-12,-12,-12,"R1R2R3")
LDControls.ListBoxItemChanged = OnListBoxItemChanged
setupclickcubes()
makearrows()
setuplistboxes()
loadalgdata()
clist[1] = 1
LDCall.Function3("rotmatrix2",0,xv,clist)
findaxisdat()
cubeaction = "False"
LDCall.Function2("setorbit",1,-1)
Sub onbutton
but = Controls.LastClickedButton
If but = helpclose Then
Controls.HideControl(helpbox)
Controls.HideControl(helpclose)
For i = Text.GetSubTextToEnd(firstarrow,6) To Text.GetSubTextToEnd(lastarrow,6)
Shapes.ShowShape("Image"+i)
Endfor
EndIf
EndSub
Sub onldtimer
timername = LDTimer.LastTimer
If timername = playtimer Then
playalgorithm()
EndIf
If timername = randtimer Then
randomizer()
EndIf
If timername = orbittimer Then
orbitcamera()
EndIf
If timername = verttimer Then
vertcamera()
EndIf
EndSub
Sub turncube
sign = args[1] 'dir
xyzcmd = args[2] 'axis x y z pos neg
If cubeaction = "False" Then
If xyzcmd = "xpos" Then
LDCall.Function3("rotmatrix2",sign,xv,LDCall.Function("getcubelist",LDVector.Multiply(xv,sign))) 'direction, vector getcubelist vector needs minus work
ElseIf xyzcmd = "xneg" then
LDCall.Function3("rotmatrix2",-sign,xv,LDCall.Function("getcubelist",LDVector.Multiply(xv,sign)))
elseif xyzcmd = "ypos" then
LDCall.Function3("rotmatrix2",sign,yv,LDCall.Function("getcubelist",LDVector.Multiply(yv,sign)))
elseif xyzcmd = "yneg" then
LDCall.Function3("rotmatrix2",-sign,yv,LDCall.Function("getcubelist",LDVector.Multiply(yv,sign)))
elseif xyzcmd = "zpos" then
LDCall.Function3("rotmatrix2",sign,zv,LDCall.Function("getcubelist",LDVector.Multiply(zv,sign)))
elseif xyzcmd = "zneg" then
LDCall.Function3("rotmatrix2",-sign,zv,LDCall.Function("getcubelist",LDVector.Multiply(zv,sign)))
EndIf
findaxisdat()
EndIf
EndSub
Sub findaxisdat
For f1 = 1 To 9
cfn = clist[f1]
axisfind = xaxis[cfn][1]+":"+xaxis[cfn][2]+":"+xaxis[cfn][3]+":"+yaxis[cfn][1]+":"+yaxis[cfn][2]+":"+yaxis[cfn][3]+":"+zaxis[cfn][1]+":"+zaxis[cfn][2]+":"+zaxis[cfn][3]+":"
matchamt = LDArray.Search(cdat,axisfind,match)
skinindex[f1] = (LDArray.GetValue(match,1)+1)/2
EndFor
EndSub
Sub getcubelist
cside = args[1]
clist = ""
c2 = 1
If cside[1] <> 0 Then
c1 = 1
ElseIf cside[2] <> 0 then
c1 = 2
elseif cside[3] <> 0 then
c1 = 3
EndIf
If cside[c1] > 0 Then
For i2 = 1 To 27
pos2 = LD3DView.GetPosition(view3d,cube[i2])
If pos2[c1] > 1 Then
clist[c2] = i2
c2 = c2 + 1
EndIf
EndFor
ElseIf cside[c1] < 0 then
For i2 = 1 To 27
pos2 = LD3DView.GetPosition(view3d,cube[i2])
If pos2[c1] < -1 Then
clist[c2] = i2
c2 = c2 + 1
EndIf
EndFor
EndIf
return = clist
EndSub
sub rotmatrix2
cid = args[3] 'nine cube id's
rotvec = args[2]
dir = args[1]
For i = 1 To Array.GetItemCount(cid)
cnum = cid[i]
xaxis[cnum] = LDVector.Rotate(xaxis[cnum],rotvec,90*dir)
yaxis[cnum] = LDVector.Rotate(yaxis[cnum],rotvec,90*dir)
zaxis[cnum] = LDVector.Rotate(zaxis[cnum],rotvec,90*dir)
For i1 = 1 To 3
xaxis[cnum][i1] = LDMath.FixDecimal(xaxis[cnum][i1],0)
yaxis[cnum][i1] = LDMath.FixDecimal(yaxis[cnum][i1],0)
zaxis[cnum][i1] = LDMath.FixDecimal(zaxis[cnum][i1],0)
EndFor
LD3DView.AnimateRotation(view3d,cube[cnum],rotvec[1],rotvec[2],rotvec[3],0,90*dir,dur,1)
EndFor
cubeaction = "True"
EndSub
Sub onrotatedone
If LD3DView.LastRotationCompleted = cube[clist[9]] Then
For ir = 1 To 9
crn = clist[ir] 'cube number
pos = LD3DView.GetPosition(view3d,cube[crn])
LD3DView.RotateGeometry2(view3d,cube[crn],rotvec[1],rotvec[2],rotvec[3],0)
LD3DView.SetCentre(view3d,cube[crn],-pos[1],-pos[2],-pos[3],"R1R2R3")
LD3DView.TranslateGeometry(view3d,cube[crn],pos[1],pos[2],pos[3])
LD3DView.ResetMaterial(view3d,cube[crn],"Black","D")
LD3DView.AddImage(view3d,cube[crn],"",skin[skinindex[ir]],"E")
EndFor
cubeaction = "False"
EndIf
If LD3DView.LastRotationCompleted = camtug Then
LDTimer.Pause(orbittimer)
orbitcamera()
cubeaction = "False"
EndIf
EndSub
Sub addcubes
If listitem = "" Then
For i = 2 To 27
cube[i] = LD3DView.CloneObject(view3d,cube[1])
EndFor
EndIf
i=27
For z1 = -2 To 2 Step 2
For y1 = -2 To 2 Step 2
For x1 = -2 To 2 Step 2
LD3DView.TranslateGeometry(view3d,cube[i],x1,y1,z1)
pos = LD3DView.GetPosition(view3d,cube[i])
LD3DView.SetCentre(view3d,cube[i],-pos[1],-pos[2],-pos[3],"R1R2R3")
xaxis[i] = xvec
yaxis[i] = yvec
zaxis[i] = zvec
i=i-1
EndFor
EndFor
EndFor
EndSub
Sub onmousedown
If Mouse.IsLeftButtonDown Then
msx = LDGraphicsWindow.MouseX
msy = LDGraphicsWindow.MouseY
hit = LD3DView.HitTest(view3d,msx,msy)
If recordstate = "True" Then
record = record+"Left"+":"+LDMath.FixDecimal(Mouse.MouseX/gw,3)+":"+LDMath.FixDecimal(Mouse.MouseY/gh,3)+":"
EndIf
If hit[1] = cube[13] or hit[1] = rdcube Then
LDCall.Function2("turncube",1,"xpos")
ElseIf hit[1] = cube[15] or hit[1] = orcube Then
LDCall.Function2("turncube",-1,"xpos")
ElseIf hit[1] = cube[11] or hit[1] = whcube Then
LDCall.Function2("turncube",1,"ypos")
ElseIf hit[1] = cube[17] or hit[1] = yecube Then
LDCall.Function2("turncube",-1,"ypos")
ElseIf hit[1] = cube[5] or hit[1] = grcube Then
LDCall.Function2("turncube",1,"zpos")
ElseIf hit[1] = cube[23] or hit[1] = blcube Then
LDCall.Function2("turncube",-1,"zpos")
ElseIf hit[1] = box then
mousetracking = "False"
Controls.HideControl(algbox)
Controls.HideControl(listbox)
clueshapesoff()
algpic = 0
EndIf
EndIf
If Mouse.IsRightButtonDown Then
msx = LDGraphicsWindow.MouseX
msy = LDGraphicsWindow.MouseY
hit = LD3DView.HitTest(view3d,msx,msy)
If recordstate = "True" Then
record = record+"Right"+":"+LDMath.FixDecimal(Mouse.MouseX/gw,3)+":"+LDMath.FixDecimal(Mouse.MouseY/gh,3)+":"
EndIf
If hit[1] = cube[13] or hit[1] = rdcube Then
LDCall.Function2("turncube",1,"xneg")
ElseIf hit[1] = cube[15] or hit[1] = orcube Then
LDCall.Function2("turncube",-1,"xneg")
ElseIf hit[1] = cube[11] or hit[1] = whcube Then
LDCall.Function2("turncube",1,"yneg")
ElseIf hit[1] = cube[17] or hit[1] = yecube Then
LDCall.Function2("turncube",-1,"yneg")
ElseIf hit[1] = cube[5] or hit[1] = grcube Then
LDCall.Function2("turncube",1,"zneg")
ElseIf hit[1] = cube[23] or hit[1] = blcube Then
LDCall.Function2("turncube",-1,"zneg")
ElseIf hit[1] = box then
mousetracking = "False"
Controls.Move(listbox,LDGraphicsWindow.MouseX,LDGraphicsWindow.MouseY)
Controls.ShowControl(listbox)
EndIf
EndIf
EndSub
Sub onkeyup
key = GraphicsWindow.LastKey
If key = "A" Then
lp[1] = LDMath.FixDecimal(LDGraphicsWindow.MouseX/gw,3)
lp[2] = LDMath.FixDecimal(LDGraphicsWindow.Mousey/gh,3)
EndIf
If key = "B" Then
Shapes.ShowShape(line[1])
Shapes.ShowShape(line[2])
Shapes.ShowShape(line[3])
lp[3] = LDMath.FixDecimal(LDGraphicsWindow.MouseX/gw,3)
lp[4] = LDMath.FixDecimal(LDGraphicsWindow.Mousey/gh,3)
LDShapes.MoveLine(line[1],lp[1]*gw,lp[2]*gh,lp[3]*gw,lp[4]*gh)
lprad = LDMath.Convert2Radial(lp[3]*gw,lp[4]*gh,lp[1]*gw,lp[2]*gh)
lp2 = LDMath.Convert2Cartesian(lp[3]*gw,lp[4]*gh,gw*.03,lprad[2]+30)
LDShapes.MoveLine(line[2],lp2[1],lp2[2],lp[3]*gw,lp[4]*gh)
lp2 = LDMath.Convert2Cartesian(lp[3]*gw,lp[4]*gh,gw*.03,lprad[2]-30)
LDShapes.MoveLine(line[3],lp2[1],lp2[2],lp[3]*gw,lp[4]*gh)
LDClipboard.SetText(lp[1]+":"+lp[2]+":"+lp[3]+":"+lp[4]+":")
EndIf
If key = "L" Then
Shapes.ShowShape(line[1])
lp[3] = LDMath.FixDecimal(LDGraphicsWindow.MouseX/gw,3)
lp[4] = LDMath.FixDecimal(LDGraphicsWindow.Mousey/gh,3)
LDShapes.MoveLine(line[1],lp[1]*gw,lp[2]*gh,lp[3]*gw,lp[4]*gh)
LDClipboard.SetText(-lp[1]+":"+lp[2]+":"+lp[3]+":"+lp[4]+":")
EndIf
If key = "R" Then
record = ""
recordstate = "True"
EndIf
If key = "S" Then
LDClipboard.SetText(record)
recordstate = "False"
EndIf
EndSub
Sub tempbackground
hue = ""
hue[1] = "White"
hue[2] = "Yellow"
hue[3] = "Green"
hue[4] = "Blue"
hue[5] = "Orange"
hue[6] = "Red"
For i = 1 To 6
hue[i] = LDColours.SetOpacity(hue[i],50)
EndFor
i = 1
For xt = 1 To gw Step gw/18
For yt = 1 To gh Step gh/12
GraphicsWindow.BrushColor = hue[i]
GraphicsWindow.PenColor = "Black"
GraphicsWindow.PenWidth = 3
GraphicsWindow.FillRectangle(xt,yt,gw/18,gh/12)
GraphicsWindow.DrawRectangle(xt,yt,gw/18,gh/12)
i = i + 1
If i > 6 Then
i=1
EndIf
EndFor
i = i + 2
If i > 6 Then
i=1
EndIf
EndFor
EndSub
Sub background
pen = GraphicsWindow.PenColor
bbrush = GraphicsWindow.BrushColor
hue = ""
hue[1] = "#666666"
hue[2] = "Yellow"
hue[3] = "Green"
hue[4] = "Blue"
hue[5] = "Orange"
hue[6] = "Red"
For i = 1 To 6
hue[i] = LDColours.SetOpacity(hue[i],75)
EndFor
For i = 6 To 18 Step 6
For ii = 1 To 6
hue[i+ii] = hue[ii]
EndFor
EndFor
grad = LDShapes.BrushGradient(hue,"DD")
LDGraphicsWindow.BackgroundBrush(grad)
image = LDGraphicsWindow.Capture("","False")
tempimage = LDImage.Copy(image)
grad = LDShapes.BrushGradient(hue,"R")
LDGraphicsWindow.BackgroundBrush(grad)
box = LD3DView.LoadModel(view3d,Program.Directory+"/block.obj")
box = box[1]
LD3DView.ScaleGeometry(view3d,box,50,50,50)
LD3DView.ResetMaterial(view3d,box,LDColours.SetOpacity("Black",0),"D")
LD3DView.AddImage(view3d,box,"",tempimage,"E")
LD3DView.AnimateRotation(view3d,box,0,1,0,0,360,60,-1)
LD3DView.ReverseNormals(view3d,box)
tempbackground()
hue=""
GraphicsWindow.PenColor = pen
GraphicsWindow.BrushColor = bbrush
EndSub
Sub onmousemove
If Mouse.IsleftButtonDown Then
If playing = "False" Then
If mousetracking = "False" Then
mosdir[1] = Mouse.MouseX
mosdir[2] = Mouse.MouseY
mousetracking = "True"
EndIf
EndIf
EndIf
EndSub
Sub onmouseup
hit = LD3DView.HitTest(view3d,LDGraphicsWindow.MouseX,LDGraphicsWindow.MouseY)
If hit[1] <> box Then
If mousetracking Then
mousetracking = "False"
mosdir[1] = Mouse.MouseX-mosdir[1]
mosdir[2] = mosdir[2]-Mouse.MouseY
If Math.Abs(mosdir[1]) >= Math.Abs(mosdir[2]) and cubeaction = "False" Then
If mosdir[1] > 0 Then
LDCall.Function2("setorbit",up1,-1) 'args= up, orbitadd
Else
LDCall.Function2("setorbit",up1,1)
EndIf
ElseIf cubeaction = "False" then
If up1 = -1 Then
If Math.Remainder(camtugangend,180) = 0 Then
Else
camtugangend = camtugangend + 180 ' * orbitadd
EndIf
fliptug()
ElseIf up1 = 1 Then
'up1 = -1
If Math.Remainder(camtugangend,180) = 0 Then
Else
camtugangend = camtugangend + 180 ' * orbitadd
EndIf
fliptug()
EndIf
EndIf
EndIf
EndIf
EndSub
Sub setuplistboxes
list[1] = "Algorithm menu"
list[2] = "Load a saved game"
list[3] = "Save the game"
list[4] = "Randomize the cube"
list[5] = "Start over"
list[6] = "Quit"
list[7] = "Get Help"
listbox = LDControls.AddListBox(list,150,200)
Shapes.Move(listbox,50,50)
Controls.HideControl(listbox)
alg[1] = "Visual Algorithm Clues ON"
alg[2] = "1a.Rotate to Top"
alg[3] = "1b.Rotate and Flip to Top"
alg[4] = "1c.Flip Face to Top"
alg[5] = "2a.Move to Top & Flip Face Up"
alg[6] = "2b.Move Right Face to Top"
alg[7] = "2c.Flip & Twist to Top"
alg[8] = "3a.Edges Mid Layer Right to Front Corner"
alg[9] = "3b.Edges Mid Layer Left to Front Corner"
alg[10] = "4.Orienting Last Layer Edge Pieces"
alg[11] = "5.Permuting Last Layer Corners(Careful)"
alg[12] = "6a.Orienting Last Layer Corners"
alg[13] = "6b.Orienting Last Layer Corners"
alg[14] = "7a.Permuting Last Layer Edge Pieces CCW"
alg[15] = "7b.Permuting Last Layer Edge Pieces CW"
algbox = LDControls.AddListBox(alg,300,350)
Shapes.Move(algbox,1,1)
Controls.HideControl(algbox)
EndSub
Sub setplayalgorithm
playlist = LDText.Split(algor[algnum],":")
play = 1
stop = Array.GetItemCount(playlist)
dur1 = dur
dur = .1
playing = "True"
LDTimer.Resume(playtimer)
EndSub
Sub playalgorithm
mousetracking = "False"
LDUtilities.SendClick(playlist[play+1]*gw,playlist[play+2]*(gh+tbh),playlist[play])
play = play+3
If play >= stop Then
LDTimer.Pause(playtimer)
dur = dur1
playing = "False"
EndIf
EndSub
Sub loadalgdata
algor[2] = "Right:0.406:0.642:Right:0.406:0.642:"'step 1a
algor[3] = "Left:0.499:0.325:Right:0.590:0.635:Right:0.504:0.328:"'step 1b
algor[4] = "Left:0.404:0.635:Left:0.498:0.329:Right:0.586:0.659:Right:0.504:0.325:" 'step 1c
algor[5] = "Right:0.405:0.635:Right:0.501:0.977:Left:0.410:0.648:"'step 2a
algor[6] = "Left:0.600:0.644:Left:0.496:0.979:Right:0.598:0.607:"'step 2b
algor[7] = "Left:0.586:0.636:Right:0.506:0.974:Right:0.506:0.974:Right:0.598:0.631:Right:0.504:0.997:Left:0.595:0.638:Left:0.508:0.983:Right:0.592:0.640:"'step 2c
algor[9] = "Right:0.506:0.336:Right:0.606:0.634:Left:0.528:0.322:Left:0.600:0.634:Left:0.523:0.330:Left:0.411:0.646:Right:0.513:0.337:Right:0.418:0.662:"'step 3a
algor[8] = "Left:0.500:0.325:Left:0.408:0.631:Right:0.500:0.322:Right:0.410:0.634:Right:0.500:0.318:Right:0.586:0.651:Left:0.512:0.307:Left:0.592:0.626:"'step 3b
algor[10] = "Left:0.594:0.634:Left:0.497:0.323:Left:0.407:0.617:Right:0.494:0.318:Right:0.399:0.646:Right:0.583:0.643:"'step 4
algor[11] = "Right:0.275:0.291:Left:0.594:0.631:Left:0.524:0.328:Right:0.603:0.635:Right:0.526:0.329:Left:0.272:0.285:Left:0.510:0.341:Left:0.600:0.643:Right:0.523:0.330:Right:0.592:0.611:"'step 5
algor[12] = "Right:0.416:0.640:Right:0.520:0.338:Left:0.418:0.659:Right:0.520:0.323:Right:0.420:0.655:Right:0.515:0.323:Right:0.515:0.323:Left:0.415:0.638:Right:0.517:0.323:Right:0.517:0.323:"'step 6a
algor[13] = "Left:0.602:0.605:Left:0.523:0.333:Right:0.602:0.617:Left:0.518:0.334:Left:0.607:0.634:Right:0.519:0.318:Right:0.519:0.318:Right:0.598:0.630:Right:0.518:0.323:Right:0.518:0.323:"'step 6b
algor[14] = "Right:0.594:0.617:Left:0.501:0.318:Right:0.600:0.617:Right:0.501:0.326:Right:0.594:0.642:Right:0.502:0.332:Right:0.594:0.632:Left:0.510:0.321:Left:0.598:0.643:Left:0.505:0.311:Right:0.597:0.648:Right:0.597:0.648:"'step 7a
algor[15] = "Right:0.584:0.624:Right:0.584:0.624:Right:0.490:0.310:Right:0.593:0.647:Right:0.505:0.319:Left:0.588:0.639:Left:0.510:0.328:Left:0.596:0.638:Left:0.503:0.326:Left:0.597:0.632:Right:0.499:0.319:Left:0.592:0.635:"'step 7b
cluedata[2] = "-0.401:0.714:0.351:0.585:-0.351:0.585:0.357:0.485:0.357:0.485:0.392:0.460:"
cluedata[3] = "0.465:0.670:0.431:0.360:"
cluedata[4] = "0.405:0.714:0.430:0.357:"
cluedata[5] = "0.469:0.808:0.492:0.436:"
cluedata[6] = "0.529:0.803:0.503:0.432:"
cluedata[7] = "0.534:0.803:0.458:0.536:0.462:0.800:0.531:0.542:"
cluedata[9] = "0.395:0.458:0.463:0.675:"
cluedata[8] = "0.603:0.455:0.527:0.685:"
cluedata[10] = "0.496:0.293:0.440:0.240:0.569:0.360:0.499:0.297:0.497:0.295:0.559:0.238:"
cluedata[11] = "0.500:0.424:0.499:0.193:0.490:0.191:0.376:0.294:0.371:0.306:0.490:0.431:"
cluedata[12] = "0.499:0.044:0.499:0.196:0.712:0.450:0.659:0.400:0.412:0.577:0.457:0.533:0.269:0.252:0.307:0.293:"
cluedata[13] = "0.501:0.070:0.497:0.192:0.733:0.246:0.695:0.289:0.588:0.612:0.532:0.536:0.285:0.456:0.339:0.396:"
cluedata[14] = "0.571:0.341:0.451:0.235:0.438:0.240:0.420:0.342:0.443:0.370:0.548:0.361:"
cluedata[15] = "0.443:0.247:0.567:0.358:0.570:0.377:0.449:0.370:0.414:0.358:0.414:0.246:"
EndSub
Sub helpdata
help="VIRTUAL RUBIX CUBE HELP MENU"+crlf+crlf
help=help+"Everyone knows the “CUBE”….so this menu will not help you to turn and twist a cube."+crlf
help=help+"This help menu will explain how to turn and twist the Virtual Cube with the mouse."+crlf+crlf
help=help+"TURNING FACES"+crlf+crlf
help=help+"Turn Clockwise direction right click the mouse."+crlf
help=help+"Turn Counter-clockwise direction left click the mouse."+crlf
help=help+"The direction is always as viewed facing the side to turn."+crlf
help=help+"The arrows on, or around the cube, show the right-click direction; counter-clockwise."+crlf
help=help+"You can turn any left, right or top face by clicking on the center of the face or; back, or bottom face by clicking on one of the rotating cubes."+crlf+crlf
help=help+"ROTATING OR FLIPPING THE CUBE"+crlf+crlf
help=help+"You can rotate the whole cube by dragging the mouse side to side, or flip the cube by dragging the mouse up to down with the cursor on the cube."+crlf+crlf
help=help+"VIEW THE MENU BY RIGHT CLICKING ON THE BACKGROUND"+crlf+crlf
help=help+"Show Algorithms: Display the Algorithm Menu"+crlf
help=help+"Load a saved game: Open a file selection dialogue to select a previously saved game."+crlf
help=help+"Save the game: Open a file selection dialogue to enter a filename to save the cube state."+crlf
help=help+"Randomize the cube: Rearrange all the faces of the cube in an arbitrary way."+crlf
help=help+"Start over: Arrange all the faces by color, a New Cube."+crlf
help=help+"Quit: End the game."+crlf
help=help+"Help: This help menu."+crlf
help=help+"Cancel the menu by left clicking the background."+crlf+crlf
help=help+"ALGORITHM MENU"+crlf+crlf
help=help+"By clicking any Algorithm once will display arrows to show what the algorithm does."+crlf
help=help+"By clicking a second time on the same Algorithm; executes the algorithm."+crlf
help=help+"Visual Algorithm Clues On: Toggle the algorithm display arrows on or off."+crlf
help=help+"Cancel the Algorithm menu by left clicking the background."+crlf+crlf
help=help+"HOW TO USE THE ALGORITHMS"+crlf+crlf
help=help+"Visit http://www.rubiksplace.com/"+crlf
LDControls.RichTextBoxSetText(helpbox,help,"False")
helpclose = Controls.AddButton("X",gw*.820,gh*.081)
LDControls.SetButtonStyle(helpclose,"DarkKhaki","Red","Blue","Black","Black","Black",0,"False")
Controls.HideControl(helpclose)
EndSub