Skip to content

Instantly share code, notes, and snippets.

View janell-baxter's full-sized avatar

Janell Baxter janell-baxter

View GitHub Profile
@janell-baxter
janell-baxter / Item.cs
Created July 9, 2020 16:06
Game-like application with explorable areas
namespace ExplorableAreasDemo
{
class Item
{
public string Name;
public string Description;
public Item(string name, string description)
{
@janell-baxter
janell-baxter / Menu.cs
Last active June 22, 2020 18:02
Demo for Introduction to Programming: Repetitive Lyrics (conditional statements, loops, random, array)
using static System.Console;
using System;
namespace RepetitiveLyricsDemo
{
//Practice refactoring on this code
//What are the redundencies?
//How could they be abstracted out into separate operations?
class Menu
{
@janell-baxter
janell-baxter / Angler.cs
Created June 14, 2018 19:38
Inheritance example for Introduction to Programming
using System;
using static System.Console;
namespace UnderWaterWorld
{
class Angler: Creature
{
public Angler(string _name, string _greeting) : base(_name, _greeting)
{
name = _name;
@janell-baxter
janell-baxter / Game.cs
Created June 12, 2018 22:04
Experimental practice example with arrays, lists, I/O, classes/instances, conditional statements, etc.
using System;
using System.Collections.Generic;
using static System.Console;
namespace ExplorableAreasI
{
class Game
{
List<Location> locations = new List<Location>();
Random random = new Random();
@janell-baxter
janell-baxter / Cipher.cs
Last active October 9, 2018 17:19
Example framework for string manipulation example (simple substitution cipher). Introduction to Programming, Summer 2018
using System.Linq;
namespace Cipher
{
class Cipher
{
string alphabet;
string substitute;
public Cipher()
using System;
namespace GridArray
{
class Program
{
static void Main()
{
int[,] grid = new int[5, 4] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 }, { 13, 14, 15, 16 }, { 17, 18, 19, 20 } };
@janell-baxter
janell-baxter / Bakery.cs
Last active June 4, 2018 19:41
Bakery Application (Introduction to Programming, Summer 2018): Using an Array to Store Menu Items
using System;
using System.Globalization;
using static System.Console;
namespace MegaByteBakery
{
class Bakery
{
// Two-dimensional array of menu items
public static string[,] menu = new string[,] { { "Filled Cupcake", "2.00" }, { "Garlic Bread", "1.50" }, { "Pie", "17.38" }, { "Cookie", "1.35" }, { "Fudge Brownie with Vanilla Icing", "2.60" }, { "Cheese Danish", "2.75" }, { "Croissant", "1.40" } };
@janell-baxter
janell-baxter / Game.cs
Last active June 4, 2018 16:07
Study Application Example Framework
using System;
using static System.Console;
namespace StudyApplication
{
class Game
{
public Game()
{
//constructor sets the title of the app and calls the menu
@janell-baxter
janell-baxter / Bumblebee.cs
Created June 4, 2018 02:06
Introduction to Programming Day Two (Summer 2018) Simple Application Example: Make a Bee!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DayTwoBumblebee
{
class Bumblebee
{
//Application using example code from C# 5.0 Pocket Reference, page 28
//http://shop.oreilly.com/product/0636920023975.do
using System;
namespace UmbrellaWizard
{
class Program
{
static void Main()
{