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):'))
   

           
       
       
       
           
             
       
   
   
   

Thursday, November 17, 2016

Anybody can draw


Drawing Seems tough but Once You are in deep love with it ,it is the easiest job!

Sunday, October 23, 2016

HAND CRICKET GAME IN PYTHON

Some days ago I decided to make a hand cricket game with python ..and I wrote codes but didnt finished it that day and Ii was quiet busy for the following days and I forgot wat was the idea in my mind for the game and iam too lazy to read and make the idea again

So the point is iam giving my unfinished source code here u can develop it and if possible post it as a comment :D

source code
=========
import random
def mod(n):
    if n<0:
        n=n*(-1)
    return n

def bat():
    
    out=0
    score=0
    while out!=1:
        b=random.randint(1,6)
        ba=int(raw_input('Enter your choice 1-6:'))
        if ba<1 or ba>6:
            print 'You cheats!'
                
            exit
        if b==ba:
            out=1
            print 'Computer also opted for',b
            print 'You are out'
           
        else:
            print 'You scored ',ba
            score=score+ba
            print 'score:',score
    return score               
def bowl(sc):
    if sc!=999:
        score=0
        while score<=sc:
            bc=random.randint(1,6)
            bo=int(raw_input('Enter your choice 1-6:'))
            if ba<1 or ba>6:
                print 'You cheats!'
                exit
            if bc==bo:
                out=1
                print 'Computer also opted for',bc
                print 'Computer is out'
                print 'computer scores ',score,'runs'
                d=score-sc
                if d>0:
                    print 'computer won'
                elif d<1:
                    print 'computer lost by',mod(d),'runs'
                else:
                    print 'Match is a draw'
            
            else:
                print 'Computer scored ',ba
                score=score+ba
                print "Computer's score:",score
                d2=sc-score
                if d2>0:
                    print 'computer needs ',d2+1,'runs to win'
                else                    
    return score        
            

do:
    print 'you can have 1-6 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:
            score1=bat()
            score2=bowl(score1)
        else:
            bowl(1)
    else:
        d=random.randint(1,2)
        if d==1:
            print 'computer choose to bat first!'
            bat(0)
        else:
            print 'Computer choose to bowl first!'
            bowl(0)
    pl=str(raw_input('DO you wish to play again?(y/n):'))
while pl=='y' or pl=='Y'