View textmanager.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace ancientcode { | |
public class TextManager { | |
private TextManagerHelper hlp = new TextManagerHelper(); | |
private Random rnd = new Random(); |
View akii.cs
class RollMade { | |
public int Pins; | |
} |
View 01 bowling game.cs
using System.Linq; | |
using System.Collections.Generic; | |
class BowlingGameBareBones | |
{ | |
#region Event definitions | |
abstract class Event {} | |
class Rolled : Event { | |
public uint Pins; |
View 00 eventstore.cs
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using Newtonsoft.Json; // NuGet package dependency | |
namespace eventorientation | |
{ |
View Experimenter.cs
public static class Experimenter | |
{ | |
private static ILogging __log; | |
public static void Init(ILogging log) => __log = log; | |
public static bool Try(string logMsg, Action experiment) | |
{ | |
try | |
{ |
View ocr1.txt
_ _ _ _ _ _ _ | |
| _| _||_||_ |_ ||_||_| | |
||_ _| | _||_| ||_| _| | |
_ _ _ _ _ _ _ | |
|_||_|| || ||_ | | ||_ | |
| _||_||_||_| | | | _| |
View classify.cs
void Classify(string number, Action<int> onArabic, Action<string> onRoman) { | |
if (int.TryParse(number, out var arabicNumber)) | |
onArabic(arabicNumber); | |
else | |
onRoman(number); | |
} | |
/* | |
* Note how all details about how classification works are hidden in the function Classify(). | |
* It's not visible to the outside wheter an "if" is used or a table lookup or whatever. |
View layered.cs
using System; | |
using System.Linq; | |
namespace layered | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) { | |
var data = new DataLayer(); | |
var business = new BusinessLayer(data); |
View 01 terrain generator.cs
using System; | |
using System.Linq; | |
namespace terraingenBlog | |
{ | |
public class TerrainGenerator { | |
public static void Interpolate(Terrain terrain, float offset, float amplitude) { | |
Interpolate(terrain, offset, amplitude, Random_numbers_between_minus_1_and_1()); | |
} |
View 01 Main.elm
module Main exposing(main) | |
import Html exposing (Html, div, span, br, text, table, tr, td, button) | |
import Html.Attributes exposing (style) | |
import Html.App exposing (beginnerProgram) | |
import Html.Events exposing (onClick) | |
import Array exposing (Array) | |
import List |
NewerOlder