Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

So basically when you go to findtheinvisiblecow.com , you are brought to a page

ID: 3596336 • Letter: S

Question

So basically when you go to findtheinvisiblecow.com , you are brought to a page where you hear a cow sound. When you move your mouse around the screen, the cow sound becomes louder the closer you get to the cow. So you must move your mouse cursor all over the screen until you find the cow. When you find the cow, a screen pops up and say "you found the cow" "Play Again?".
Basically I need a java code that will run my mouse cursor across the entire screen. Then, when the cow is randomly found, the javacode will be needed to click on "Play again".

READ PLEASE. This is the second time I am posting the same question. I received the answer the first time in javascript. But, I do not need javascript, I need Java code that can run in a program such as eclipse or jgrasp. Thanks.

Explanation / Answer

import java.awt.*;
public class MouseCursor
{
   public static void main(String args[])
   {
       // java - get screen size using the Toolkit class
       Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
      
       int ht=(int)screenSize.getHeight();
       int wd=(int)screenSize.getWidth();
       try
       {
                //These coordinates are screen coordinates
                int xCoord = 0;
           int yCoord = 0;
           // Move the cursor
                    Robot robot = new Robot();
           for(xCoord=0;xCoord<=wd;xCoord++)
           {
               for(yCoord=0;yCoord<=ht;yCoord++)
               {
                           robot.mouseMove(xCoord, yCoord);
               }
           }
                  
       }
       catch (AWTException e)
       {
       }
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote