SlideShare una empresa de Scribd logo
1 de 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”

Más contenido relacionado

La actualidad más candente

Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android Ranjith Kumar
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in androidMahmudul Hasan
 
Android resource
Android resourceAndroid resource
Android resourceKrazy Koder
 
Android animation
Android animationAndroid animation
Android animationKrazy Koder
 
Android summer training report
Android summer training reportAndroid summer training report
Android summer training reportShashendra Singh
 
report on snake game
report on snake game report on snake game
report on snake game azhar niaz
 
ANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 schANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 schkannikadg
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting StartedHemant Chhapoliya
 
Android resources
Android resourcesAndroid resources
Android resourcesma-polimi
 
Final project report Snake Game in Python
Final project report Snake Game in PythonFinal project report Snake Game in Python
Final project report Snake Game in PythonMuhammad Aziz
 
SRS FOR CHAT APPLICATION
SRS FOR CHAT APPLICATIONSRS FOR CHAT APPLICATION
SRS FOR CHAT APPLICATIONAtul Kushwaha
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferencesAjay Panchal
 
Android service, aidl - day 1
Android service, aidl - day 1Android service, aidl - day 1
Android service, aidl - day 1Utkarsh Mankad
 
Casino game project based on c++
Casino  game  project based on c++Casino  game  project based on c++
Casino game project based on c++Niteen Balpande
 

La actualidad más candente (20)

Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
Android resource
Android resourceAndroid resource
Android resource
 
Android media
Android mediaAndroid media
Android media
 
snake game
snake gamesnake game
snake game
 
Android animation
Android animationAndroid animation
Android animation
 
Android summer training report
Android summer training reportAndroid summer training report
Android summer training report
 
report on snake game
report on snake game report on snake game
report on snake game
 
ANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 schANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 sch
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
 
Android resources
Android resourcesAndroid resources
Android resources
 
Final project report Snake Game in Python
Final project report Snake Game in PythonFinal project report Snake Game in Python
Final project report Snake Game in Python
 
SRS FOR CHAT APPLICATION
SRS FOR CHAT APPLICATIONSRS FOR CHAT APPLICATION
SRS FOR CHAT APPLICATION
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferences
 
Android Memory Management
Android Memory ManagementAndroid Memory Management
Android Memory Management
 
Hangman game is interesting
Hangman game is interesting Hangman game is interesting
Hangman game is interesting
 
Android service, aidl - day 1
Android service, aidl - day 1Android service, aidl - day 1
Android service, aidl - day 1
 
python.ppt
python.pptpython.ppt
python.ppt
 
Fragment
Fragment Fragment
Fragment
 
Casino game project based on c++
Casino  game  project based on c++Casino  game  project based on c++
Casino game project based on c++
 

Destacado

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
 
Task 2 – game genre and synopsis
Task 2 – game genre and synopsisTask 2 – game genre and synopsis
Task 2 – game genre and synopsisBenWhite101
 

Destacado (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
 
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
 
Task 2 – game genre and synopsis
Task 2 – game genre and synopsisTask 2 – game genre and synopsis
Task 2 – game genre and synopsis
 

Similar a First game using c language

Similar a 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”