SlideShare a Scribd company logo
1 of 20
FIRST GAME USING C LANGUAGE
   Hey guys, how are you all.



   I hope you all remember me, and might have seen my work in
    past.



   My name is Saurabh khetan.



   Its been long time I haven‟t uploaded
    anything.



   The reason is I was trying to come to
    you all with something interesting.
   To learn from basic is always a better idea rather than
    jumping to something really advanced.




   Starting to learn from the basics leads a
    learner to hit the „bulls eye‟.
   So for getting things in much easier way we need to learn
    a lot about the language in which we are developing our
    first game.

   As I have mentioned earlier the viewers interested in
    developing anything whether it is simple or complex.

   They need to develop their logical reasoning first.



   This is the only thing through which
    we would be able to conclude what are
    the parameters we need to work on.
   The first and the foremost thing is to give a microscopic
    view at the „C‟ Language.




   If a software engineer is not comfortable with this
    language, then his journey would end like any paper made
    ship in the rain water.

   But no, we will create
    something far excellent than
    everyone‟s imagination.
   Just read everything very carefully in this language, and we
    make wonders happen.

   Now done with lots of philosophy and is the time to get back
    to the things.

   So for now its just a simple game I have developed using this
    language.



   The game is a simple guessing game,
    wherein the player has to guess the number
    the computer is thinking at that point of
    time.
   The time you will look at the game you will get to know
    something that is not going according to you or the way it
    should have happened.

   But after reading the above sentence don‟t get panic that
    you won‟t understand anything but make sure that you have
    just read and typed the program correctly.

   The exactly written program will maintain the balance of the
    working of the game.

   Since my first upload I have been
    emphasizing on writing the program
    in the editor instead of just pasting it.
   The specialty of this program is that it does not contain
    anything so much serious that a fresher is unable to
    understand.

   To understand this one is not any kind of rocket science we
    are trying to learn.




   All such things should not come to
    our mind when we need to progress.

   I have used certain functions and few things which might not
    be familiar to you, so make sure that you go behind them to
    get to know about them.
   Yeah one more thing before I present you my first
    developed game using „C‟ Language.

   This game also contains the working of „loop‟ instructions
    most often used instructions in the language
    programming.

   The loop in its simple meaning means a code which is
    running until it is allowed to run.

   This is the most simple explanation about this instruction I
    can provide to you at such a short notice.

   If you want any more knowledge about this instruction
     send me an email I will develop a presentation for you.
PROGRAM ! ! ! !


THE MOST AWAITED THING !!!!!!!!!!!!!!!!!
PROGRAM:-
#include"stdafx.h"
#include<stdio.h>
#include<windows.h>
#include<stdlib.h>


int main()
{
int RandomNumber,Theusersguess,Numberofguesses=0;
srand( GetTickCount() );
RandomNumber=(rand()&31)+1;
printf("This is a simple guessing game where you have to guess the numbernn");
printf("i am thinking about right now in my mind,the number may exist from 1 to 32nn");
printf("You have to guess the exact numbernnyou will also get to know in how many chances you have guessed itnn");
printf("As soon as you hit the exact numbernnyou will get to know how good mind reader you are?????nn");
do
{
printf("enter a number from 1 to 32 ");
scanf("%d",&Theusersguess);
Numberofguesses++;
if(Theusersguess>RandomNumber)
printf("The number you guessed is greater than what i am thinking ");
if(Theusersguess<RandomNumber)
printf("The number you guessed is lower than what i am thinking ");
}while(RandomNumber!=Theusersguess);
printf("Congratulations you have got the number and the BMW is yoursn");
printf("You have guessed it in %d chances ",Numberofguesses);
}
THE MOST IMPORTANT PART TO
     UNDERSTAND………..




  JUST GO THROUGH THE FURTHER
   SLIDES VERY CAREFULLY~~~~~~
   The program presented to you is the exact one I have
    developed through this language.

   Just make sure you have understood this
    one fully and correctly and also with no
    doubts in your mind.

   Now I got to tell you something about this program,
    there are some functions I have used in it.



   The functions srand( ), GetTickCount( ), rand( ) are all new
    to you and are also case sensitive, they need to be written
    correctly.
   All this functions are the one which generates the random
    number between the range we have decided.

   The random numbers are generated every time you wish to
    run the program for the new player.

   As you can observe in the program I have used a lot of
    text to make it more clear and obvious for a player to
    understand the plan behind it, what actually I want him to
    do.

   This text format can be changed according to your
    convenience.

   Instead of the “BMW” you can present them any other
    thing………………..! ! ! !
   The two text written outside the “do-while loop” instruction
    syntax will get printed at the time you have guessed the
    number that is randomly generated.

   The bluff I have played is that I have written in this program
    you have to guess the number I am thinking but its the
    computer or more probably the compiler which generates it.



   But its nothing to worry
    we are just trying to make it more fascinating for the players.

   Its what every developer do………. ! ! ! !
   As soon as you type the number that is randomly generated
    and enter it you will get a winning message.

   The messages within the “do-while loop” are for the users to
    reach the number, they will let you know if the number is
    smaller than the generated one or greater than it.

   Using the help of all this messages you will able to guess
    the exact number.

   You may enter the prizes that will be offered to the players if
    guess the number in a single chance or in second chance.
   Number of chances required I also printed after the
    completion of the game.



   So guys, I have tried a lot to hit the nail
    and I think I have done it well according to
    my very poor knowledge.

   Now its up to you all to provide me with your feedbacks
    to let me know about my work.

   The areas where I need to improve and to work more
    efficiently, whether it is regarding my presentation or
    anything that you feel.
   Its always good to know about our work.

   It lets us know where do we stand and the parameters we
    need to work on.

   Any help regarding this program or my previous ones or
    any query regarding them will be resolved.

   Just mail me your problem at
    saurabh.khetan53@gmail.com

   One more thing before I end up my presentation, do
    download and see this one it will help you in lot many
    ways.
   If you liked this presentation and you think that I am that
    much capable to do anything for you and could do justice to
    you, you are free to ask me to prepare any kind of
    presentation on any topic related to „C‟ Language.

   Your feedbacks helps us to take care of things that makes it
    easy for you to understand.
PRESENTATION BY:-
SAURABH KHETAN


  “IF YOU DO GOOD THINGS GOOD THINGS WILL
               HAPPEN TO YOU”

More Related Content

What's hot

423480261-Filmora-Presentation.pptx
423480261-Filmora-Presentation.pptx423480261-Filmora-Presentation.pptx
423480261-Filmora-Presentation.pptxJHONROISAPIAN
 
Pre defined Functions in C
Pre defined Functions in CPre defined Functions in C
Pre defined Functions in CPrabhu Govind
 
Data Input and Output
Data Input and OutputData Input and Output
Data Input and OutputSabik T S
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C ProgramsKandarp Tiwari
 
Factorial Program in C
Factorial Program in CFactorial Program in C
Factorial Program in CHitesh Kumar
 
Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationSteve Guinan
 
5.2 primitive recursive functions
5.2 primitive recursive functions5.2 primitive recursive functions
5.2 primitive recursive functionsSampath Kumar S
 
Snake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malavSnake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malavRohit malav
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 
Formal Methods lecture 01
Formal Methods lecture 01Formal Methods lecture 01
Formal Methods lecture 01Sidra Ashraf
 
Python games
Python gamesPython games
Python gamesmolw
 
My lecture infix-to-postfix
My lecture infix-to-postfixMy lecture infix-to-postfix
My lecture infix-to-postfixSenthil Kumar
 
Oops practical file
Oops practical fileOops practical file
Oops practical fileAnkit Dixit
 

What's hot (20)

423480261-Filmora-Presentation.pptx
423480261-Filmora-Presentation.pptx423480261-Filmora-Presentation.pptx
423480261-Filmora-Presentation.pptx
 
Pre defined Functions in C
Pre defined Functions in CPre defined Functions in C
Pre defined Functions in C
 
Data Input and Output
Data Input and OutputData Input and Output
Data Input and Output
 
