This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace TicTacToeHumanVsMachineBruteForce | |
{ | |
class Program | |
{ | |
static char[] cells; | |
static Random rand = new Random(); | |
static void Main() | |
{ | |
int numberXWins = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Vector2D v1 = new Vector2D(3, 4); | |
Console.WriteLine(v1); | |
Vector2D v2; | |
v2.x = 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace TicTacToe_OO // object oriented implementation of tic tac toe | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
while (true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace PlotCircle | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int radius = 50; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace RandomArray | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
int[,] intArray2D = new int[10, 20]; | |
Display(intArray2D); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class MalloyPyramid | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Enter a Number number under 100"); | |
String rowCount = Console.ReadLine(); | |
int rowNumber; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleSinFunction | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for (int i = 0; i <= 400; i++) | |
{ |