Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class GridCell{
- //V for variable so it doesn't interfere with simple getter names
- private int aV;
- private int bV;
- private int cV;
- private int dV;
- private int eV;
- private int fV;
- private int nV;
- private int xV;
- private int tV;
- private int xplusnV;
- private int dplusnV;
- private int xplusnsquaredV;
- private int dplusnsquaredV;
- private int uV;
- private int bignV;
- private boolean oddxplusnsquaredV;
- private String description;
- public GridCell(int aSend, int bSend){
- aV = aSend;
- bV = bSend;
- cV = aV*bV;
- dV = (int)Math.floor((int)Math.sqrt(cV));
- eV = cV-(dV*dV);
- fV = eV-((2*dV)+1);
- nV = ((aV+bV)/2)-dV;
- xV = dV-aV;
- tV = 0;
- if(eV%2==0){
- tV = (xV+2)/2;
- } else {
- tV = (xV+1)/2;
- }
- xplusnV = xV+nV;
- dplusnV = dV+nV;
- xplusnsquaredV = xplusnV*xplusnV;
- dplusnsquaredV = dplusnV*dplusnV;
- uV = 0;
- oddxplusnsquaredV = true;
- if(xplusnsquaredV%2==0){
- oddxplusnsquaredV = false;
- uV = xplusnV/2;
- } else {
- uV = (xplusnV-1)/2;
- }
- bignV = ((cV+1)/2)-dV;
- description = "("+eV+","+nV+","+tV+") = {"+eV+":"+nV+":"+dV+":"+xV+":"+aV+":"+bV+"}, f="+fV+", c="+cV+", u="+uV;
- }
- public int a(){
- return aV;
- }
- public int b(){
- return bV;
- }
- public int c(){
- return cV;
- }
- public int d(){
- return dV;
- }
- public int e(){
- return eV;
- }
- public int f(){
- return fV;
- }
- public int n(){
- return nV;
- }
- public int x(){
- return xV;
- }
- public int t(){
- return tV;
- }
- public int xplusn(){
- return xplusnV;
- }
- public int dplusn(){
- return dplusnV;
- }
- public int xplusnsquared(){
- return xplusnsquaredV;
- }
- public int dplusnsquared(){
- return dplusnsquaredV;
- }
- public int u(){
- return uV;
- }
- public int bign(){
- return bignV;
- }
- public boolean oddxplusnsquared(){
- return oddxplusnsquaredV;
- }
- public String print(){
- return description;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment