Skip to content

Instantly share code, notes, and snippets.

View peterthorsteinson's full-sized avatar

Peter Thorsteinson peterthorsteinson

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using System;
namespace MyArithmetic
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(0.2 + 0.5 == 0.7); // True
Console.WriteLine(0.1 + 0.2 == 0.3); // False
using System;
class Program
{
static void Main(string[] args)
{
int sum;
Console.WriteLine("\n1. Using Convert.ToInt32() without exception handling.");
sum = 0;
foreach (string arg in args)
using System;
namespace ConsoleSinFunction
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i <= 400; i++)
{
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;
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;
namespace RandomArray
{
class Program
{
static void Main()
{
int[,] intArray2D = new int[10, 20];
Display(intArray2D);
// 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;
using System.Threading;
namespace PlotCircle
{
class Program
{
static void Main(string[] args)
{
int radius = 50;