Skip to content

Instantly share code, notes, and snippets.

@taylonr
Forked from rnelson/FizzBuzzNoAbbreviations.cs
Last active March 22, 2016 14:42
Show Gist options
  • Save taylonr/831cb14cbf46af127b22 to your computer and use it in GitHub Desktop.
Save taylonr/831cb14cbf46af127b22 to your computer and use it in GitHub Desktop.
using UnsignedInteger = System.UInt16; // Sorry, I can't unabbreviate it on the RHS
// https://twitter.com/taylonr/status/712277308363542530
namespace FizzBuzz
{
class Program
{
static void Main(System.String[] args)
{
System.String outV = System.String.Empty; // Yeah yeah, StringBuilder
for (UnsignedInteger cn = 1; cn <= 100; cn += 1)
{
if (cn % 3 == 0)
{
outV += "Fizz";
}
if (cn % 5 == 0)
{
outV += "Buzz";
}
if (System.String.Empty == outV)
{
outV = cn.ToString();
}
System.Console.WriteLine(outV);
outputValue = System.String.Empty;
}
System.Console.WriteLine();
System.Console.WriteLine("Done.");
System.Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment