Monday, April 7, 2014

7block available for iOS and Android!



App Store: https://itunes.apple.com/us/app/7block/id849399374?mt=8

Google Play Store: https://play.google.com/store/apps/details?id=com.napdivad.block

Friday, September 28, 2012

Subtraction Mandelbrot Set



I had a dream about subtracting fractals. I woke up and made this fractal (by the subtracting the number of iterations from four Mandelbrot sets). This is currently my desktop background.

Wednesday, August 8, 2012

45 points on Google basketball doodle

The world record in the Google basketball doodle shootout is 45 points. Here's the Java code:


 import java.awt.*;  
 import java.awt.event.*;  
 public class Baller  
 {  
   public static void main(String[] args) throws Exception  
   {  
     orient();  
     for (int j = 0; j < times.length; j++)  
     {  
       for (int i = 0; i < lengths[j]; i++)  
       {  
         shoot(times[j]);  
         Thread.sleep(waits[j]);  
       }  
       Thread.sleep(transitions[j]);  
     }  
   }  
   public static void orient() throws Exception  
   {  
     robot = new Robot();  
     robot.mouseMove(300, 300);  
     robot.mousePress(InputEvent.BUTTON1_MASK);  
     Thread.sleep(200);  
     robot.mouseRelease(InputEvent.BUTTON1_MASK);  
     robot.mouseMove(X, Y);  
   }  
   public static void shoot(long delay) throws Exception  
   {  
     robot.mouseMove(X, Y);  
     robot.mousePress(InputEvent.BUTTON1_MASK);  
     Thread.sleep(delay);  
     robot.mouseRelease(InputEvent.BUTTON1_MASK);  
   }  
   private static Robot robot;  
   private static int X = 520;  
   private static int Y = 280;  
   private static int[] times = {240, 430, 580, 760, 850};  
   private static int[] waits = {820, 850, 850, 850, 850};  
   private static int[] transitions = {50, 50, 50, 50, 50};  
   private static int[] lengths = {5, 4, 4, 4, 4};  
 }  

Tuesday, August 7, 2012

2.5s on Google hurdle doodle



Here is the Java code:

import java.awt.*;

public class Hurdler
{
  public static void main(String[] args) throws Exception
  {
    Robot robot = new Robot();
    
    robot.mouseMove(300, 300);
    
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
    
    int delay = 1;
    
    while (true)
    {
      robot.keyPress(KeyEvent.VK_RIGHT);  Thread.sleep(delay);
      robot.keyRelease(KeyEvent.VK_RIGHT);  Thread.sleep(delay);
      robot.keyPress(KeyEvent.VK_LEFT);  Thread.sleep(delay);
      robot.keyRelease(KeyEvent.VK_LEFT);  Thread.sleep(delay);
    }
  }
}

Wednesday, April 25, 2012

Milestone: 50,000 games played on 7block

In a matter of two weeks after 7block was published as a Chrome Experiment, the number of games played has risen from 8,000 to over 50,000!

There are over 1,000 wins, giving a 2% chance of winning. The record time is 3.334 seconds by "Anonymous", but I'm pretty sure the person hacked it because even I can't get that time.

Tuesday, April 10, 2012

7block is now a Chrome Experiment!


I submitted my AJAX game, 7block, to Chrome Experiments. Yesterday, it was accepted! I was surprised because 7block is so simple compared to the other experiments. You can see 7block on chromeexperiments.com or play 7block on my site.

Another good piece of news is that 7block was hacked at least 5 times since it was on Chrome Experiments. Somebody changed the record time to 0, so I set 3.1 as the lower bound of the record time in the PHP file. After that, another person set the time to 3.101, which is amazing, considering they had to guess the lower bound! Following the generous advice of one of the hackers, I modified the code to make it less vulnerable.

Friday, April 6, 2012

Chessbot has retired

I got an email from Erik, the founder of Chess.com. He congratulated me on making Chessbot, but he said it was against the rules and asked me what I was going to do. I replied that I would not use Chessbot anymore.

I'm kind of sad. But again, Chessbot has had a great career of about 800 awesome games. You can watch Chessbot's last game on YouTube.