DAA Lab File C Programs
DAA Lab File C ProgramsDAA Lab File C Programs
DAA Lab File C Programs
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
 
Factorial Program in C
Factorial Program in CFactorial Program in C
Factorial Program in C
 
Chapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and AnimationChapter 18: Transitions, Transforms, and Animation
Chapter 18: Transitions, Transforms, and Animation
 
5.2 primitive recursive functions
5.2 primitive recursive functions5.2 primitive recursive functions
5.2 primitive recursive functions
 
Javascript
JavascriptJavascript
Javascript
 
Snake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malavSnake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malav
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Formal Methods lecture 01
Formal Methods lecture 01Formal Methods lecture 01
Formal Methods lecture 01
 
INPUT BOX- VBA
INPUT BOX- VBAINPUT BOX- VBA
INPUT BOX- VBA
 
History of programming
History of programmingHistory of programming
History of programming
 
compiler vs interpreter
compiler vs interpretercompiler vs interpreter
compiler vs interpreter
 
Python games
Python gamesPython games
Python games
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
 
My lecture infix-to-postfix
My lecture infix-to-postfixMy lecture infix-to-postfix
My lecture infix-to-postfix
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 

Viewers also liked

Snake game implementation in c
Snake game implementation in cSnake game implementation in c
Snake game implementation in cUpendra Sengar
 
A simple snake game project
A simple snake game projectA simple snake game project
A simple snake game projectAmit Kumar
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)hasan0812
 
Scientific calculator in c
Scientific calculator in cScientific calculator in c
Scientific calculator in cUpendra Sengar
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
scientific calculator using c
scientific calculator using cscientific calculator using c
scientific calculator using cAnuj Kumar
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c languageAMIT KUMAR
 
C programming project by navin thapa
C programming project by navin thapaC programming project by navin thapa
C programming project by navin thapaNavinthp
 
Sample project-synopsis
Sample project-synopsisSample project-synopsis
Sample project-synopsisSheshank Priya
 
software engineering
software engineeringsoftware engineering
software engineeringramyavarkala
 
Shipping and Storage: A New Approach
Shipping and Storage: A New ApproachShipping and Storage: A New Approach
Shipping and Storage: A New ApproachUpendra Sengar
 
C program to turn off your pc
C program to turn off your pcC program to turn off your pc
C program to turn off your pcSaurabh Khetan
 
Burden game synopsis
Burden game synopsisBurden game synopsis
Burden game synopsisZak Warren
 

Viewers also liked (20)

Snake game implementation in c
Snake game implementation in cSnake game implementation in c
Snake game implementation in c
 
A simple snake game project
A simple snake game projectA simple snake game project
A simple snake game project
 
Snake Game Report
Snake Game ReportSnake Game Report
Snake Game Report
 
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
 
Scientific calculator in c
Scientific calculator in cScientific calculator in c
Scientific calculator in c
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
scientific calculator using c
scientific calculator using cscientific calculator using c
scientific calculator using c
 
snake game
snake gamesnake game
snake game
 
SNAKE GAME
SNAKE GAMESNAKE GAME
SNAKE GAME
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c language
 
C programming project by navin thapa
C programming project by navin thapaC programming project by navin thapa
C programming project by navin thapa
 
C language ppt
C language pptC language ppt
C language ppt
 
Snake game
Snake gameSnake game
Snake game
 
Sample project-synopsis
Sample project-synopsisSample project-synopsis
Sample project-synopsis
 
software engineering
software engineeringsoftware engineering
software engineering
 
C programming language
C programming languageC programming language
C programming language
 
Shipping and Storage: A New Approach
Shipping and Storage: A New ApproachShipping and Storage: A New Approach
Shipping and Storage: A New Approach
 
C program to turn off your pc
C program to turn off your pcC program to turn off your pc
C program to turn off your pc
 
Burden game synopsis
Burden game synopsisBurden game synopsis
Burden game synopsis
 
Ha2 game synopsis
Ha2 game synopsisHa2 game synopsis
Ha2 game synopsis
 

