Code covered by the BSD License  

Highlights from
Rubik Cube Game

from Rubik Cube Game by Sergii Iglin
Task: to solve Rubik's Cube.

Rubik.m
% Author: Sergiy Iglin
% e-mail: iglin@kpi.kharkov.ua
% or: siglin@yandex.ru
% personal page: http://iglin.exponenta.ru
clear all % Rubik Cube Game Main File
scrsz = get(0,'ScreenSize');
pl = (scrsz(3)-460)/2; % left bound
pu = (scrsz(4)-460)/2; % upper bound
Cube = InitCube; % initialize the cube
hFig = figure('Position',[pl pu 460 460],...
  'Color',get(0,'DefaultUicontrolBackgroundColor'),...
  'Resize','off','MenuBar','none',...
  'NumberTitle','off','Name','Rubik Cube Game',...
  'WindowButtonMotionFcn','ChangePointer(hFig,Cube);');
hAxes = axes('Units','pixels','Position',[20 20 420 420],...
  'CameraPosition',[4.5 4 3.5],...
  'XLim',[-3.7 3.7],'YLim',[-3.7 3.7],'ZLim',[-3.7 3.7],...
  'XTickLabel','','YTickLabel','','ZTickLabel','',...
  'XTick',[],'YTick',[],'ZTick',[]);
hMenuGame = uimenu(hFig,'Label','Game');
hMenuNewGame = uimenu(hMenuGame,'Label','New Game',...
  'Callback','Cube=CreateNewGame(hAxes,Cube);');
hMenuExit = uimenu(hMenuGame,'Label','Exit',...
  'Callback','delete(hFig);','Separator','on');
hMenuHelp = uimenu(hFig,'Label','Help');
hMenuHow = uimenu(hMenuHelp,'Label','How to build the Rubik cube?',...
  'Callback','web jjorg.chem.unc.edu/personal/monroe/cube/rubik.html -browser');
hMenuAuthor = uimenu(hMenuHelp,'Label','Author','Separator','on',...
  'Callback','web iglin.exponenta.ru/All/Rubik.html -browser');
Cube = CreateNewGame(hAxes,Cube); % create new game and draw

Contact us at files@mathworks.com