Skip to content

Instantly share code, notes, and snippets.

View ajarmst's full-sized avatar

AJ Armstrong ajarmst

  • Northern Alberta Institute of Technology
  • Edmonton, Canada
View GitHub Profile
@ajarmst
ajarmst / PiState.cs
Last active December 23, 2015 04:59
State machine using enumerations.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace PiState
{
class Program
{
@ajarmst
ajarmst / EnumFlags.cs
Created September 16, 2013 17:24
Using enumerations for binary flags.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Enumeraflag
{
class Program
{
//A bunch of binary flags (note that only one bit is set on each)
@ajarmst
ajarmst / SimpleStucture.cs
Created September 18, 2013 15:18
Simple demonstration of a very basic structure in C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StructStudent
{
class Program
{
public struct Student
@ajarmst
ajarmst / DataStructures.cs
Created September 20, 2013 16:53
Demo of structures containing structures and enumerations. Also uses the List<>.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Debt
{
public enum Month
{
Jan = 1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
@ajarmst
ajarmst / list.cs
Created September 23, 2013 16:59
Some of the methods available with the C# generic List<>, which is really a vector.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Vector
{
class Program
{
static void Main(string[] args)
@ajarmst
ajarmst / TextIO.cs
Created September 30, 2013 17:29
Very simple little word processor for appending to text files. Demo of basic text file handling.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Texty
{
class Program
{
@ajarmst
ajarmst / words.cs
Created October 2, 2013 15:36
Some basic string parsing and populating a list.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Words
{
class Program
{
@ajarmst
ajarmst / bitwise.cs
Created October 2, 2013 15:39
Simple demo of some bitwise operations in C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
namespace bitwise
{
class Program
{
@ajarmst
ajarmst / WordFreq.cs
Created October 7, 2013 17:42
Counting word frequencies. Demo of file i/o and serialization.;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Words
{
[Serializable]
public class WordFreq
{
@ajarmst
ajarmst / RefOut.cs
Created October 9, 2013 15:17
Simple demo of ref and out parameters
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RefOut
{
class Program
{
static void Main(string[] args)