Similar to First game using c language

Similar to First game using c language (20)

4. proposal finished
4. proposal finished4. proposal finished
4. proposal finished
 
5. proposal
5. proposal5. proposal
5. proposal
 
Treatment Writing Pt II
Treatment Writing Pt IITreatment Writing Pt II
Treatment Writing Pt II
 
Ppt. By Me.pptx
Ppt. By Me.pptxPpt. By Me.pptx
Ppt. By Me.pptx
 
4. proposal
4. proposal4. proposal
4. proposal
 
4. proposal
4. proposal4. proposal
4. proposal
 
Individual Report
Individual ReportIndividual Report
Individual Report
 
Build Your Own Games.pdf
Build Your Own Games.pdfBuild Your Own Games.pdf
Build Your Own Games.pdf
 
4
44
4
 
3
33
3
 
Video game proposal
Video game proposalVideo game proposal
Video game proposal
 
Game designer's journey 2.0
Game designer's journey 2.0Game designer's journey 2.0
Game designer's journey 2.0
 
Андрій Доценко “Game Designer’s Journey”
Андрій Доценко “Game Designer’s Journey”Андрій Доценко “Game Designer’s Journey”
Андрій Доценко “Game Designer’s Journey”
 
4. Proposal edit
4. Proposal edit4. Proposal edit
4. Proposal edit
 
4. proposal (video games)
4. proposal (video games)4. proposal (video games)
4. proposal (video games)
 
Introduction toprogramming
Introduction toprogrammingIntroduction toprogramming
Introduction toprogramming
 
C Programming_ Step By Step Beginner's To Experts _ Nho Vĩnh Share
C Programming_ Step By Step Beginner's To Experts _ Nho Vĩnh ShareC Programming_ Step By Step Beginner's To Experts _ Nho Vĩnh Share
C Programming_ Step By Step Beginner's To Experts _ Nho Vĩnh Share
 
Game programming workshop
Game programming workshopGame programming workshop
Game programming workshop
 
4. proposal
4. proposal4. proposal
4. proposal
 
proposal
proposalproposal
proposal
 

