Skip to content

Instantly share code, notes, and snippets.

View peterthorsteinson's full-sized avatar

Peter Thorsteinson peterthorsteinson

View GitHub Profile
using System;
namespace TicTacToeHumanVsMachineBruteForce
{
class Program
{
static char[] cells;
static Random rand = new Random();
static void Main()
{
int numberXWins = 0;
using System;
using System.Reflection;
class Program
{
static void Main()
{
Console.Write("Enter name of method to be called (Method1 or Method2): ");
string methodName = Console.ReadLine();
MethodInfo methodInfo = typeof(Program).GetMethod(methodName);
using System;
class Program
{
static void Main(string[] args)
{
Vector2D v1 = new Vector2D(3, 4);
Console.WriteLine(v1);
Vector2D v2;
v2.x = 5;
using System;
using System.Text;
namespace TicTacToe_OO // object oriented implementation of tic tac toe
{
class Program
{
static void Main()
{
while (true)
using System;
using System.Threading;
namespace PlotCircle
{
class Program
{
static void Main(string[] args)
{
int radius = 50;
// https://en.wikipedia.org/wiki/Tic-tac-toe and http://www.se16.info/hgb/tictactoe.htm
// If played properly, tic-tac-toe will end in a draw, making tic-tac-toe a futile game.
// Total number of X and O placements on a 3x3 grid = 9! = 362880, but many games end before completely filling in the grid.
// Also, many tic-tac-toe outcomes are logically equivalent in terms of reflection and rotation symmetries.
using System;
namespace TicTacToe
{
class Program
using System;
namespace RandomArray
{
class Program
{
static void Main()
{
int[,] intArray2D = new int[10, 20];
Display(intArray2D);
using System;
class Program
{
static int rows = 50;
static int cols = 50;
static int x = rows / 2;
static int y = cols / 2;
static char[,] cells = new char[rows, cols];
static bool isDoubleBuffering = false;
static void Main()
using System;
class MalloyPyramid
{
static void Main(string[] args)
{
Console.WriteLine("Enter a Number number under 100");
String rowCount = Console.ReadLine();
int rowNumber;
using System;
namespace ConsoleSinFunction
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i <= 400; i++)
{