Random - CoinToss

A Random extension method that flip a coin toss.

Try it

public static void Main()
{
    var random = new Random();

	//C# Extension Method: Random - CoinToss
    Console.WriteLine(random.CoinToss());
}

View Source
using System;

public static partial class Extensions
{
    /// <summary>
    ///     A Random extension method that flip a coin toss.
    /// </summary>
    /// <param name="this">The @this to act on.</param>
    /// <returns>true 50% of time, otherwise false.</returns>
    public static bool CoinToss(this Random @this)
    {
        return @this.Next(2) == 0;
    }
}