First game using c language

  • 1. FIRST GAME USING C LANGUAGE
  • 2. Hey guys, how are you all.  I hope you all remember me, and might have seen my work in past.  My name is Saurabh khetan.  Its been long time I haven‟t uploaded anything.  The reason is I was trying to come to you all with something interesting.
  • 3. To learn from basic is always a better idea rather than jumping to something really advanced.  Starting to learn from the basics leads a learner to hit the „bulls eye‟.
  • 4. So for getting things in much easier way we need to learn a lot about the language in which we are developing our first game.  As I have mentioned earlier the viewers interested in developing anything whether it is simple or complex.  They need to develop their logical reasoning first.  This is the only thing through which we would be able to conclude what are the parameters we need to work on.
  • 5. The first and the foremost thing is to give a microscopic view at the „C‟ Language.  If a software engineer is not comfortable with this language, then his journey would end like any paper made ship in the rain water.  But no, we will create something far excellent than everyone‟s imagination.
  • 6. Just read everything very carefully in this language, and we make wonders happen.  Now done with lots of philosophy and is the time to get back to the things.  So for now its just a simple game I have developed using this language.  The game is a simple guessing game, wherein the player has to guess the number the computer is thinking at that point of time.
  • 7. The time you will look at the game you will get to know something that is not going according to you or the way it should have happened.  But after reading the above sentence don‟t get panic that you won‟t understand anything but make sure that you have just read and typed the program correctly.  The exactly written program will maintain the balance of the working of the game.  Since my first upload I have been emphasizing on writing the program in the editor instead of just pasting it.
  • 8. The specialty of this program is that it does not contain anything so much serious that a fresher is unable to understand.  To understand this one is not any kind of rocket science we are trying to learn.  All such things should not come to our mind when we need to progress.  I have used certain functions and few things which might not be familiar to you, so make sure that you go behind them to get to know about them.
  • 9. Yeah one more thing before I present you my first developed game using „C‟ Language.  This game also contains the working of „loop‟ instructions most often used instructions in the language programming.  The loop in its simple meaning means a code which is running until it is allowed to run.  This is the most simple explanation about this instruction I can provide to you at such a short notice.  If you want any more knowledge about this instruction send me an email I will develop a presentation for you.
  • 10. PROGRAM ! ! ! ! THE MOST AWAITED THING !!!!!!!!!!!!!!!!!
  • 11. PROGRAM:- #include"stdafx.h" #include<stdio.h> #include<windows.h> #include<stdlib.h> int main() { int RandomNumber,Theusersguess,Numberofguesses=0; srand( GetTickCount() ); RandomNumber=(rand()&31)+1; printf("This is a simple guessing game where you have to guess the numbernn"); printf("i am thinking about right now in my mind,the number may exist from 1 to 32nn"); printf("You have to guess the exact numbernnyou will also get to know in how many chances you have guessed itnn"); printf("As soon as you hit the exact numbernnyou will get to know how good mind reader you are?????nn"); do { printf("enter a number from 1 to 32 "); scanf("%d",&Theusersguess); Numberofguesses++; if(Theusersguess>RandomNumber) printf("The number you guessed is greater than what i am thinking "); if(Theusersguess<RandomNumber) printf("The number you guessed is lower than what i am thinking "); }while(RandomNumber!=Theusersguess); printf("Congratulations you have got the number and the BMW is yoursn"); printf("You have guessed it in %d chances ",Numberofguesses); }
  • 12. THE MOST IMPORTANT PART TO UNDERSTAND……….. JUST GO THROUGH THE FURTHER SLIDES VERY CAREFULLY~~~~~~
  • 13. The program presented to you is the exact one I have developed through this language.  Just make sure you have understood this one fully and correctly and also with no doubts in your mind.  Now I got to tell you something about this program, there are some functions I have used in it.  The functions srand( ), GetTickCount( ), rand( ) are all new to you and are also case sensitive, they need to be written correctly.
  • 14. All this functions are the one which generates the random number between the range we have decided.  The random numbers are generated every time you wish to run the program for the new player.  As you can observe in the program I have used a lot of text to make it more clear and obvious for a player to understand the plan behind it, what actually I want him to do.  This text format can be changed according to your convenience.  Instead of the “BMW” you can present them any other thing………………..! ! ! !
  • 15. The two text written outside the “do-while loop” instruction syntax will get printed at the time you have guessed the number that is randomly generated.  The bluff I have played is that I have written in this program you have to guess the number I am thinking but its the computer or more probably the compiler which generates it.  But its nothing to worry we are just trying to make it more fascinating for the players.  Its what every developer do………. ! ! ! !
  • 16. As soon as you type the number that is randomly generated and enter it you will get a winning message.  The messages within the “do-while loop” are for the users to reach the number, they will let you know if the number is smaller than the generated one or greater than it.  Using the help of all this messages you will able to guess the exact number.  You may enter the prizes that will be offered to the players if guess the number in a single chance or in second chance.
  • 17. Number of chances required I also printed after the completion of the game.  So guys, I have tried a lot to hit the nail and I think I have done it well according to my very poor knowledge.  Now its up to you all to provide me with your feedbacks to let me know about my work.  The areas where I need to improve and to work more efficiently, whether it is regarding my presentation or anything that you feel.
  • 18. Its always good to know about our work.  It lets us know where do we stand and the parameters we need to work on.  Any help regarding this program or my previous ones or any query regarding them will be resolved.  Just mail me your problem at saurabh.khetan53@gmail.com  One more thing before I end up my presentation, do download and see this one it will help you in lot many ways.
  • 19. If you liked this presentation and you think that I am that much capable to do anything for you and could do justice to you, you are free to ask me to prepare any kind of presentation on any topic related to „C‟ Language.  Your feedbacks helps us to take care of things that makes it easy for you to understand.
  • 20. PRESENTATION BY:- SAURABH KHETAN “IF YOU DO GOOD THINGS GOOD THINGS WILL HAPPEN TO YOU”