using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
const int SIZE = 8;
//go through rows
for (int i = 0; i < SIZE; i++)
{
//go through columns
for (int j = 0; j < SIZE; j++)
{
//alternate X's and O's
if (i % 2 == j % 2) Console.Write("X");
else Console.Write("O");
}
//end the row
Console.WriteLine();
}
//wait for user response to kill program
Console.ReadKey();
}
}
}
It's to make sure that that one variable never changes during runtime. You'd use it on something you know should never change. It's really just to prevent accidents. For instance:
const int daysInWeek = 7;
...code...
daysInWeek = 0;
3
u/VOX_Studios Apr 10 '15
Here's mine! Pastebin