Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yeaayy committed May 1, 2024
1 parent c457ab5 commit 7f0b42a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
12 changes: 9 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Rubik Cube
Simple 3x3 rubik cube made from scratch rendered manually with openGL 2.0
Simple 3x3 rubik cube made from scratch rendered manually with openGL 2.0.

Current feature:
- Animation (include shuffle animation)
- Simple shuffling
- Reset state

## Preview
![Solved rubik](ss/1.jpg)
![Suffled rubik](ss/2.jpg)
![Shuffled rubik](ss/2.jpg)
## Download
Open release section to [download](releases).
Open release section to [download](https://github.com/yeaayy/rubik-cube/releases/latest).
16 changes: 8 additions & 8 deletions app/src/main/java/com/yeaayy/cube/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.yeaayy.util.Log;

public class MainActivity extends Activity implements View.OnClickListener, DialogInterface.OnClickListener{
private static final int SUFFLE=0x4642, RESET=0x953f;
private static final int SHUFFLE=0x4642, RESET=0x953f;

Renderer renderer;
int action;
Expand All @@ -34,17 +34,17 @@ public void onCreate(Bundle savedInstanceState){
LinearLayout rootContainer=new LinearLayout(this);
LinearLayout buttonContainer=new LinearLayout(this);

Button suffleButton = new Button(this);
suffleButton.setId(SUFFLE);
suffleButton.setText("Suffle");
suffleButton.setOnClickListener(this);
Button shuffleButton = new Button(this);
shuffleButton.setId(SHUFFLE);
shuffleButton.setText("Shuffle");
shuffleButton.setOnClickListener(this);

Button resetButton = new Button(this);
resetButton.setId(RESET);
resetButton.setText("Reset");
resetButton.setOnClickListener(this);

buttonContainer.addView(suffleButton, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f));
buttonContainer.addView(shuffleButton, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f));
buttonContainer.addView(resetButton, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f));

rootContainer.addView(buttonContainer, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
Expand Down Expand Up @@ -72,8 +72,8 @@ public void onClick(View view){

@Override
public void onClick(DialogInterface di, int bid){
if(action==SUFFLE){
renderer.suffle();
if(action==SHUFFLE){
renderer.shuffle();
}else{
renderer.reset();
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/yeaayy/cube/Renderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void add2(int a, int b, float[]axis, float[]dir, int multiplier, int[][]
}
}

public void suffle(){
public void shuffle(){
fullAnimationDuration = SUFFLING_ANIMATION_DURATION;
Random rand = new Random();
int[][] lastFaceId = null;
Expand Down
Binary file modified ss/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ss/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f0b42a

Please sign in to comment.