Posts

Showing posts from December, 2016

The Duel Of Creatures (A trading card game in C++)

Image
A few days back I've been to my grandma's house for the Christmas vacation! Just when I was feeling quite bored with nothing to do, I stumbled upon the idea of creating a card game which is based on many famous card games like 'Yu-gi-oh', 'Duel masters' and 'Duels of order and chaos'. I had an idea of creating such a game for a long time, but I haven't taken the time to develop one. It might be due to the reason that my cousin brother who lives at my grandma's house because he plays these kinds of games. This might have triggered an interest in me to create the game and make him play.

   Coming to the game it's a CUI(Character user interface) game and I've developed it using C++. This is a turn-based card strategy game. For people who don't know these kinds of games, here's a simple (and non-comprehensive) explanation.
Each player has a deck which has a certain number(20 in my game) of cards.Each card represents a creature which…

'Hello, World!' program in 7 different languages

Image
Generally 'Hello World!' program is the first ever program that you'd do in any language. It is a rite of passage into more complex programs in any language. So here's a quick look at how to write 'Hello, World!' program in 5 major languages which are:

JavaCC++C#PythonSQLRubyJava: publicclass HelloWorld {publicstaticvoid main(String[] args){// Prints "Hello, World" to the terminal window.System.out.println("Hello, World!");}}
C: #include "stdio.h"intmain(void){printf("Hello, World!");return0;}
C++:
#include "iostream"usingnamespacestd;intmain(){cout<<"Hello, World!";return0;}
C#:
publicclass Hello {publicstaticvoid Main(){ System.Console.WriteLine("Hello, World!");}}
Python:
print("Hello, world!")
SQL:
DECLARE message varchar2(20):='Hello, World!';BEGINdbms_output.put_line(message);END;/
Ruby:
puts'Hello, World!'

HOW TO CREATE TEXT GAMES USING C! : PART 3 (Constructing a menu)

Image
This is the third part of the series of how to create text games using C. If you haven't seen the previous posts check them out by clicking the links below:
PART 1: Using the rand() functionPART 2: Getting started! Coming to part 3, here we are going to discuss how to create a menu for the game.


If we look at any game, having a menu screen is quintessential as it provides the user with various options. Generally big games have some of the following options in their menu screen: Play: Enters you into the gameOptions/Setting: Generally, helps you change the video, audio and other settingsLeader Board: To show a record of top scores by playersHelp/Instructions: Gives instructions for playing the gameAbout: Gives details of the game such as who created the game, copyrights etc.Exit: To exit the game For example, here's a screenshot of the game Assassin's creed:

So now coming to our game which we are going to develop using C, what options can we provide? We definitely need to ha…