Giter Site home page Giter Site logo

rubikscubesim's Introduction

ยฉ Reese Barnett

Rubik's Cube Simulator (Native iOS Application)

Welcome to the Rubik's Cube Simulator! Have you ever wanted to practice cube algorithms on the go? Well now you can. This application allows you to practice algorithms and discover new ones. This application uses the well known cube notation: F, U, L, R, D, B (front, upper, left, right, down, back respectively) and " ' " to denote counterclockwise or the lack there of to denote clockwise.


Agile Development Methodology

The Rubik's Cube simulator is developed by a single developer, Reese Barnett. Barnett is responsible for the UI/UX design, front-end code, and back-end code. This project uses an iterative development process called Agile that allows Barnett to evolve requirements and solutions over the lifetime of the application.

  • Developer(s): Reese Barnett (Full-Stack)
  • Programming Technologie(s): Xcode, SwiftUI, iOS SDK, Git
  • Language(s): Swift

Backend Code

Tools: Swift, iOS SDK, Xcode, Git

The main functionality of this application relies on matrix transformations. Let A be an m x m matrix. The matrix transformation associated to A is the transformation: T: Rm โ†’ Rm defined by T(x)=Ax. This is the transformation that takes a vector x in Rm to the vector Ax in Rm. (Interactive Linear Algebra)

for i in 0..<3 { // Iterates 3 times for the 3 connected cells shared by any two faces
    cube[right].cells[i][0].color = temp[rborder].cells[abs(delta-2)][abs(delta-i)].color
    cube[top].cells[2][i].color = temp[tborder].cells[abs(abs(delta-2)-i)][abs(delta-2)].color
    cube[left].cells[i][2].color = temp[lborder].cells[delta][abs(delta-i)].color
    cube[bottom].cells[0][i].color = temp[bborder].cells[abs(abs(delta-2)-i)][delta].color
}

Since cubes are three-dimensional the cube matrix is a three-dimensional matrix. While this can increase code complexity the dimensions of the cube are abstracted away. The matrix transformations are accomplished in Cube.swift. When performing a transformation, the current state of the cube is copied into a variable. This temporary variable undergoes the transformation and then the original matrix is updated.

rubikscubesim's People

Contributors

rabarnett avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.