Check for Anagrams in .Net C# 5.0

This program shows how you can check if two given input strings are Anagrams or not in CSharp language. Anagrams are two different words or combinations of characters which have the same alphabets and their counts. Therefore a particular set of alphabets can create many permutations of Anagrams. In other words, if we have the same set of characters in two words(strings) then they are Anagrams. 

We create a function that has input as a character array pair of inputs. When we get the two different sets of characters, we check the count of each alphabet in these two sets. Finally, we tally and check if the value of character count for each alphabet is the same or not in these sets. If all characters occur at the same rate in both the sets of characters, then we declare the sets to be Anagrams otherwise not. 

See the code below for C#:

Using Indexers in C#

Indexers are elements in a C# program that allow a Class to behave as an Array. You would be able to use the entire class as an array. In this array you can store any type of variables. The variables are stored at a separate location but addressed by the class name itself. Creating indexers for Integers, Strings, Boolean etc. would be a feasible idea. These indexers would effectively act on objects of the class.

Lets suppose you have created a class indexer that stores the roll number of a student in a class. Further, lets suppose that you have created an object of this class named obj1. When you say obj1[0], you are referring to the first student on roll. Likewise obj1[1] refers to the 2nd student on roll. 

Build a Typing Master Game in C#

This is a basic typing game concept. The form will display random letters. If the player types one of them, it disappears and the accuracy rate goes up. If the player types an incorrect letter, the accuracy rate goes down. As the player keeps typing letters, the game goes faster and faster, getting more difficult with each correct letter. If the form fills up with letters, the game is over!



How to convert from Decimal to Binary System in C#

This code below shows how you can convert a given Decimal number to the Binary number system. This is illustrated by using the Binary Right Shift Operator ">>".