Tags
Category
C

A game similar to "wrestling sticker".

This game, though has been developed for C-Programming project, has also been developed with motto of encouragement.The basic layout of the program is very typical. There is a Main Menu, almost like a “Table of Contents” in a book. Upon entering the “play game”, there is an option to choose between “play with computer” and “play with human”. Sticker game is very popular in real world as “wrestling sticker” game. It’s just an attempt to make a similar game. Since we didn’t use graphics, it was nearly impossible for us to include such stickers in the game. So, we chose to use ASCII characters. Keeping in mind that, the logic of the game should be similar with the real one, we have especially focused on that matter.

 

Thus, by this project, we believe that enthusiasm will be created among new generation to develop games on their own with much eagerness. The main motto of our project is all hidden in it.

 

In this project, we will make two mostly used user defined functions: gotoxy() and sleep(). Sleep will pause the program execution for the specified time. Gotoxy() will set the cursor position at the specified location.

We shall display the shapes of the stickers with “-,_,|”, which is contained in function player1(). For the situation when the user would want to play with computer, we shall use time function as seed to get random values. At first, player will choose a number printed at the back of the sticker and the contents of the sticker will be characters equivalent to ASCII values of 1 to 5. If player would want to turn the card that has already been turned, we will display error message and ask the player to turn another unturned sticker by using goto statement. After that, computer turns the random sticker. If both the stickers match, we shall increase the score of the player who has turned the sticker at last, by the number of stickers that has already been turned; and decrease the same amount in another player’s score. Finally, when all the stickers are turned, player with higher score will win.

 

When the user will choose to play versus human, the same thing is repeated for first player. But for second player, when player will choose a number printed at the back of the sticker, the contents of the sticker will be characters equivalent to ASCII values of 1 to 5. If any of the players would want to turn the card that has already been turned, we will display error message and ask the players to turn another unturned sticker by using goto statement. After comparing the scores as that for single player, the winner’s name is displayed.

To get assured that computer (or second player) doesnot turn the same sticker as turned by first player, we shall use sleep() function so that time() function when it will be called, will not necessarily generate the same random number as that by first player.

Again we shall use goto statement when the player will want to play the game again. 


Share with your friends


Team Members

Shrawan Bk

0 Comments

Post Your Comment

Please Login to Comment