diff --git a/.idea/.name b/.idea/.name
index 1751d3e..18f963f 100644
--- a/.idea/.name
+++ b/.idea/.name
@@ -1 +1 @@
-Hackathon
\ No newline at end of file
+FunWithSquare
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 5d19981..13e6014 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -43,4 +43,19 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index c31d95e..8c29ce9 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index c0d8c5f..4e40273 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,14 @@
## Hackathon CSwithAndroid 2k16
-## FunWithMath
+## FunWithSquare
- # Perfect Square game.
+
+|  |  |
+|-------------------------------------------|--------------------------------------------|
+|  |  |
- This is Android Fun game to add digit and make a perfect Square Number and perfect cube and perfect fourth root for a Given prefix number.
+
+This is Android Fun game to add digit and make a perfect Square Number and perfect cube and perfect fourth root for a Given prefix number.
* Rules of the Game:
(Fun_Math)^2 is a simple math game where user need to guess the correct length perfect
@@ -33,3 +37,10 @@
A radix tree is a compressed version of a trie.In a trie, on each edge you write a
single letter, while in a Patricia tree(or radix tree) we store whole words.
It takes less memory compared to trie node.
+### Team Members (contribution in Hackathon 2K16)
+
+* [Jitendra Singh](https://github.com/jsroyal) - Design & Implementation
+* [Ajit Jain](https://github.com/ajit1515ajit) - Algorithm & Implemention
+* [Prem Chand Saini ](https://github.com/pcsaini) - User interface
+* [K Naveen kumar](https://github.com/naveen) - Algorithm and Readme
+
diff --git a/Screenshot_2016-10-19-23-42-25-1.png b/Screenshot_2016-10-19-23-42-25-1.png
new file mode 100755
index 0000000..6c9ac66
Binary files /dev/null and b/Screenshot_2016-10-19-23-42-25-1.png differ
diff --git a/Screenshot_2016-10-19-23-42-40-1.png b/Screenshot_2016-10-19-23-42-40-1.png
new file mode 100755
index 0000000..c2b984e
Binary files /dev/null and b/Screenshot_2016-10-19-23-42-40-1.png differ
diff --git a/Screenshot_2016-10-19-23-42-54-1.png b/Screenshot_2016-10-19-23-42-54-1.png
new file mode 100755
index 0000000..2ea5ea0
Binary files /dev/null and b/Screenshot_2016-10-19-23-42-54-1.png differ
diff --git a/Screenshot_2016-10-19-23-43-21-1.png b/Screenshot_2016-10-19-23-43-21-1.png
new file mode 100755
index 0000000..1195285
Binary files /dev/null and b/Screenshot_2016-10-19-23-43-21-1.png differ
diff --git a/app/app.iml b/app/app.iml
index 9fe20c3..4c9df1e 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -1,5 +1,5 @@
-
+
@@ -47,7 +47,6 @@
-
@@ -55,7 +54,6 @@
-
@@ -63,15 +61,6 @@
-
-
-
-
-
-
-
-
-
@@ -79,7 +68,13 @@
-
+
+
+
+
+
+
+
@@ -97,10 +92,10 @@
+
-
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1ba0fc7..53f0f2d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,14 +1,14 @@
+ package="com.example.pcsaini779.hackathon">
-
+ android:theme="@style/AppTheme">
+
@@ -23,8 +23,9 @@
-
+ android:theme="@style/AppTheme.NoActionBar" />
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/pcsaini779/hackathon/ChooseGame.java b/app/src/main/java/com/example/pcsaini779/hackathon/ChooseGame.java
new file mode 100644
index 0000000..59c99fb
--- /dev/null
+++ b/app/src/main/java/com/example/pcsaini779/hackathon/ChooseGame.java
@@ -0,0 +1,43 @@
+package com.example.pcsaini779.hackathon;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+public class ChooseGame extends AppCompatActivity {
+
+ private Button cube,sqaure;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_choose_game);
+
+ cube =(Button)findViewById(R.id.cube);
+ sqaure=(Button)findViewById(R.id.square) ;
+
+
+ cube.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(ChooseGame.this,Gamecube.class));
+
+ }
+ });
+
+
+ sqaure.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ startActivity(new Intent(ChooseGame.this,Game.class));
+
+
+ }
+ });
+
+
+
+ }
+}
diff --git a/app/src/main/java/com/example/pcsaini779/hackathon/Game.java b/app/src/main/java/com/example/pcsaini779/hackathon/Game.java
index 9efc0d3..f9548b0 100644
--- a/app/src/main/java/com/example/pcsaini779/hackathon/Game.java
+++ b/app/src/main/java/com/example/pcsaini779/hackathon/Game.java
@@ -2,6 +2,7 @@
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
+import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@@ -14,150 +15,157 @@
import java.util.Random;
public class Game extends AppCompatActivity {
-
- TextView txtView,CorrectNum,Score,Round;
- Boolean flag=false;
- Button btnNext,btnSolve,OK;
- EditText editText;
+ TextView txtView, CorrectNum,Score, Round;
+ Boolean flag1 = false, flag2 = false;
+ Button btnNext, btnSolve, OK;
+ TextView editText;
Random r;
- String Square="YES";
- int randomNumber,size=0,a,start=3,control=0,score=0,x=0,k=0;
+ String Square="2";
+ int randomNumber, size = 0, a, start = 3, control = 0, TotalScore = 0,CurrentScore=0,x = 0, k = 0;
ArrayList y;
- PatriciaTrieTest ptt =new PatriciaTrieTest();
- PatriciaTrie pt =new PatriciaTrie();
-
-
+ PatriciaTrieTest ptt = new PatriciaTrieTest();
+ PatriciaTrie pt = new PatriciaTrie();
@Override
protected void onCreate(Bundle savedInstanceState) {
+
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
-
- r=new Random();
- y=new ArrayList();
+ r = new Random();
+ y = new ArrayList();
txtView = (TextView) findViewById(R.id.txtView);
Round = (TextView) findViewById(R.id.round);
Score = (TextView) findViewById(R.id.score);
CorrectNum = (TextView) findViewById(R.id.corrNum);
btnNext = (Button) findViewById(R.id.btnNext);
btnSolve = (Button) findViewById(R.id.btnSolve);
- editText=(EditText)findViewById(R.id.pickNumber);
- OK=(Button)findViewById(R.id.btnSubmit);
-
-
+ editText = (TextView) findViewById(R.id.pickNumber);
+ OK = (Button) findViewById(R.id.btnSubmit);
+ btnNext.setEnabled(flag2);
y = ptt.game(pt, start, Square);
- size = y.size();
- k = size;
- x = r.nextInt(y.size());
+ x = r.nextInt(y.size());//
randomNumber = y.get(x);
y.remove(x);
- //size = size - 1;
a = randomNumber / 10;
- txtView.setText("" + a);
-
-
+ txtView.setText("" + a);
btnSolve.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- flag = true;
- //txtView.setText(""+randomNumber);
- CorrectNum.setText(Math.sqrt(randomNumber)+" : "+randomNumber);
+ CorrectNum.setText((int) Math.sqrt(randomNumber) + " : " + randomNumber);
+ flag2 = true;
+ flag1 = false;
+ btnNext.setEnabled(flag2);
+ OK.setEnabled(flag1);
}
});
OK.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- String s=editText.getText().toString();
- if(s!=""){
- String s1=randomNumber+"";
- String s2=a+"";
- String s3=s2+s;
- flag=true;
- if(s1.equals(s3)){
- txtView.setText(""+s3);
- score+=5;
- Score.setText(""+score);
-
- //Toast.makeText(this,"You Won Press Next",Toast.LENGTH_LONG).show();
+ String s = editText.getText().toString();
+
+ if (s != null && s != "") {
+ flag2 = true;
+ btnNext.setEnabled(flag2);
+ String s1 = randomNumber + "";
+ String s2 = a + "";
+ String s3 = s2 + s;
+
+ if (s1.equals(s3)) {
+ txtView.setText("" + s3);
+ CurrentScore += 5;
+ Score.setText("Score: " + CurrentScore);
+ } else {
+ txtView.setText("" + s3);
+ if (CurrentScore > 2) {
+ CurrentScore -= 2;
+ }
+
}
- else {
- txtView.setText(""+s3);
- if(score>2){
- score-=2;
- }}
- CorrectNum.setText(Math.sqrt(randomNumber)+" : "+randomNumber);
+ CorrectNum.setText((int) Math.sqrt(randomNumber) + " : " + randomNumber);
editText.setText("");
- Score.setText(""+score);
+ Score.setText("Score: " + CurrentScore);
+ flag1 = false;
+ OK.setEnabled(flag1);
+ flag2 = true;
+ btnNext.setEnabled(flag2);
+ } else {
+ flag2 = false;
}
- else
- {
- flag=false;
- }
-
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- /* if (score > 50) {
- //txtView.setText("Your are WINNER and You will Succeed in your life");
- btnNext.setEnabled(false);
-
- }*/
- if (flag == true) {
+ if (flag2 == true) {
if (control < 5) {
control++;
- flag = false;
- int x = r.nextInt(y.size());
+ flag2 = false;
+ // randomNumber=pickNumber();
+ x = r.nextInt(y.size());//
randomNumber = y.get(x);
y.remove(x);
- size = size - 1;
a = randomNumber / 10;
txtView.setText("" + a);
- CorrectNum.setText("0");
+ CorrectNum.setText("");
} else {
- if (score > 10) {
- Round.setText("Round "+(start-1));
+ if (CurrentScore >= 10) {
+ Round.setText("Round " + (start-1));
pt.makeEmpty();
start++;
+ y.clear();
y = ptt.game(pt, start, Square);
- size = y.size();
- k = size;
- x = r.nextInt(y.size());
+ x = r.nextInt(y.size());//
randomNumber = y.get(x);
-
y.remove(x);
- //size = size - 1;
+ //randomNumber=pickNumber();//
+
a = randomNumber / 10;
txtView.setText("" + a);
control = 0;
- score = 0;
- CorrectNum.setText("0");
+ TotalScore+=CurrentScore;
+ Log.e("Hello","Total Score"+TotalScore);
+ CurrentScore = 0;
+
+ CorrectNum.setText("");
} else {
pt.makeEmpty();
-
y = ptt.game(pt, start, Square);
- size = y.size();
- k = size;
- x = r.nextInt(y.size());
+ //randomNumber=pickNumber();
+
+ x = r.nextInt(y.size());//
randomNumber = y.get(x);
y.remove(x);
- //size = size - 1;
a = randomNumber / 10;
txtView.setText("" + a);
control = 0;
- score = 0;
-
-
+ CurrentScore = 0;
}
}
+ OK.setEnabled(true);
+ flag1 = true;
+ flag2 = false;
+ btnNext.setEnabled(flag2);
}
+
}
});
}
+
+ public void putNumber(View v){
+ editText.setText(v.getTag().toString());
+ }
+
+ /* public int pickNumber(){
+ Toast.makeText(Game.this, "Size"+y.size(), Toast.LENGTH_SHORT).show();
+ x = r.nextInt(y.size());//
+ randomNumber = y.get(x);
+ y.remove(x);
+ return randomNumber;
+
+ }*/
}
diff --git a/app/src/main/java/com/example/pcsaini779/hackathon/Gamecube.java b/app/src/main/java/com/example/pcsaini779/hackathon/Gamecube.java
new file mode 100644
index 0000000..fc172e8
--- /dev/null
+++ b/app/src/main/java/com/example/pcsaini779/hackathon/Gamecube.java
@@ -0,0 +1,156 @@
+package com.example.pcsaini779.hackathon;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.w3c.dom.Text;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+public class Gamecube extends AppCompatActivity {
+ TextView txtView, CorrectNum,Score, Round;
+ Boolean flag1 = false, flag2 = false;
+ Button btnNext, btnSolve, OK;
+ TextView editText;
+ Random r;
+ String Square="3";
+ int randomNumber, size = 0, a, start = 3, control = 0, TotalScore = 0,CurrentScore=0,x = 0, k = 0;
+ ArrayList y;
+ PatriciaTrieTest ptt = new PatriciaTrieTest();
+ PatriciaTrie pt = new PatriciaTrie();
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_game);
+ getSupportActionBar().setHomeButtonEnabled(true);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ r = new Random();
+ y = new ArrayList();
+ txtView = (TextView) findViewById(R.id.txtView);
+ Round = (TextView) findViewById(R.id.round);
+ Score = (TextView) findViewById(R.id.score);
+ CorrectNum = (TextView) findViewById(R.id.corrNum);
+ btnNext = (Button) findViewById(R.id.btnNext);
+ btnSolve = (Button) findViewById(R.id.btnSolve);
+ editText = (TextView) findViewById(R.id.pickNumber);
+ OK = (Button) findViewById(R.id.btnSubmit);
+ btnNext.setEnabled(flag2);
+ y = ptt.game(pt, start, Square);
+ randomNumber=pickNumber();
+ a = randomNumber / 10;
+
+ txtView.setText("" + a);
+ btnSolve.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ CorrectNum.setText((int) Math.cbrt(randomNumber) + " : " + randomNumber);
+ flag2 = true;
+ flag1 = false;
+ btnNext.setEnabled(flag2);
+ OK.setEnabled(flag1);
+
+ }
+ });
+ OK.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ String s = editText.getText().toString();
+
+ if (s != null && s != "") {
+ flag2 = true;
+ btnNext.setEnabled(flag2);
+ String s1 = randomNumber + "";
+ String s2 = a + "";
+ String s3 = s2 + s;
+
+ if (s1.equals(s3)) {
+ txtView.setText("" + s3);
+ CurrentScore += 5;
+ Score.setText("Score: " + CurrentScore);
+ } else {
+ txtView.setText("" + s3);
+ if (CurrentScore > 2) {
+ CurrentScore -= 2;
+ }
+
+ }
+ CorrectNum.setText((int) Math.cbrt(randomNumber) + " : " + randomNumber);
+ editText.setText("");
+ Score.setText("Score: " + CurrentScore);
+ flag1 = false;
+ OK.setEnabled(flag1);
+ flag2 = true;
+ btnNext.setEnabled(flag2);
+ } else {
+ flag2 = false;
+ }
+ }
+ });
+ btnNext.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (flag2 == true) {
+ if (control < 3) {
+ control++;
+ flag2 = false;
+ randomNumber=pickNumber();
+ a = randomNumber / 10;
+ txtView.setText("" + a);
+ CorrectNum.setText("");
+
+
+ } else {
+ if (CurrentScore > 15) {
+ Round.setText("Round " + (start-1));
+ pt.makeEmpty();
+ start++;
+ y = ptt.game(pt, start, Square);
+ randomNumber=pickNumber();//
+ a = randomNumber / 10;
+ txtView.setText("" + a);
+ control = 0;
+ TotalScore+=CurrentScore;
+ Log.e("Hello","Total Score"+TotalScore);
+ CurrentScore = 0;
+
+ CorrectNum.setText("");
+ } else {
+ pt.makeEmpty();
+ y = ptt.game(pt, start, Square);
+ randomNumber=pickNumber();
+ a = randomNumber / 10;
+ txtView.setText("" + a);
+ control = 0;
+ CurrentScore = 0;
+ }
+ }
+ OK.setEnabled(true);
+ flag1 = true;
+ flag2 = false;
+ btnNext.setEnabled(flag2);
+ }
+
+ }
+ });
+ }
+ public int pickNumber(){
+ Toast.makeText(this,"hello"+y.size(),Toast.LENGTH_SHORT).show();
+ x = r.nextInt(y.size());//
+ randomNumber = y.get(x);
+ y.remove(x);
+ return randomNumber;
+ }
+
+ public void putNumber(View v){
+ editText.setText(v.getTag().toString());
+ }
+
+}
diff --git a/app/src/main/java/com/example/pcsaini779/hackathon/MainActivity.java b/app/src/main/java/com/example/pcsaini779/hackathon/MainActivity.java
index dc147f7..4b52462 100644
--- a/app/src/main/java/com/example/pcsaini779/hackathon/MainActivity.java
+++ b/app/src/main/java/com/example/pcsaini779/hackathon/MainActivity.java
@@ -1,10 +1,13 @@
package com.example.pcsaini779.hackathon;
import android.content.Intent;
+import android.graphics.Color;
+import android.provider.ContactsContract;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
+import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
@@ -22,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
btnPlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- startActivity(new Intent(MainActivity.this,Game.class));
+ startActivity(new Intent(MainActivity.this,ChooseGame.class));
}
});
btnInst.setOnClickListener(new View.OnClickListener() {
@@ -38,5 +41,8 @@ public void onClick(View v) {
}
});
+ ImageView logo = (ImageView) findViewById(R.id.logo);
+ logo.setColorFilter(Color.parseColor("#ffffff"));
+
}
}
diff --git a/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrie.java b/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrie.java
index 6c47d4e..23d3c8a 100644
--- a/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrie.java
+++ b/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrie.java
@@ -3,9 +3,10 @@
/**
* Created by jsrathore on 10/11/16.
*/
+
public class PatriciaTrie {
private PatriciaNode root;
- private static final int MaxBits = 25;
+ private static final int MaxBits = 50;
/** Constructor **/
public PatriciaTrie()
diff --git a/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrieTest.java b/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrieTest.java
index 2e0db12..da9c905 100644
--- a/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrieTest.java
+++ b/app/src/main/java/com/example/pcsaini779/hackathon/PatriciaTrieTest.java
@@ -4,31 +4,21 @@
import java.util.Random;
import java.util.Scanner;
-/**
- * Created by jsrathore on 10/11/16.
- */
public class PatriciaTrieTest {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
+
Random r=new Random();
+
/* Creating object of PatriciaTrie */
+
PatriciaTrie pt = new PatriciaTrie();
System.out.println("Patricia Trie Test\n");
- String Square="YES";
- //String Qube="YES";
- //String Qurter="YES";
- int digit3=3;//digit4=4,digit5=5;
+ String Square="YES";
+ int digit3=3;//digit4=4,digit5=5;
/* Perform trie operations */
-
-
-
-
-
-//System.out.println("Start is = "+start);
-//System.out.println("End is "+end);
-
}
/* if(Qube=="YES"){
for(int i=1; i<100; i++){
@@ -83,107 +73,116 @@ public static ArrayList square(int X,int Z){
}
return squar;
}
- public ArrayList game(PatriciaTrie pt,int digit3,String Square){
- Random r= new Random();
- int y=0;
- ArrayList show =new ArrayList();
- if(Square=="YES"){
- for(int i=1; i<100; i++){
- pt.insert(i*i);
+ public static ArrayList Qube(int X,int Z){
+ ArrayList Qub = new ArrayList();
+ for(int i=X; i Quarter(int X,int Z){
+ ArrayList Quate = new ArrayList();
+ for(int i=X; i game(PatriciaTrie pt,int digit,String Square) {
+ Random r = new Random();
+ int y = 0;
+ ArrayList show = new ArrayList();
+ if (Square == "2") {
+ for (int i = 1; i < 1000; i++) {
+ pt.insert(i * i);
}
-
- if(digit3==3){
- int count=0,start=0,end=0;
- for(int i=1; i<100; i++)
- {
- int w=0;
- int k=i*i;
- while(k>0){
- k=k/10;
- w++;
- }
- if(w==3){
- if(count==0){
- start =i;
- count=1;
- }
- else{
- end=i;
- }
-
+ int count = 0, start = 0, end = 0;
+
+ for (int i = 1; i < 1000; i++) {
+ int w = 0;
+ int k = i * i;
+ while (k > 0) {
+ k = k / 10;
+ w++;
+ }
+ if (w == digit) {
+ if (count == 0) {
+ start = i;
+ count = 1;
+ } else {
+ end = i;
}
}
- show=square(start,end);
- }
- if(digit3==4){
- int count=0,start=0,end=0;
- for(int i=1; i<100; i++)
- {
- int w=0;
- int k=i*i;
- while(k>0){
- k=k/10;
- w++;
- }
- if(w==4){
- if(count==0){
- start =i;
- count=1;
- }
- else{
- end=i;
- }
+ }
+ show = square(start, end);
+ }
+ if (Square == "3") {
+ for (int i = 1; i < 1000; i++) {
+ pt.insert(i * i * i);
+ }
+ int count = 0, start = 0, end = 0;
+ for (int i = 1; i < 1000; i++) {
+ int w = 0;
+ int k = i * i * i;
+ while (k > 0) {
+ k = k / 10;
+ w++;
+ }
+ if (w == digit) {
+ if (count == 0) {
+ start = i;
+ count = 1;
+ } else {
+ end = i;
}
}
- show=square(start,end);
- }
- if(digit3==5){
- int count=0,start=0,end=0;
- for(int i=1; i<100; i++)
- {
- int w=0;
- int k=i*i;
- while(k>0){
- k=k/10;
- w++;
- }
- if(w==5){
- if(count==0){
- start =i;
- count=1;
- }
- else{
- end=i;
- }
+ }
+ show = qube(start, end);
+ }
+ if (Square == "4") {
+ for (int i = 1; i < 1000; i++) {
+ pt.insert(i * i * i * i);
+ }
+ int count = 0, start = 0, end = 0;
+ for (int i = 1; i < 1000; i++) {
+ int w = 0;
+ int k = i * i * i * i;
+ while (k > 0) {
+ k = k / 10;
+ w++;
+ }
+ if (w == digit) {
+ if (count == 0) {
+ start = i;
+ count = 1;
+ } else {
+ end = i;
}
}
- show=square(start,end);
+
}
+ show = Quarter(start, end);
}
-
-
return show;
}
-
- /*public static ArrayList qube(int X,int Z){
+ public static ArrayList qube(int X,int Z){
ArrayList qub = new ArrayList();
- int x=5,y=10;
- for(int i=x; i Quater(int X,int Z){
ArrayList Quat = new ArrayList();
- int x=5,y=10;
- for(int i=x; i
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_game.xml b/app/src/main/res/layout/activity_game.xml
index bb68178..8101de3 100644
--- a/app/src/main/res/layout/activity_game.xml
+++ b/app/src/main/res/layout/activity_game.xml
@@ -3,186 +3,264 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.example.pcsaini779.hackathon.Game">
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ android:text="Next Round"
+ android:visibility="invisible"
+ android:id="@+id/nextRound"
+ android:textColor="#fff"/>
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_gamecube.xml b/app/src/main/res/layout/activity_gamecube.xml
new file mode 100644
index 0000000..8101de3
--- /dev/null
+++ b/app/src/main/res/layout/activity_gamecube.xml
@@ -0,0 +1,266 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 9bd3ec4..c8b1c5a 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -8,6 +8,8 @@
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
+ android:gravity="center"
+ android:background="@color/colorPrimary"
tools:context="com.example.pcsaini779.hackathon.MainActivity">
@@ -48,7 +49,7 @@
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginTop="20dp"
- android:background="@drawable/team"
+ android:background="@color/colorPrimaryDark"
android:textColor="#ffffff"
android:textSize="20dp"
android:padding="20dp"
@@ -59,7 +60,7 @@
@@ -27,7 +28,8 @@
android:layout_height="80dp"
android:layout_margin="20dp"
android:id="@+id/mem1"
- android:background="@drawable/team"
+ android:gravity="center"
+ android:background="@color/colorPrimaryDark"
android:orientation="vertical"
android:padding="5dp" >
@@ -37,7 +39,6 @@
android:gravity="center"
android:text="@string/member1"
android:textColor="#fff"
- android:layout_marginTop="10dp"
android:textStyle="bold"
android:textSize="20dp" />
@@ -46,7 +47,8 @@
android:layout_height="80dp"
android:layout_margin="20dp"
android:id="@+id/mem2"
- android:background="@drawable/team"
+ android:gravity="center"
+ android:background="@color/colorPrimaryDark"
android:orientation="vertical"
android:padding="5dp" >
@@ -65,7 +67,8 @@
android:layout_height="80dp"
android:layout_margin="20dp"
android:id="@+id/mem3"
- android:background="@drawable/team"
+ android:gravity="center"
+ android:background="@color/colorPrimaryDark"
android:orientation="vertical"
android:padding="5dp" >
@@ -84,7 +87,8 @@
android:layout_height="80dp"
android:layout_margin="20dp"
android:id="@+id/mem4"
- android:background="@drawable/team"
+ android:gravity="center"
+ android:background="@color/colorPrimaryDark"
android:orientation="vertical"
android:padding="5dp" >
diff --git a/build.gradle b/build.gradle
index 03bced9..168f129 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.0'
+ classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 122a0dc..ed21f15 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Dec 28 10:00:20 PST 2015
+#Sat Oct 15 21:47:09 IST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
diff --git a/gradlew.bat b/gradlew.bat
old mode 100644
new mode 100755