{"id":52,"date":"2013-03-01T09:30:41","date_gmt":"2013-03-01T09:30:41","guid":{"rendered":"http:\/\/ceptimus.co.uk\/?p=52"},"modified":"2013-03-01T09:30:41","modified_gmt":"2013-03-01T09:30:41","slug":"flash-rubik-cube-simulator","status":"publish","type":"post","link":"https:\/\/ceptimus.co.uk\/index.php\/2013\/03\/01\/flash-rubik-cube-simulator\/","title":{"rendered":"Flash Rubik Cube Simulator"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Snapshot of Flash Rubik Cube Simulator\" src=\"https:\/\/ceptimus.co.uk\/rubikSnapshot.gif\" \/><\/p>\n<p>Above is a snapshot image. \u00a0<a href=\"https:\/\/ceptimus.co.uk\/rubik.html\">Here&#8217;s the real thing<\/a>.<\/p>\n<p>It works for any size of cube from 2 x 2 x 2 up to 11 x 11 x 11. \u00a0Actually, 11 is an\u00a0arbitrary\u00a0limit &#8211; the same code would work for any size of cube. \u00a0Use the little + and &#8211; buttons up in the top left hand corner to select the size of the cube.<\/p>\n<p>Turning a face or slicing a layer is pretty intuitive &#8211; just click somewhere on the cube, hold down the mouse button and drag.<\/p>\n<p>Turning the whole cube around is the same but you have to double-click, hold the mouse button down on the second click and then drag.<\/p>\n<p>There&#8217;s a bug in the turning of the whole cube which causes the orientation to jump occasionally. \u00a0I think I can fix it by using <a href=\"http:\/\/en.wikipedia.org\/wiki\/Quaternion\">quaternions<\/a> to do the whole-cube rotation, but with the demise of Flash I&#8217;m thinking this would be a good project to migrate to HTML5 &#8211; and then I could patch in the quaternion stuff at the same time.<\/p>\n<p>You can also use the keyboard to turn layers (there&#8217;s a sort of agreed way of doing this among speed-cubers, and the simulation mostly uses the agreed keys),<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Above is a snapshot image. \u00a0Here&#8217;s the real thing. It works for any size of cube from 2 x 2 x 2 up to 11 x 11 x 11. \u00a0Actually, 11 is an\u00a0arbitrary\u00a0limit &#8211; the same code would work for any size of cube. \u00a0Use the little + and &#8211; buttons up in the top [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-programming","category-puzzles"],"_links":{"self":[{"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":0,"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"wp:attachment":[{"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ceptimus.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}