Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Finch myFinch = new Finch();
- public void FinchGround() {
- if (myFinch.isFinchLevel()) {
- }
- else {
- System.out.println("Error");
- FinchGround();
- }
- Finch myFinch = new Finch();
- public void Foward(double dblxl) {
- int Ftime = (int) dblxl * 100;
- myFinch.setWheelVelocities(100, 100, Ftime);
- }
- public void turnRight(int degrees) {
- double Righttime = degrees * 11.2;
- int Rtime = (int) Righttime;
- myFinch.setWheelVelocities(132, 0, Rtime);
- private double xlength;
- private double ylength;
- MovingFinch move = new MovingFinch();
- FinchTemplateFile ss = new FinchTemplateFile();
- static Scanner myObj = new Scanner(System.in);
- public void checkSquare(double x, double y){
- xlength = x;
- ylength = y;
- if ((xlength < 85) && (ylength < 85) && (xlength > 15) && (ylength > 15)) {
- drawSquare(xlength, ylength);
- }
- else {
- System.out.println("error");
- gettingInputsquare();
- }
- }
- public void drawSquare(double dblxl, double dblyl) {
- xlength = dblxl;
- ylength = dblyl;
- int i = 0;
- while (i < 5) {
- move.Foward(dblxl);
- move.turnRight(90);
- i++;
- }
- }
- public void gettingInputsquare() {
- System.out.println("Enter a Square length 1: ");
- double xl = myObj.nextInt();
- System.out.println("Enter a Square length 2: ");
- double yl = myObj.nextInt();
- xlength = xl;
- ylength = yl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement