- Main Idea Behind the Project
When we were very young to our work and just started coding then we were assigned to represent something that can help us to learn C language better(we started our journey with C !!)and also get some practical idea of doing stuffs.Thinking of doing some project,we firstly created our very new team with my another good friend,who helped me a lot after that semester and also holds the first position in our class!!).We after happy teaming up we started searching what we can do using C language?Well we always loved to build some games from the very beginning and so we finally returned back with combining three small console-run-games thinking that very concept of making games.That was the beginning of our first ever project in our lives actually.
- What it does ?
We integrated three separate games in our main menu :
[1]Guess the Number (1-Player and 2-Player)
[2]Marble Game (1-Player and 2-Player)
[3]Hand Cricket (1-Player with console GUI)
* And to keep track of every game's history we made a separate history section where we used file to create a history of the previously game play results.
Well the first game is built on basic binary search algorithm.Firstly a random range of natural numbers will be created and will be shown on the console.Using default "rand" function,the computer would determine any random number from that range.The player(s) has/have to guess what the computer has selected.For 1P game we have set a fixed move number after which you can't guess and for 2P,who would guess the number first is the method.The game play is a binary search way because when you choose an incorrect number,say x and if the actual number is a and if x<a then all the number including the selected one will be marked as "X"(cross) and you can see the new range.Again if x>a then all the greater numbers including x will be crossed.
The second game play starts with determining an amount of marbles.And you can pick up any 1~p(p>0 and p<=25% of total marble)amount of marble(s) at any time.There are two modes of the game : [a]who ever will pick up the last marble will win and [b]who ever will pick up the last marble will lose.
The last game play was like childhood cricket play by turning up a random page number and if it's unit's place is 0 then the player is OUT or any non zero(even number)then added to run.Inspiring from that very long lost game we decided to make it like our own.Here we set a fixed amount of overs to ball for every player after toss and while you are batting,the computer will predict a number between 0~6.If both of your predictions match then you are OUT.Same rule for computer while batting.And while the player is bowling s/he has to put a number from 0~6 and the same condition goes.
[1]Guess the Number (1-Player and 2-Player)
[2]Marble Game (1-Player and 2-Player)
[3]Hand Cricket (1-Player with console GUI)
* And to keep track of every game's history we made a separate history section where we used file to create a history of the previously game play results.
Well the first game is built on basic binary search algorithm.Firstly a random range of natural numbers will be created and will be shown on the console.Using default "rand" function,the computer would determine any random number from that range.The player(s) has/have to guess what the computer has selected.For 1P game we have set a fixed move number after which you can't guess and for 2P,who would guess the number first is the method.The game play is a binary search way because when you choose an incorrect number,say x and if the actual number is a and if x<a then all the number including the selected one will be marked as "X"(cross) and you can see the new range.Again if x>a then all the greater numbers including x will be crossed.
The second game play starts with determining an amount of marbles.And you can pick up any 1~p(p>0 and p<=25% of total marble)amount of marble(s) at any time.There are two modes of the game : [a]who ever will pick up the last marble will win and [b]who ever will pick up the last marble will lose.
The last game play was like childhood cricket play by turning up a random page number and if it's unit's place is 0 then the player is OUT or any non zero(even number)then added to run.Inspiring from that very long lost game we decided to make it like our own.Here we set a fixed amount of overs to ball for every player after toss and while you are batting,the computer will predict a number between 0~6.If both of your predictions match then you are OUT.Same rule for computer while batting.And while the player is bowling s/he has to put a number from 0~6 and the same condition goes.
- Platform we used
We used simple C language to conduct the whole idea of the project.The project is done using "Codeblocks" IDE.
- Difficulties we faced
Fist of all,new things and new ideas to implement was not always easy.So we first faced many problems especially the algorithm not working problem in guess the number game particularly.Next we faced another issue while considering an invalid input.Say we hope that you should give an integer as an input but somehow mistakenly you have given a float or a string or something that is not valid I mean.So we had to manually handle those each and every time and we had to make sure that the user input is a valid one.If we would use Java then it would be a lot easier as there is a try and catch method which can actually handle this kind of exception but as we told that we were using only C so we had to do it manually by checking all the time.Well another issue was building the console GUI for Hand Cricket game.Using ASCII characters we built the whole interface.But they were needed to be precise.As if one mismatch would happen then the whole setup would look worse.
- Some moments
- Much Grateful To
Obviously much more gratitude should go from me to my project partner without whose help and support it won't be possible do build the large project and combining all of these.So again much thanks and well wishes to :
Shahriar Ivan
Current Student,6th Semester,Dept. of Computer Science
No comments:
Post a Comment