Monday, December 5, 2016

How to HIDE A FILE IN AN IMAGE Using CMD

In this tutorial we would learn to hide a file within an image

Follow the steps:

1)copy the file ,u need to hide ,to desktop(for our tutorial let us assume the file tobe "x.txt")
2)copy the image, within wich u need to hide the file ,to desktop(let it be "y.jpg")
3)convert the file(x.txt) to rar using winrar
4)so now u have "x.rar"(x is the name i assume to be of ur file)
5)now u can delete the real file  wich u need to hide(here,"x.txt")
6)now open the cmd:
               >ctrl+r
               >type:cmd and hit enter
7)in cmd first type the code as follows:
               >cd desktop
    NOTE:this code is for assigning the location on cmd to desktop

8)now type the following code:
               > copy /b x.rar+y.jpg out.jpg

    NOTE:* In this code "x.rar" is the compressed form of our file which should be hidden   
                 * "y.jpg" is the image within which we will hide the file
                 * "out.jpg" is the output image inside this out image our file is hidden

HOW TO RETRIVE THE FILE?

1)open winrar
2)locate out.jpg in winrar
3)double click
4)there you are in that you could find ur file "x.txt"
5)drag the file to anywhere you want it to be extracted


Done!

VIDEO TUTORIAL:



Friday, December 2, 2016

A HandCricket Game In python

In my old post i have written an unfinished code of hand cricket game in python.That code is not finished and very much lengthy so i have decided to write a new code.Here I have finished the code you can just copy and paste on python IDLE and run it and see it works smoothly :D

Source Code
=========

import random

def batfirst(pl):
    o=0
    score=0
   
    if pl=='c':
        print'First Innings'
        print'============='
        while o==0:
            e=0
           
            while e==0:
                b=input('Enter Your Bowling choice 1-6:')
                if b>6 or b<1:
                   
                    e=0
                else:
                    r=random.randint(1,6)
                    e=1
           
            if b==r:
                o=1
                print 'computer used ',r
                print 'computer is out!'
                print 'score:',score
                break
            else:
                print 'computer scored ',r
                score=score+r
                print 'Score:',score
        return score
    else:
        print'First Innings'
        print'============='
        while o==0:
            e=0
            while e==0:
                r=input('Enter Your Batting choice 1-6:')
                if r>6 or r<1:
                   
                    e=0
                else:
                    e=1
            b=random.randint(1,6)
            if b==r:
                o=1
                print 'computer used ',b
                print 'You are out!'
                print 'score:',score
                break
            else:
                print 'computer used ',b
                score=score+r
                print 'Score:',score
        return score
def batsec(pl,sc):
    o=0
    score=0
    if pl=='c':
        print'Second Innings'
        print'=============='
        while o==0 and score<=sc:
            e=0
            r=random.randint(1,6)
            while e==0:
                b=input('Enter Your Bowling Choice 1-6:')
                if b>6 or b<1:
                   
                    e=0
                else:
                    e=1
            if b==r:
                o=1
                print 'computer scored ',r
                print 'computer is out!'
                print 'score:',score
                if score<sc:
                    print 'Computer loss by ',sc-score,' runs'
                elif score==sc:
                    print 'Match Drawn!'
                else:
                    continue
            else:
                score=score+r
                print 'Score:',score
                print (sc-score)+1,' runs to win!'
        if score>sc:
            print 'computer win!'
    else:
        print'Second Innings'
        print'=============='
        while o==0 and score<=sc:
            e=0
            while e==0:
                r=input('Enter Your Batting Choice 1-6:')
                if r>6 or r<1:
                    raise ValueError,'number Should Be between 1-6'
                    e=0
                else:
                    e=1
            b=random.randint(1,6)
            if b==r:
                o=1
                print 'computer used ',b
                print 'You are out!'
                print 'score:',score
                if score<sc:
                    print 'You loss by ',sc-score,' runs'
                elif score==sc:
                    print 'Match Drawn!'
            else:
                score=score+r
                print 'Score:',score
                print (sc-score)+1,' runs to win!'
        if score>sc:
            print 'You win!'
pl='y'
while pl=='y' or pl=='Y':
    print 'you can have 1-6 run a ball and one wicket'
    print 'Let us do the toss'
    t=random.randint(1,2)
    ch=str(raw_input('CHOOSE EVEN OR ODD(e/o):'))
    to=int(raw_input('ENTER YOUR NUMBER:'))
    toss=t+to
    print 'Computer:',t
    if toss%2==0:
        if ch=='e' or ch=='E':
            print 'You won the toss'
            u=1
        else:
            print 'You loss the toss'
            u=0
    else:
        if ch=='o' or ch=='O':
            print 'You won the toss'
            u=1
        else:
            print 'You loss the toss'
            u=0
    if u==1:
        d=int(raw_input('1.Bat or 2.Bowl?(1/2):'))
        if d==1:
            sc=batfirst('u')
            batsec('c',sc)
        else:
            sc=batfirst('c')
            batsec('u',sc)
    else:
        d=random.randint(1,2)
        if d==1:
            print 'computer choose to bat first!'
            sc=batfirst('c')
            batsec('u',sc)
        else:
            print 'Computer choose to bowl first!'
            sc=batfirst('u')
            batsec('c',sc)
    pl=str(raw_input('DO you wish to play again?(y/n):'))