Wednesday, 6 January 2016

simple caesar cipher code in java

simple Caesar cipher code in java(encryption,decryption)

import java.io.*;
class cipher
{
 public static void main(String a[])
 {

  String s1,s2,cipher,alpha;
  int count=0;
  alpha="abcdefghijklmnopqrstuvwxyz";
  Console c=System.console();


  System.out.println("-----cipher----");
  s1=c.readLine("Enter the plain text :");
  s2=c.readLine("Enter the key(in number) :");
  System.out.println("---decryption---");
  int key=Integer.parseInt(s2);
  cipher="";

  for(int i=0;i<s1.length();i++)
      {
   for(int j=0;j<26;j++)
   {
     if(s1.charAt(i)==alpha.charAt(j))
      {
       cipher=""+alpha.charAt(j+key);
    System.out.print(cipher);
    }
   }

   }
   System.out.println("");
System.out.println("");
System.out.print(cipher);
System.out.println("");
System.out.println("");

   System.out.println("---decryption---");
 
   for(int i=0;i<cipher.length();i++)
      {
    for(int j=0;j<26;j++)
   {
     if(cipher.charAt(i)==alpha.charAt(j))
      {
       cipher=""+alpha.charAt(j-key);
    System.out.print(cipher);
    }
   }
   }
}
}

Tuesday, 29 December 2015

Tiles game in android+code


Tiles game in android+code

software requirements:

1.Eclipse
2.Java

Import the project into the eclipse and start editing.

Game features:
1.Action game
2.High score
3.speed increase
4.Different map

Download game code : Download

Demo apps: https://play.google.com/store/apps/details?id=com.initedit.opps_wrong_tab

Sunday, 1 November 2015

Blink keyboard light - Disco light

As you know there is 3 LED in every keyboard.

1. NUM LOCK
2.CAPS LOCK
3.SCROLL LOCK

Now we are gonna make this light blink using WScript.

Note: before running this program you should know how to close the program.

To close the program open task manager(Ctrl+Alt+Del) and kill wscript.exe

1. Open notepad and write this code.

Set WEBCHILLER =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
WEBCHILLER.sendkeys "{CAPSLOCK}"
WEBCHILLER.sendkeys "{NUMLOCK}"
WEBCHILLER.sendkeys "{SCROLLLOCK}"
loop


2. Save the file as “blink.vbs”

3. Open blink.vps file and see your keyboard LED light.