SlideShare a Scribd company logo
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

DOCX
Banking Management System Project documentation
DOCX
Industrial Training report on java
PDF
Android Application for American Sign Language Recognition
DOCX
Project report On MSM (Mobile Shop Management)
DOC
Tic tac toe game code
PDF
Levels of AI Agents: from Rules to Large Language Models
DOCX
Minor project Report for "Quiz Application"
DOCX
Library Management System
Banking Management System Project documentation
Industrial Training report on java
Android Application for American Sign Language Recognition
Project report On MSM (Mobile Shop Management)
Tic tac toe game code
Levels of AI Agents: from Rules to Large Language Models
Minor project Report for "Quiz Application"
Library Management System

What's hot (20)

PDF
Raspberry pi pico projects raspberry pi projects
DOC
Report in Java programming and SQL
PPT
project on snake game in c language
DOC
Clothing Store and Management System
PDF
Hotel Management System
DOCX
Library Management System Project Report
DOC
Scientific calculator in c
DOCX
TRIBHUVAN UNIVERSITY BCA INTERNSHIP REPORT FOR 7 SEM.docx
DOCX
Advance java summer training report
PDF
Railway management system, database mini project
DOCX
ER diagrams for Railway reservation system
DOCX
Pharmacy management system project report
PPSX
Algorithm and flowchart
PDF
summer training report on python
PDF
Unit 6 - Internet and Intranet Systems Development - IT
PDF
Final project report Snake Game in Python
PDF
A project report on chat application
DOC
Snake project report
PPTX
Pharmacy management
PDF
Raspberry pi pico projects raspberry pi projects
Report in Java programming and SQL
project on snake game in c language
Clothing Store and Management System
Hotel Management System
Library Management System Project Report
Scientific calculator in c
TRIBHUVAN UNIVERSITY BCA INTERNSHIP REPORT FOR 7 SEM.docx
Advance java summer training report
Railway management system, database mini project
ER diagrams for Railway reservation system
Pharmacy management system project report
Algorithm and flowchart
summer training report on python
Unit 6 - Internet and Intranet Systems Development - IT
Final project report Snake Game in Python
A project report on chat application
Snake project report
Pharmacy management
Ad

Viewers also liked (20)

DOC
Snake game implementation in c
DOCX
A simple snake game project
PDF
Snake Game Report
DOCX
Hangman Game Programming in C (coding)
PPSX
INTRODUCTION TO C PROGRAMMING
PPTX
scientific calculator using c
PDF
snake game
PPTX
SNAKE GAME
PDF
Scientific calculator project in c language
DOC
C programming project by navin thapa
PPTX
C language ppt
PPSX
Snake game
PDF
Sample project-synopsis
PPT
software engineering
PDF
C programming language
DOC
Shipping and Storage: A New Approach
PPTX
C program to turn off your pc
DOCX
Burden game synopsis
DOC
Ha2 game synopsis
PPTX
Task 2 – game genre and synopsis
Snake game implementation in c
A simple snake game project
Snake Game Report
Hangman Game Programming in C (coding)
INTRODUCTION TO C PROGRAMMING
scientific calculator using c
snake game
SNAKE GAME
Scientific calculator project in c language
C programming project by navin thapa
C language ppt
Snake game
Sample project-synopsis
software engineering
C programming language
Shipping and Storage: A New Approach
C program to turn off your pc
Burden game synopsis
Ha2 game synopsis
Task 2 – game genre and synopsis
Ad

Similar to First game using c language (20)

PDF
Introduction of c_language
KEY
Thinking Like a Programmer
PDF
C Programming - Refresher - Part I
PPTX
cmp104 lec 8
PDF
C program
PDF
C programing for BCA Sem 1. JJ College
PDF
TCS-NQT-Coding-Questions-@-Recruitmentindia.in_.pdf
PPTX
Final requirement for programming-Bonifacio, Mary Clemence
PPTX
Advanced Computer Programming..pptx
PPS
Learn C
DOC
Project two c++ tutorial
PDF
Let us c yashwant kanetkar(1)
PDF
INTRODUCTION TO C BOOK FOR REFERENCE.pdf
PDF
INTRODUCTION TO C BOOK FOR REFERENCE.pdf
PDF
Let us c yashwant kanetkar
PDF
IP Lab Manual for Kerala University 3 Year UG Programme
PDF
C basics
PDF
C progrmming
PDF
6272 cnote
PPT
Project
Introduction of c_language
Thinking Like a Programmer
C Programming - Refresher - Part I
cmp104 lec 8
C program
C programing for BCA Sem 1. JJ College
TCS-NQT-Coding-Questions-@-Recruitmentindia.in_.pdf
Final requirement for programming-Bonifacio, Mary Clemence
Advanced Computer Programming..pptx
Learn C
Project two c++ tutorial
Let us c yashwant kanetkar(1)
INTRODUCTION TO C BOOK FOR REFERENCE.pdf
INTRODUCTION TO C BOOK FOR REFERENCE.pdf
Let us c yashwant kanetkar
IP Lab Manual for Kerala University 3 Year UG Programme
C basics
C progrmming
6272 cnote
Project

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”