Month: October 2008

Generating Controlled Random Numbers in C#

Generating random numbers is a fundamental requirement in various programming scenarios, from creating dynamic content to simulating unpredictable events. In C#, the System.Random class provides a versatile solution for generating random values. In this article, are going to explore the basics of random number generation in C# and write practical examples that showcase its applications.

Read More

Snake Game – C Imlementation

This C program simulates the game “snake” which is usually available in old mobile phones. A string of characters moves on the screen according to arrow keys pressed by user. If it touches itself or screen boundary, the program terminates. When the snake moves, in arbitrary screen positions some digit (1-9) appears. The objective of the game is to make the snake eat the said digit, so that it is added to the score. When a digit is eaten, the size of the snake increases by the number of characters equal to the value of the digit.

Read More

C Program: Number Shuffling Game

This C program is a simple console-based implementation of a number-shuffling game. The game presents a grid of numbers, and the objective is to rearrange them in ascending order. The player can move the numbers by pressing the corresponding number keys, and the game tracks the number of moves taken to complete the puzzle.

Read More

C Program – Tic-Tac-Toe Game – Command Line

This is a console version of Tic Tac Toe computer game written in c programming language. The game runs in text mode of command prompt and users can play the game in text mode. The game has many options to choose from, like playing with computer, friend. While playing with computer use can select either novice mode or advance mode.

Read More

Advanced C++ Inheritance Techniques for Effective Object-Oriented Programming

In Object Oriented Programming Inheritance is the process by which objects of one class acquire the properties and functionality of objects of another class. In the last tutorial on inheritance in C++ we developed a model using modes of transportation to illustrate the concept of inheritance. In this article we will use that model to illustrate some of the finer points of inheritance and what it can be used for.

Read More